In short
- Both tools have an automatic reviewer for agent actions, and both vendors say it is no hard boundary: Cursor calls Auto-review "not a security boundary", Anthropic says auto mode "does not guarantee safety".
- Cursor sandboxes shell commands with the network blocked by default in Auto-review. Claude Code's sandbox is off until you run
/sandbox, and native Windows runs commands unsandboxed. - Cursor ships review on pull requests (Bugbot, Security Review) and can host apps with publish checks. Claude Code ships
/security-review, two security plugins and Code Review, and hosts nothing. - Every review tool on both sides reads source code. None signs up twice on your live app to see whether account B can read account A's records.
- This page does not rank the two on coding quality. The choice changes how the agent works on your machine. It does not change what you must test on the live app.
On this page
- The short answer
- Cursor vs Claude Code: security features side by side
- What the agent may do on your machine
- Review commands: what each one reads
- Where the app and its data end up
- What neither of them checks: the deployed app
- A self-check that works for both
- Settings worth changing in each tool
- Where Keybrum fits, and where it does not
- Questions
- Sources
The short answer
Cursor is an AI code editor with an agent that runs on your machine or on Cursor's cloud agents. Claude Code is Anthropic's coding agent for the terminal, the IDE, a desktop app and cloud sessions. On security they are closer than the search suggests. Both ask before risky actions unless you tell them to stop asking. Both can run shell commands in an operating-system sandbox. Both ship commands that review a branch for vulnerabilities.
The differences sit in the defaults and in what each product hosts. This page compares those, with every fact taken from each vendor's documentation on 13 November 2026. It does not say which one writes better code: that is a different question, and we have no data on it. The single-tool pages go deeper: Cursor app security and Claude Code security.
Cursor vs Claude Code: security features side by side
| Question | Cursor | Claude Code |
|---|---|---|
| Where the agent runs | Your machine, or Cursor's cloud agents | Your machine, or an isolated VM per cloud session |
| Approval modes | Run Modes: Auto-review, Allowlist, Run Everything. Cloud agents never ask for approval | Manual, acceptEdits, plan, auto, dontAsk, bypassPermissions |
| Starting mode | Cursor's security page says terminal commands need approval by default; its changelog calls Auto-review the recommended default | Auto mode for interactive terminal and VS Code sessions from version 2.1.283. claude -p starts in Manual |
| OS sandbox for shell commands | Yes in Auto-review, optional in Allowlist. Seatbelt on macOS, Landlock and seccomp on Linux | Off by default, turned on with /sandbox. Seatbelt on macOS, bubblewrap on Linux and WSL2. Not on native Windows |
| Network from sandboxed commands | Blocked by default, then opened to a built-in list of package registries and git hosts plus your sandbox.json | Through a local proxy with an allowlist that starts empty |
| Reads outside the project | Allowed without approval by default (Read Access set to System) | File tools ask in Manual mode. Sandboxed commands can still read most of the machine, including ~/.ssh |
| Keeping secrets out of context | .env* and .gitignore files ignored by default, plus .cursorignore. The terminal and MCP tools can still read them | Deny rules such as Read(./.env) in settings, and sandbox credential rules. Nothing is denied until you add them |
| Security review of code | Bugbot and Security Review on pull requests, /review-security before you push, Vulnerability Remediation on merged code | /security-review on a branch, the security-guidance plugin while Claude writes, the Claude Security plugin, Code Review on pull requests (Team and Enterprise) |
| Hosting and database | Apps on paid plans with cloud agents: hosting, a Postgres database, publish checks | None. Everything lives in your own accounts |
| Published advisories | More than 30 on the cursor/cursor GitHub repository | More than 30 on the anthropics/claude-code GitHub repository |
What the agent may do on your machine
Cursor: Run Modes and a sandbox
Cursor's agent reads files and edits workspace files without asking. Terminal commands, MCP connections and configuration files need approval by default. Run Modes then decide how much runs alone. In Auto-review, allowlisted calls run at once, other shell commands run in the sandbox when they can, and calls that cannot be sandboxed go to a classifier on Cursor's backend. In Allowlist, only the commands you listed run without a prompt. Run Everything runs every tool call, with no sandbox and no classifier.
The sandbox blocks the network by default, then opens it to a built-in list of registries and git hosts and to the domains in your sandbox.json. It protects paths such as .git/config, .git/hooks, .vscode and .cursorignore. Two defaults deserve a look. Read Access is set to System, so the agent reads files outside the workspace without approval until you switch it to Workspace. And Workspace Trust is disabled by default. Cursor's own wording on Auto-review is that it is "not a security boundary".
Claude Code: permission modes, then a sandbox you turn on
Claude Code starts interactive sessions in auto mode from version 2.1.283: a separate classifier model reviews actions and blocks the ones it judges unsafe, such as curl | bash, sending sensitive data to outside endpoints, production deploys and force pushes. Manual mode reads freely and asks before edits and commands. Anthropic's docs are as candid as Cursor's: auto mode "reduces permission prompts but does not guarantee safety".
The sandbox is a separate layer and it is off until you run /sandbox or set sandbox.enabled. Once on, shell commands can write only to the working directory, a temp directory and folders you added, and they reach the network through a proxy whose allowlist starts empty. Reads stay open on most of the machine, including ~/.ssh and ~/.aws/credentials, until you deny them. On native Windows, commands run unsandboxed: Anthropic's docs say to use WSL2 for the sandbox.
Review commands: what each one reads
Both products review code for security issues, at different moments.
| Moment | Cursor | Claude Code |
|---|---|---|
| While the agent writes | Hooks you write, such as an afterFileEdit scanner | The security-guidance plugin: a pattern check on each edit, a model review at the end of each turn and on each commit Claude makes. All plans |
| Before you push | /review-security, in Cursor 3.7 and later: your branch against the base branch | /security-review: one pass over the changes on your branch |
| On the pull request | Bugbot on every update, and Security Review | Code Review, on Team and Enterprise plans |
| On the whole codebase | Vulnerability Remediation scans merged code and patches confirmed findings | The Claude Security plugin: a multi-agent scan with verified findings and patches you apply yourself |
Two details matter when you rely on them. Bugbot's GitHub check ends as neutral when it reports findings, unless you configure it to fail on unresolved issues, so requiring the check does not block a merge by default. And Anthropic states that none of the security-guidance layers block writes or commits: findings go back to Claude as instructions, and "the review model can miss issues". Use these tools. They catch injection, unsafe DOM calls and missing authorization in the code they read.
Where the app and its data end up
Claude Code has no hosting, database or auth service. It writes files in your repository, and what it sets up in Supabase, Vercel or Stripe lives in your accounts. Cursor is the same when you host elsewhere. The exception is Apps, on paid plans with cloud agents: Cursor hosts the app, provisions a Postgres database when the app needs one, and keeps secret values out of the agent's sight. Every publish goes through four checks that stay on: files with API keys or tokens block the publish, credential files block it, .env files are left out and source maps are removed.
Those publish checks are a real advantage for apps hosted by Cursor. They stop at Cursor's hosting. An app deployed on Vercel, Netlify or a VPS gets none of them, from either tool. Cursor's documentation for Apps also says it is not responsible for your apps, your prompts or the outputs. Anthropic's says you are responsible for reviewing proposed code and commands. Both draw the line at the same place.
What neither of them checks: the deployed app
Every tool above reads a repository. A large part of what decides whether your app leaks is somewhere else, and looks the same whichever agent wrote the code.
| What leaks | Why a code review misses it | What a stranger does |
|---|---|---|
| Database policies | Row level security switched off in the Supabase dashboard, or Firebase rules edited in the console, are in no file | Reads or writes tables with the public key from your JavaScript |
| Keys in the bundle | The key sits in a host's environment variable with a NEXT_PUBLIC_ or VITE_ prefix, or a route returns it at runtime | Copies your OpenAI, Stripe or service role key from the browser |
| Per-user access | A review reads one diff. It does not sign in as two users | Changes an id in a request and reads another customer's record |
| Open AI routes and webhooks | Rate limits and signature checks are easy to judge as present when a helper exists but is not called on one route | Spends your model credits, or sends a fake payment event |
| What got deployed | A stale branch, a preview wired to production data, source maps, a served .env | Reads your source or your secrets |
The database row has a public case. CVE-2025-48757 was assigned after 170 of 1,645 Lovable apps tested, about one in ten, had missing or weak row level security. A migration written by Cursor's agent or by Claude Code without enable row level security fails the same way. The Supabase RLS guide has the policies, and auditing AI-generated code covers the review side.
A self-check that works for both
Run these on your own app only. The first reads your database settings, the second your build, the third your live site.
- 1
List tables without row level security
In the Supabase SQL editor, run the first query below. Every table it returns can be read with your public key unless a policy says otherwise. The RLS checker reviews the policies too.
- 2
Search the production build for secret keys
Build the app and run the
grepbelow on the files that ship to the browser. Paste anything it finds into the API key leak checker, which says which keys belong in a browser. - 3
Open account A's record as account B
Sign up twice in two browser profiles. As A, create a record and copy the request from the network tab. Replay it with B's session, then with no session. B should get a 404 and the signed-out call a 401. Anything else is an IDOR.
- 4
Call your AI route signed out
Run the last command below against your own app. If a model answers, anyone can spend your credits. The unprotected AI endpoint guide has the fix.
select schemaname, tablename
from pg_tables
where schemaname = 'public'
and rowsecurity = false
order by tablename;npm run build
grep -rlE "sk_live_|rk_live_|sk-proj-|sk-ant-|sb_secret_|PRIVATE KEY-----" .next/static dist build 2>/dev/null
# Your own app only. Expect 401, never a model's answer.
curl -i -X POST https://your-app.example/api/chat \
-H "content-type: application/json" \
-d '{"message":"hello"}'Settings worth changing in each tool
- Cursor: keep Auto-review or Allowlist, and leave Run Everything for throwaway environments.
- Cursor: set Read Access to Workspace so reads outside the project ask first, and turn on Workspace Trust for repositories you did not write.
- Cursor: make the Bugbot check fail on unresolved issues if your plan has the setting, and put review rules in
.cursor/BUGBOT.md, since Bugbot does not read.cursor/rules. - Claude Code: run
/sandbox, and deny reads of.envfiles,~/.sshand~/.aws/credentialsin settings. - Claude Code: install the security-guidance plugin and run
/security-reviewbefore each merge. - Both: give the agent test keys, since ignore files and deny rules do not cover every path to a secret.
- Both: read the
.cursor/,.claude/and MCP configuration of a repository you did not write before you open it, and stay on a current version.
Where Keybrum fits, and where it does not
Keybrum does not test Cursor or Claude Code. It does not look at your machine, your agent's permission mode or its sandbox, and it is not a replacement for the review commands above. It tests the other half: the deployed app, on apps whose owner proved ownership.
On a live app it reads Supabase tables with the public key, first with no account and then as a new one, and does the same on Firestore collections. It calls every API route your JavaScript names with no session. It creates a marked record as one account and asks for it as a second account, which is the two-account test done for you. It posts a short prompt to AI routes with no session, sends one unsigned event to your Stripe webhook, requests /.env and source maps, and checks whether keys found in the bundle work. Each finding comes with the request that worked. Both agents can read the findings and the fixes through Keybrum's MCP server (setup), then ask for a retest.
A one-time report is €49 for one app, with retests of its findings for 7 days. Plans start at €29 a month excluding VAT for 5 apps and attack again on every deploy.
Questions
Is Claude Code safer than Cursor?
Neither vendor's documentation supports a simple yes. Cursor sandboxes shell commands by default in Auto-review; Claude Code's sandbox is opt-in but its auto mode classifier is on by default. Both say their automatic reviewer is no hard boundary, and both have published more than 30 security advisories. Your settings matter more than the brand.
Does Cursor or Claude Code check my deployed app?
No. Bugbot, Security Review, /security-review and the Claude Security plugin all read source code. Anthropic's docs say the review reads your checkout, "not a running site or deployed service". Cursor's publish checks apply only to apps hosted by Cursor.
Which one handles secrets better?
Cursor ignores .env* files by default, but says the terminal and MCP tools can still read ignored files. Claude Code denies nothing until you add deny rules, and its auto mode allows reading .env and sending credentials to their matching API. With both, keep production keys off the machine and give the agent test keys.
Can I use both on the same project?
Yes. Each one loads its own rule files from the repository, so write your security rules in both places: an .mdc file in .cursor/rules with alwaysApply: true for Cursor, and CLAUDE.md for Claude Code. The checks on the live app do not change.
Does Cursor host my app's database?
Only if you use Apps on a paid plan with cloud agents: Cursor then provisions a Postgres database and hosts the app in an account isolated from other customers. Otherwise your database is wherever you put it, and its access rules are yours to set. Claude Code never hosts a database.
Which one writes more secure code?
We have no data that separates the two, and this page does not claim any. Studies of AI-generated code, such as Veracode's 2025 test of more than 100 models, found security flaws in a large share of tasks across models. Review the code and test the live app with either tool.
Sources
- 1.Agent security, Cursor
- 2.Run Modes, Cursor
- 3.Ignore files, Cursor
- 4.Security Agents, Cursor
- 5.Bugbot, Cursor
- 6.Apps, Cursor
- 7.Security advisories for cursor/cursor, GitHub
- 8.Security, Anthropic
- 9.Choose a permission mode, Anthropic
- 10.Sandboxing, Anthropic
- 11.Catch security issues as Claude writes code, Anthropic
- 12.Scan your codebase for vulnerabilities, Anthropic
- 13.Security advisories for anthropics/claude-code, GitHub
- 14.CVE-2025-54135, CVE Program
- 15.CVE-2026-33068, CVE Program
- 16.CVE-2025-48757, NVD
- 17.AI-Generated Code Poses Major Security Risks in Nearly Half of All Development Tasks, Veracode