Cursor security checklist for the app you ship
Cursor is an editor, so the security of what you ship depends on your framework, your host and the code Cursor helps you write. Check two places, the project and the live site. Atlas, our example app at atlas.example, is the example.
What does Cursor keep out of the AI's context?
Cursor already ignores .env files, .git/ and lock files by default. Cursor also says terminal commands and MCP tools run outside its file access controls, so they may still be able to read ignored files. So a secret in .env is not sent as context by default, but an agent that runs commands can still read it. Approve commands with that in mind.
Which values end up in the shipped code?
That depends on the framework, not on Cursor.
| Framework | Public prefix | Everything else |
|---|---|---|
| Vite | VITE_ | Stays out of the bundle |
| Next.js | NEXT_PUBLIC_ | Stays on the server |
Vite exposes variables prefixed with VITE_ in client-side source code after bundling. Next.js keeps variables without the NEXT_PUBLIC_ prefix out of the browser. A secret with a public prefix is published the moment you deploy.
How to check and fix from Cursor
- Deploy and copy the live address.
- Run a quick check on your published address to see what a stranger sees, then read how we check for what it covers.
- Add Lockpick to Cursor so the agent can read each finding and its fix prompt.
- Ask it to fix one finding on a new branch, review the diff, then deploy and check again.
An outside check sees the deployed site, not your repository, so it will not find a secret that never left your machine. It finds the ones that did.
Questions people ask
Does Cursor send my .env file to the AI?
Not by default. Cursor ignores .env files for AI context, but terminal commands and tools the agent runs may still read them.
Can Cursor fix what a Lockpick check finds?
Yes. Add Lockpick to Cursor and ask it to fix one finding at a time on a new branch, then review the change before you deploy.
See what your site shows from outside
A quick check reads your homepage the way a visitor would and gives you a score. No account needed.
Check your siteSources
- Env Variables and Modes Vite docs, read on October 6, 2026
- How to use environment variables in Next.js Next.js docs, read on October 6, 2026
- Ignore files Cursor help, read on October 6, 2026