Is my v0 app secure? A pre-launch security checklist for v0 apps
Last updated · By Ember, SniffPup
Short answer: not automatically, but v0 starts you off with better guardrails than most. It checks generated code for security problems, warns about secrets in NEXT_PUBLIC_ variables and can move risky code to the server. Those checks look at your code. Once your app is live, every visitor can also read what it sends to the browser, so check that from the outside too.
v0 app security check in 3 steps
- Keep secrets server-side. No secret key in a
NEXT_PUBLIC_variable or in your code (details). - Test signed out. Open your API routes and data in a private window and make sure strangers get nothing private back (how).
- Scan what the public sees. Run a free SniffPup scan on your live URL (your
vercel.appaddress or custom domain). On your phone it's the Scan tab.
SniffPup looks at your site the way a stranger would: secret keys in your HTML and same-origin JavaScript (masked in the report), public /.env and /.git files, a downloadable source map, missing security headers, cookie flags and HTTPS. It gives your site a 0–100 score. A 100 means no issues were found in our checks; it is never proof of security. Every critical issue comes with its full fix and a fix prompt you can paste into v0, free (with no critical, one other fix is free). It's passive: no logins, no attack traffic, and it never uses a secret key it finds. Signed in, your reports stay in the My scans tab so you can re-check after each publish. Then work through the steps below for the things no outside scan can see.
1. Know what v0 already checks
v0 is open about its guardrails, and they're worth knowing (v0 security docs, Vercel blog):
- While it generates: generated code gets a security analysis, and v0 watches for secrets in client code, misused
NEXT_PUBLIC_variables, tokens written to logs, prompt injection from unsanitized input and unsafe defaults for auth, routing and database access. - Before deploy: Vercel says security issues are flagged and need review before the deploy goes out. Per the same post, the most common issues it catches are exposed API keys,
NEXT_PUBLIC_misuse and unauthenticated API routes. - On the server: environment variables are encrypted and stored on Vercel, and server code runs as isolated Functions.
Read every warning before you click past it. A warning you accept still ships, and v0 can only check code it sees: keys you paste in later or settings you change in the Vercel dashboard are on you.
2. Keep secrets out of NEXT_PUBLIC_ variables
- v0 apps are Next.js apps. Any environment variable whose name starts with
NEXT_PUBLIC_is copied into the JavaScript every visitor downloads, at build time. That's by design, so only public values belong there: a Supabase anon key, a Stripe publishable key, an analytics ID. - Secret keys (OpenAI, Stripe
sk_, a Supabaseservice_roleorsb_secret_key, database URLs) need a name without the prefix, and should only be read in Route Handlers, Server Actions or Server Components. Add them under Project menu → Settings → Environment Variables. - Use different keys for development and production, as v0's own best practices suggest, so a key used in a preview never unlocks your live data.
Paste this into v0:
List every environment variable this project reads. For each NEXT_PUBLIC_ variable, tell me if its value is safe for anyone to see. Move every secret key, token or database URL to a variable without the NEXT_PUBLIC_ prefix, read it only in server code (Route Handlers or Server Actions), and make sure the browser never receives it. List what you changed.
If a secret key has already been in a NEXT_PUBLIC_ variable, a public repo or the browser, rotate it at the provider. See what to do after leaking an API key.
If your v0 project is connected to a public GitHub repo, the free repo scan in the Sniff & Fix tab checks it for committed keys and .env files and for server-only keys with a public prefix. v0 creates a private repo by default, so this only applies if you made it public.
3. Check who can see your chat
Your v0 chat holds your prompts and your app's code. Per v0's sharing docs, a chat can be Private (or Only people with access on a team), shared with Everyone at your team, open to Anyone with the link, or set to Anyone on the web, which may be indexed by search engines and shown in public galleries. Team chats follow the workspace default unless an Owner changes it. If you ever pasted a real key into a chat, keep that chat private and rotate the key anyway.
4. Lock down your database
v0 can add Supabase, Neon, Upstash or Vercel Blob in a click, and for SQL databases it can create and change tables for you (v0 database docs). That's fast, so check the rules before real users arrive:
- Supabase: your anon key is meant to be public, so Row Level Security has to be on for every table, with policies that tie each row to its owner. See the Supabase RLS checker guide, or paste a policy into the free RLS policy explainer (also in the Sniff & Fix tab).
- Neon or another server-only database: the connection string must never get a
NEXT_PUBLIC_name. Every query should run on the server and check who is asking.
5. Test Server Actions and API routes signed out
Unauthenticated API routes are one of the issues Vercel lists as most common. An outside scanner can't see whether your routes check who is asking, so try it yourself:
- Open DevTools → Network while you use your app signed in, and note the API routes it calls.
- Open those routes in a private window, signed out. You should get an error or nothing private, never other users' data.
- Sign in as a second test user and try to load the first user's records by changing an ID in the URL. It should fail.
Server Actions count too: a function that runs on the server can still be called by anyone who can load the page, so each one should check the signed-in user before it reads or changes data.
6. Pick who can open your deployments
When you first publish, v0 asks you to choose the deployment's visibility and domain (v0 deployment docs). Vercel's Deployment Protection has a Standard Protection scope that protects every deployment except your production domains, and an All Deployments scope that protects production too. If the app is an internal tool or still in testing, keep production protected until it's ready.
7. Check what your live site exposes
- Public
/.envor/.git/configfiles (you should get a 404 or your app's normal page, never file contents) - A public JavaScript source map, which can hand out your original code
- Missing security headers (Content-Security-Policy, Strict-Transport-Security, X-Frame-Options, X-Content-Type-Options, Referrer-Policy)
- Cookies without Secure, HttpOnly or SameSite flags
How to check: add /.env and then /.git/config to the end of your live URL, and look at the response headers in DevTools → Network. A free SniffPup scan checks all of these at once. For headers on their own, try the security headers checker.
Where SniffPup fits
v0's checks see your code as it's written, which an outside scanner can't. SniffPup sees what your live site actually serves to the public, which is what a stranger sees first. See exactly what the scanner does.
What v0's checks see vs. what an outside scan sees
| Check | v0 and Vercel | Outside scan (like SniffPup) |
|---|---|---|
| Secrets in generated code and NEXT_PUBLIC_ misuse | Yes, while it generates and before deploy | Only what the live site actually sends |
| Your source code | Yes | No |
| Fixes problems for you | Yes, it can move code to the server | No; gives fix prompts to paste into v0 |
| Who can open your deployments | Yes, Deployment Protection settings | No |
| Public /.env, /.git files and source maps on the live URL | Not listed in v0's docs | Yes |
| Security headers, cookie flags and HTTPS on the live URL | Not listed in v0's docs | Yes |
The two work best together: fix what v0 flags, publish, then check what the public sees.
FAQ
How do I check if my v0 app is secure?
Use v0's own guardrails and an outside look. Make sure no secret sits in a NEXT_PUBLIC_ variable, set your chat and production visibility on purpose, turn on Row Level Security if you use Supabase, and open your API routes signed out. Then scan your live URL to see what it sends to every visitor.
Does v0 check my app for security problems?
Yes. Vercel's v0 docs say generated code gets a security analysis, v0 warns about risky NEXT_PUBLIC_ usage and can move code into Route Handlers or Server Actions, and Vercel's blog says v0 flags security issues for review before deploy. Those checks look at your code as it is generated. They don't replace a test of your live site or your database rules.
Are NEXT_PUBLIC_ environment variables safe for API keys?
Only for values that are meant to be public, such as a Supabase anon key, a Stripe publishable key or an analytics ID. Next.js copies every NEXT_PUBLIC_ variable into the JavaScript the browser downloads at build time, so anyone can read it. Secret keys, database URLs and service_role keys need a name without that prefix and should only be read in server code.
Can other people see my v0 chat and code?
It depends on the chat's visibility. Per v0's sharing docs, a chat can be Private, shared with your team, shared with anyone who has the link, or set to Anyone on the web, which may be indexed by search engines and shown in public galleries. Keep chats with real keys or private business logic private.
Can SniffPup scan my v0 app?
Yes, if it is published at a live web URL (a vercel.app address or your own domain) that a visitor can open without signing in. SniffPup checks what that site serves to any visitor: secrets in HTML and JavaScript, public .env and .git files, source maps, security headers, cookies and HTTPS. It can't see your code, your database or anything behind a login.
Does a clean SniffPup report mean my v0 app is secure?
No. SniffPup checks what is publicly visible on your site. A score of 100 means no issues were found in our checks, never proof of security. Pair it with v0's own checks and your own signed-out tests.
A clean report is not a guarantee of security, and a 100 score means no issues were found in our checks, not proof of security. Only scan sites you own.