Is my Cursor app secure? What Cursor protects and what it does not
.cursorignore, protect your machine and files while the agent works. Check for keys in source and in .cursor/mcp.json, secrets behind NEXT_PUBLIC_ or VITE_, server-side checks on every route, and how much the agent may run without asking.The self-check
- Keys in source. Search what git tracks:
git grep -nE "sk_live_|sk-[A-Za-z0-9_-]{20,}|AKIA|ghp_|service_role". Anything real belongs in a server-side environment variable, and must be rotated if it was ever committed (see our guide on leaked keys). - Keys in
.cursor/mcp.json. Project MCP servers are configured in.cursor/mcp.jsoninside your repo. If it holds a token, replace the value with${env:NAME}so Cursor reads it from your environment, then checkgit log -p --all -- .cursor/mcp.jsonfor keys committed earlier. See our MCP config guide. - Browser-exposed variables. Search for
NEXT_PUBLIC_(Next.js) andVITE_(Vite). Both frameworks copy these values into the JavaScript sent to every visitor, so none of them may hold a secret. - Server-side checks. For each API route or server action that returns private data, call it signed out, for example
curl -i https://your-app.com/api/your-route, and again as a second test user. You should get 401 or 403, never another user's data. .envfiles. Rungit ls-files | grep -i "\.env". Only an.env.examplewith placeholder values should appear, and.gitignoreshould list.env*followed by!.env.example(without the second line, git ignores the example file too). Cursor keeps.envfiles out of AI context by default, but that does not stop git from committing them.- Run mode. Open Settings, Agents, Approvals & Execution. Run Everything runs every tool call automatically. Auto-review and allowlists cut prompts, but Cursor's docs call them best-effort guardrails, not a hard security boundary. Also,
.cursorignoreblocks the agent's file tools only: terminal commands and MCP tools can still read ignored files. - Repos you did not write. Workspace trust is off by default in Cursor. Before opening an unfamiliar repository, enable it with
"security.workspace.trust.enabled": truein your usersettings.json, or open untrusted code in a plain text editor, as Cursor's docs suggest.
What does Cursor protect, and what is still your job?
| Area | Cursor does this | Still your job |
|---|---|---|
| Your machine | Asks before terminal commands by default. Each MCP tool call needs approval unless you allowlist it. | Keep approvals on, review your allowlist, and avoid Run Everything on unfamiliar code. |
| Files the agent sees | .cursorignore and .gitignore keep files out of AI context, and .env files are ignored by default. | Remember terminal commands and MCP tools can still read ignored files. |
| MCP credentials | Supports ${env:NAME} interpolation in mcp.json. | Keep literal keys out of .cursor/mcp.json. |
| Code review | Security Review and the /review-security skill check changes and pull requests for security bugs. | Test your own sign-in and data rules. A review is not proof the app is safe. |
| Your deployed app | Nothing. Cursor does not host or configure it. | Secrets, database rules, server-side checks and payments. |
If you find a problem
Rotate exposed keys first, then fix the code and re-test signed out and as a second user. If your app uses Supabase, see our Supabase RLS guide.
Or have it checked: the Irth Labs App Health Check is $490, a written report within 48 hours with a fixed repair price.
1. Run the free local check
npx caelo .
Caelo is a free, open source (MIT) command line tool and MCP server from Irth Labs that checks the files of an AI-built app for exposed API keys, Supabase and Firebase misconfigurations and .env files with real values. It runs on your machine, uploads nothing and uses no AI model. Each finding comes with a plain-English fix.
2. Act on a finding
Follow the fix in your report and run Caelo again. If Git could commit an untracked file containing secrets, preview a US$19 quick fix for that file.
For findings that need an engineer, Irth Labs offers a US$490 App Health Check. You receive a written report within 48 hours and a fixed repair quote. The fee counts toward the repair if you proceed.
Questions
Does .cursorignore protect my secrets?
Partly. It keeps files out of the agent's file tools and AI context, and Cursor ignores .env files by default. Cursor's docs say terminal commands and MCP tools run outside those controls and may still read ignored files. It also does nothing about what you commit or deploy.
Is it safe to commit .cursor/mcp.json?
Yes, if it holds no literal secrets. Use ${env:NAME} for every key and token, and set the values in your shell profile or system environment.
Is Cursor itself insecure?
This is about apps built with it, not the editor. The same app checks apply to Lovable, Bolt, Replit and v0 apps.