# Is my Cursor app secure? What Cursor protects and what it does not

Canonical: https://caelo.sh/guides/is-my-cursor-app-secure
Published: 2026-11-27 · Updated: 2026-11-27 · Arthi Arumugam, Caelo by Irth Labs

**Short answer:** Cursor is an editor, so it does not secure the app it helps you write: the code ships with the access rules you asked for, and often without the ones you did not. Cursor's guardrails, such as command approvals and `.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

1. 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).
2. Keys in `.cursor/mcp.json`. Project MCP servers are configured in `.cursor/mcp.json` inside your repo. If it holds a token, replace the value with `${env:NAME}` so Cursor reads it from your environment, then check `git log -p --all -- .cursor/mcp.json` for keys committed earlier. See our MCP config guide.
3. Browser-exposed variables. Search for `NEXT_PUBLIC_` (Next.js) and `VITE_` (Vite). Both frameworks copy these values into the JavaScript sent to every visitor, so none of them may hold a secret.
4. 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.
5. `.env` files. Run `git ls-files | grep -i "\.env"`. Only an `.env.example` with placeholder values should appear, and `.gitignore` should list `.env*` followed by `!.env.example` (without the second line, git ignores the example file too). Cursor keeps `.env` files out of AI context by default, but that does not stop git from committing them.
6. 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, `.cursorignore` blocks the agent's file tools only: terminal commands and MCP tools can still read ignored files.
7. 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": true` in your user `settings.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.

## Check your own app

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. Follow the fix in the report and rerun Caelo. For an untracked, unignored file containing secrets, preview the US$19 quick fix. https://caelo.sh/fix
3. For an engineer's assessment, book the US$490 App Health Check. Irth Labs delivers a report and fixed repair quote, with credit toward the repair. https://www.irthlabs.com/start?service=app-health-check

## 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.

## Sources

- [Cursor docs: Agent security.](https://cursor.com/docs/agent/security)
- [Cursor docs: Run Modes.](https://cursor.com/docs/agent/security/run-modes)
- [Cursor help: Ignore files.](https://cursor.com/help/customization/ignore-files)
- [Cursor docs: Model Context Protocol (MCP).](https://cursor.com/docs/mcp)
- [Cursor docs: Security Review.](https://cursor.com/docs/security-review)
- [Next.js docs: Environment variables (bundling for the browser).](https://nextjs.org/docs/app/guides/environment-variables)
- [Vite docs: Env variables and modes.](https://vite.dev/guide/env-and-mode)

## Related guides

- [Is there a security scanner MCP server for Cursor or Claude Code?](https://caelo.sh/guides/security-scanner-mcp-server-cursor-claude-code)
- [API keys in mcp.json: are your MCP config files leaking secrets to git?](https://caelo.sh/guides/api-keys-in-mcp-json)
- [Is my Windsurf app secure? Checks for apps built in Windsurf (now Devin Desktop)](https://caelo.sh/guides/is-my-windsurf-app-secure)
- [I leaked an API key or the Supabase service_role key. What do I do now?](https://caelo.sh/guides/leaked-api-key-what-to-do)
- [Security checklist for apps built with Lovable, Bolt, Cursor, Replit or v0](https://caelo.sh/guides/vibe-coded-app-security-checklist)
- [AI app builder security defaults, compared from their own docs (Nov 2026)](https://caelo.sh/guides/ai-app-builder-security-defaults-compared)
- [OpenAI API key exposed in client-side code: how to fix it](https://caelo.sh/guides/openai-api-key-exposed-frontend)
- [Is Access-Control-Allow-Origin: * a security risk in my API?](https://caelo.sh/guides/cors-wildcard-ai-generated-api)
