Cursor security: privacy mode, run modes and known vulnerabilities
Cursor security comes down to four settings: Privacy Mode, a run mode, the sandbox and file protections. Privacy Mode means Cursor will not train on your data. Run modes are best-effort guardrails, not a hard security boundary. By default terminal commands need your approval, but agents can change workspace files without approval. The published vulnerabilities below involve prompt injection, the MCP install path and sandbox escapes.
01Cursor security settings at a glance
| Setting | What it does | Where it stops |
|---|---|---|
| Privacy Mode | Cursor will not train on your data; open to free and Pro users | It is about training, not about what a command can do |
| Run mode | Auto-review, Allowlist or Run Everything | Not a security boundary; the classifier, a small AI model that judges each action, can make mistakes |
| Sandbox | Terminal commands run without full machine access | Some commands need full access and bypass it |
| File-Deletion Protection | Stops the agent deleting files automatically, including rm | User reports say a PowerShell delete got through |
| External-File Protection | Stops automatic changes outside the workspace | Applies to automatic changes only |
| Browser Protection | Stops the agent running Browser tools automatically | Applies to the Browser tools only |
| MCP approvals | Connections and each MCP tool call need approval by default | An approved config could be swapped in 1.2.4 and below |
Run modes are set in Settings, then Agents, then Approvals & Execution. Cloud Agents do not use run modes. An MCP server is a helper program that gives the agent extra tools.
02Run modes: Auto-review, Allowlist, Run Everything
Cursor has three modes. Auto-review sends each action to the classifier, which runs on Cursor's backend with small Cursor-managed models. Cursor recommends it as the safest useful mode and shipped it as the recommended default in Cursor 3.6, on May 29, 2026. Its limits are the ones in the table: it is not a security boundary, and it can err in both directions.
Allowlist mode keeps a list of commands that may run without asking. The match is by prefix and case-sensitive: git matches git status but not gitk. In Cursor 3.5, Ask Every Time was deprecated and Run in Sandbox was folded into Allowlist. Run Everything skips approvals; the full story is in Cursor YOLO mode.
03The sandbox and what it leaves open
A sandbox is a fence the operating system puts around a command. Cursor's lets terminal commands run without full machine access. A sandboxed command cannot freely read protected files, write outside approved paths or contact arbitrary network destinations. On macOS it uses Apple's built-in sandbox, with no extra setup on Cursor v2.0 or later.
Defaults to know:
- Workspace files are readable and writable, while paths such as
.git/configand.git/hooksare protected. - The network is blocked by default and opened through a network mode and
sandbox.json, a file where you list extra allowed hosts. The default mode already allows package managers, language tools and github.com. - Read access defaults to System, so the agent can read files outside the workspace without approval. A Workspace read mode needs Cursor 3.23 or later.
- A sandboxed command that fails on a restriction can be rerun outside the sandbox, and the classifier reviews the rerun.
Details are on the Cursor sandbox page.
04Is Cursor a security risk? The published vulnerabilities
Cursor's security advisories on GitHub and the National Vulnerability Database record many more flaws than the five below. A CVE is a public ID number for a known vulnerability. RCE means remote code execution: an attacker running code on your machine. Prompt injection means hidden instructions placed in text the agent reads, such as a README or a web page.
| CVE | What it allowed |
|---|---|
| CVE-2025-54135 | Versions below 1.3.9 allowed writing in-workspace files with no approval; indirect prompt injection could chain to RCE by writing .cursor/mcp.json; fixed in 1.3.9 |
| CVE-2025-54136 | In 1.2.4 and below, an attacker could swap an approved MCP config for a malicious command without a new prompt |
| CVE-2025-64106 | A crafted MCP deep-link, a link that opens Cursor and installs a server, bypassed the install warning and hid commands |
| CVE-2026-26268 | Sandbox escape, meaning a command leaving its fence, through git hooks (scripts git runs automatically) written by a prompt-injected agent; fixed in 2.5 |
| CVE-2026-50549 | Rated critical: sandbox escape through a symlink, a shortcut to another path. Cursor checked the real path of a write, and when that check failed it wrote without approval |
Three of the five rows involve prompt injection or the MCP install path, and two are sandbox escapes.
A separate case was a tampered marketplace extension. It tried to install a persistent SSH backdoor, meaning a hidden remote login to the machine. On macOS it used a LaunchAgent, a startup entry that keeps a program running in the background, and retried about every 60 seconds. Uninstalling the extension may not be sufficient, so rotate credentials from a trusted system.
05Deletes and the old denylist
Two kinds of evidence sit outside the advisories. In a June 2025 forum thread, Cursor staff asked whether file deletion protection was enabled and suggested running YOLO in a virtual environment. A user in another thread said Cursor deleted everything on his computer. Another reported that delete protection did not stop PowerShell Remove-Item, and that the deletion could not be recovered from a checkpoint.
Backslash Security reported four ways to bypass Cursor's denylist, a list of commands the agent should not run, and concluded it cannot be relied upon. That finding is about the July 2025 settings, an allowlist, a denylist and a delete-protection checkbox. Current run modes differ.
06Is Cursor trustworthy with your code?
Cursor's security page lists ISO 27001, ISO 42001, AIUC-1 and SOC 2 Type II attestation. These are audits of the company's practices. In your own project, agents can modify workspace files without approval except config files, so use version control. They also warn that with auto-reload, agent changes might execute before you review them.
07Hardening Cursor on a Mac
- Turn on Privacy Mode.
- Pick Auto-review or Allowlist and treat either as a guardrail.
- Keep MCP approvals on and read each server before you accept it.
- Commit often, because the agent can change files without approval.
- For untrusted repositories, use a basic text editor instead. Workspace trust, Cursor's option to treat a folder as untrusted, is disabled by default.
- Add a hook, your own script that Cursor runs at a set point.
beforeShellExecutioncontrols shell commands, and exit code 2 blocks the action. Code 2 blocks the action. If the hook fails any other way, the action still runs, which is called fail-open, until you setfailClosed: trueon the hook, which blocks on a crash, timeout or no output as well.
Cursor's enterprise guidance is to pair best-effort guardrails such as Auto-review with deterministic ones such as approvals, hooks and sandboxing, meaning controls that always give the same answer. Local sandbox config cannot weaken team-admin policies.
For the Claude Code equivalent, see Claude Code security and hooks. Risks every agent shares are in AI agent security. Verdict pages: Is Cursor safe?, Is Claude Code safe?, Is Codex safe?, Is Copilot safe?, Is Claude safe?.
08What good Cursor security looks like
Switch on Privacy Mode, choose a run mode knowing it is a guardrail, keep approvals on, commit often and update when advisories are published.
Cursor's run modes and sandbox limit what the agent can do; they are not a record of what already ran on your Mac. Artificial Immunity's free, open-source core watches agent sessions and every program start on your Mac, including Cursor, and reports what it finds.
FAQ
Is Cursor a security risk?
It carries the risks of any coding agent that can run commands, and it has published vulnerabilities, such as CVE-2025-54135, fixed in 1.3.9. Cursor's docs describe run modes as best-effort guardrails, not a hard security boundary.
Is Cursor trustworthy?
Cursor holds ISO 27001, ISO 42001, AIUC-1 and SOC 2 Type II attestation. Those cover the company; for the agent, the docs say to use version control because agents can change workspace files without approval.
Does Cursor leak your code?
Part of it is up to you. With Privacy Mode on, Cursor will not train on your data. In Auto-review mode, the classifier that checks calls runs on the Cursor backend. What the agent itself may do with your files is a separate question: by default terminal commands need your approval and each MCP tool call needs approval too.
Does Cursor train on my code?
Not when Privacy Mode is enabled. It is open to anyone, free or Pro, so turn it on before you open a client project.
Can Cursor delete my files?
It was reported to. A user said Cursor deleted everything on his computer in YOLO mode, and another said delete protection did not stop a PowerShell Remove-Item command. File-Deletion Protection is meant to stop automatic deletes, including rm.
Which Cursor run mode is safest?
Cursor recommends Auto-review as the safest useful run mode. It is not a security boundary, and its classifier can allow a call you would have blocked or block one you would have allowed.