Guide · Cursor · Updated
Is My Cursor App Secure? How to Check Your Live Cursor App Before You Launch
Cursor's Agent can build a whole web app with you. Many Cursor apps are Next.js or Vite, use Supabase or Firebase, and go live on Vercel or Netlify. Cursor protects your code inside the editor. It does not check what your live site gives away. Here is what Cursor's own docs say, and how to check your live app yourself for free.
1. The short answer
A Cursor app is only as safe as what its live URL gives away. The big risks are:
- Secret keys in a
NEXT_PUBLIC_orVITE_variable, or hard-coded in browser code. - Supabase tables without Row Level Security, or Firebase rules that let anyone read.
- API routes or Server Actions with no login check inside them.
- Preview URLs that are public when you thought only you could open them.
Cursor's settings like .cursorignore and Privacy Mode are about the editor. They do not change your live site. So check the live app from the outside, because that is what a stranger sees.
2. What Cursor protects (and what it does not)
A few facts from Cursor's own docs:
.cursorignoreblocks Agent, Tab, Inline Edit and @ mentions from reading the files you list. Cursor says the terminal and MCP tools used by Agent cannot block those files, and that complete protection is not guaranteed.- Agent guardrails: by default, terminal commands need your approval. Agent can edit files in your project without approval (except config files), and changes save right away. Cursor says to always use version control so you can undo.
- Privacy Mode: when it is on, Cursor says it will not train on your data. It is available to anyone, free or Pro.
- Bugbot reviews pull requests for bugs and security issues. It looks at code changes, not your live URL.
All of these help while you build. None of them look at the site your visitors load.
Sources: Cursor: Ignore file · Cursor: Agent security · Cursor: Security · Cursor: Bugbot
3. 5-minute check on your live Cursor app
Do this on the live URL people will use, not localhost.
Step 1: Search the live JavaScript for secrets
Open your live app → DevTools → Network → reload → open the JS files the page loads. Search for patterns like sk-, sk_live, sk_test, service_role, sb_secret_, AKIA and postgresql://. If a real secret shows up, move that call to the server and make a new key at the provider. Our exposed API key guide has a table of which key types are secret.
Step 2: Look at your public env var names
Open your .env file and your host's environment settings. Any name that starts with NEXT_PUBLIC_ or VITE_ goes into the browser. Read each one. Is it safe for the whole internet to see? If not, rename it and use it only on the server.
Step 3: Test your data while logged out
If your app uses Supabase from the browser, try to read each table with only the public key. Our Supabase RLS check shows how, step by step. If you use Firebase, open your Security Rules and make sure no rule says anyone can read or write everything. Our Firebase Security Rules check shows how.
Step 4: Try /.env in a private window
Visit yourapp.com/.env and yourapp.com/.git/config. You should get a not-found page or your normal app. Never a list of keys.
Step 5: Open a preview URL while logged out
If your host makes preview deploys (a separate URL for a branch or pull request), open one in a private window. If it loads with real data, it is public.
Step 6: Check title, description and a few links
View page source. If the title still says "Create Next App" or "Vite + React", fix it before you share. Click the main nav and footer links on the live site.
4. NEXT_PUBLIC_ and VITE_: what ends up in the browser
This is the most common way a key leaks from a Cursor-built app. The rules come from the frameworks, not from Cursor:
- Next.js: variables without
NEXT_PUBLIC_stay on the server. With the prefix, Next.js inlines the value into the JavaScript sent to the browser at build time. - Vite: variables that start with
VITE_are exposed to client code. Vite's docs sayVITE_*variables should not hold API keys, and that a backend or serverless function should keep secrets. - Because the value is baked in at build time, deleting the variable later does not un-leak it. Make a new key.
Public values are fine here: your site name, an analytics id, the Supabase URL and its publishable key. OpenAI keys, Stripe sk_ keys and database passwords are not.
Sources: Next.js: Environment variables · Vite: Env variables and modes
5. .cursorignore and your .env file
People often think .cursorignore hides their keys. It does something smaller:
- Cursor already skips files in your
.gitignoreand a default list that includes.env*. - You can add your own patterns in
.cursorignore(same syntax as.gitignore), or set a global ignore list in settings. The global list is empty by default. Cursor suggests patterns like**/.env,**/credentials.jsonand**/*.pem. - Ignored files are kept from Agent, Tab, Inline Edit and @ mentions. The terminal and MCP tools used by Agent are not blocked.
So .cursorignore keeps a key away from the AI. It does not keep a key out of your build. If your code reads a secret into browser code, the key ships to every visitor, ignored or not.
Source: Cursor: Ignore file
6. Supabase or Firebase from the browser
Both are built so one key can sit in your frontend. The rules on your data are what keep it safe.
- Supabase: the publishable key (
sb_publishable_, or the older anon key) is safe to show. It only reaches what Row Level Security allows. The secret key (sb_secret_, or the olderservice_rolekey) bypasses RLS. Keep it on the server only. - Firebase: Firebase says API keys for Firebase services are public by design. Your Firestore, Realtime Database and Storage data is protected by Firebase Security Rules, not by hiding that key. Use a separate, restricted key for other Google APIs.
For a free logged-out test of each Supabase table, see the Supabase RLS check guide. For Firestore and Realtime Database, see the Firebase Security Rules check.
Sources: Supabase: API keys · Firebase: API keys
7. API routes and Server Actions need their own login check
Moving a key to the server is step one. Step two is making sure strangers can't just call your server code.
- Next.js docs say a Server Action can be reached with a direct POST request, not just through your app's buttons.
- A login check on the page does not protect the Server Actions on that page. Check who the user is inside each action.
- Also check that the user owns the thing they are changing. Otherwise one user can edit another user's data.
The same goes for app/api routes and Netlify or Vercel functions. Each one needs its own check.
Source: Next.js: Data security
8. Preview URLs and security headers
Vercel says deployments that are not locked down and have no custom domain (like your-project.vercel.app) are public and can show up in Google. Vercel Deployment Protection (Vercel Authentication or a password) can limit who opens them. Check your project's Deployment Protection settings. On another host, open a preview link in a private window to see if it is public.
Security headers, a real title and working links do not stop a leaked key. But they catch easy launch mistakes, and they are quick to fix with the prompts below.
Source: Vercel: Locking down deployments
9. Copy-paste fix prompts for Cursor
Paste one into Cursor's Agent chat. Review the changes, then deploy and repeat the live check. A project rule (in .cursor/rules) keeps these habits in every Agent chat.
Find every secret API key in this project, like OpenAI, Anthropic, Stripe secret keys (sk_ or rk_), Supabase secret or service_role keys, and any database password or connection string. Move every call that uses one into server-side code (an API route, Route Handler, Server Action or serverless function). Store each key in an environment variable that does NOT start with NEXT_PUBLIC_ or VITE_. Remove any NEXT_PUBLIC_ or VITE_ variable that holds a secret. Do not hard-code keys. Then list every key you moved so I can make a new one at the provider.
Review every Supabase table this app uses. Turn on Row Level Security for each one. Add policies so a signed-in user can only read and change their own rows (auth.uid() matches the user id column). Public content like blog posts can stay readable. Contact forms, waitlists and user data must not be readable by anyone who is not signed in. Write the SQL as a migration and show me every policy.
Review my Firestore, Realtime Database and Storage security rules. Remove any rule that lets anyone read or write everything (like allow read, write: if true). Make each user able to read and change only their own documents and files. Keep truly public data readable. Show me the old and new rules side by side.
List every API route, Route Handler, Server Action and serverless function in this project. For each one that reads or changes private data, add a login check inside the handler itself, not only on the page. Also check that the signed-in user owns the row or file they are changing. Reject requests that fail with a 401 or 403. Show me what you changed.
Create a project rule at .cursor/rules/security.mdc with alwaysApply: true. The rule should say: never put secret keys in client code or in NEXT_PUBLIC_ or VITE_ variables; call paid APIs only from server code; every API route and Server Action must check who the user is and that they own the data; every new Supabase table needs RLS and policies. Keep it short.
Add security headers for my app: Content-Security-Policy with frame-ancestors none, X-Frame-Options DENY, X-Content-Type-Options nosniff, Referrer-Policy strict-origin-when-cross-origin, and Strict-Transport-Security. Use next.config for Next.js, or vercel.json or netlify.toml headers if that is how I deploy. Keep the CSP compatible with my app. Show the change.
Set a clear page title and meta description on my home page (not the framework default like "Create Next App" or "Vite + React"). Add an Open Graph title and description. Check every link in the home page nav and footer, and fix or remove any that are broken. List every change.
Source: Cursor: Rules
10. Check it for me
Don't want to do this by hand after every deploy? VibeCheck checks your live app from the outside, the way a stranger would. It searches the JavaScript your homepage loads for secret keys. If your app talks to Supabase from the browser, it checks common table names to see if they are open. It also checks security headers, Google basics like your title and sitemap, and broken links.
It works with any public link: your vercel.app or netlify.app address, your own domain, or another public URL. It only looks. It never logs in, fills in forms or tries to break in. It does not see your code. If it finds an open table, it notes the table name and never stores the rows.
It is a good partner to Cursor's own tools: Cursor helps while you write the code, and VibeCheck looks at the live site after you ship.
Pricing: the problems list is free (just add your email). A fix report with a copy-paste prompt for every problem is $9. Or get 10 fix reports for $29. No subscription.
No tool can promise your app is safe. VibeCheck catches common, costly mistakes so you can fix them first.
11. FAQ
Is my Cursor app secure?
It can be, but you have to check the live app. Cursor is an editor. It helps you write the code, but it does not decide what your live site shows. The common problems are secret keys in NEXT_PUBLIC_ or VITE_ variables (which go to the browser), Supabase or Firebase data that anyone can read, API routes or Server Actions with no login check, and preview URLs that are public when you thought they were private.
Does .cursorignore keep my API keys safe?
It keeps them away from Cursor, not away from your visitors. Cursor's docs say .cursorignore blocks Agent, Tab, Inline Edit and @ mentions from reading the files you list. The terminal and MCP tools that Agent uses cannot block those files, and Cursor says complete protection is not guaranteed. .cursorignore does nothing for your live app. If a key is in your browser code, anyone can still see it.
Does Cursor read my .env file?
By default, no. Cursor's docs list .env* in the default ignore list, and Cursor also skips files in your .gitignore. You can add more patterns, like **/.env and **/*.pem, to the global ignore list in settings. That list is empty by default. Remember that the terminal and MCP tools used by Agent are not blocked by ignore files.
Does Privacy Mode make my app more secure?
No. Privacy Mode is about your code and prompts inside Cursor. Cursor says that when it is on, it will not train on your data, and it is available on free and Pro plans. It does not change anything on your live website. A secret key in your public JavaScript is just as public with Privacy Mode on.
What do NEXT_PUBLIC_ and VITE_ mean?
They tell your framework to put a value into the JavaScript that every visitor downloads. Next.js inlines NEXT_PUBLIC_ variables into the browser bundle at build time. Vite exposes VITE_ variables to client code, and its docs say they should not hold API keys. Use these prefixes only for public values. Keep secret keys in names without the prefix, used only on the server.
Cursor's Bugbot reviewed my code. Do I still need to check?
Yes. Bugbot reviews pull requests, so it looks at code changes. It does not visit your live URL. Strangers only see what is deployed. After every deploy, check the live site for secret keys, open tables, missing headers and broken links.
More questions? See the VibeCheck FAQ. Also useful: Is my API key exposed? · Supabase RLS check · Is my v0 app secure? · Is my Lovable app safe?. Before you launch, run the vibe coding security checklist (12 checks for any AI-built app).