Fix guides for AI-built apps
Found something with the free check, or worried you might have? Each guide tells you what's at risk, what to fix first, and gives you a prompt to paste into your AI tool.
Your Supabase service_role key is in your frontend. Here's what to do.
The service_role key bypasses Row Level Security. If it's in your browser code, anyone can read or delete your database. How to replace it, step by step, for Lovable, Bolt and Next.js apps.
Is it safe that my Supabase anon key is public?
The Supabase anon and publishable keys are meant to be public, but only Row Level Security stops them from reading your whole database. How to check every table and add a basic policy.
Your Stripe secret key is public. Rotate it before anyone uses it.
A Stripe sk_live or rk_live key in your frontend lets anyone use your Stripe account. How to rotate it without breaking checkout, check for damage in Workbench and payouts, and protect the new key with a restricted key and an access policy.
Your Stripe test key (sk_test) is public. Here's what that means and what to fix.
A Stripe sk_test_ or rk_test_ key in your website's JavaScript can't charge real cards, but it gives full API access to your sandbox and is often a sign that checkout still runs on test keys. How to rotate it, move Stripe calls to a server and switch to live keys safely.
Your OpenAI API key is in your frontend. Anyone can spend your credits.
An OpenAI key in browser JavaScript lets anyone run requests on your bill. How to delete it, move calls to a server, restrict the new key to the endpoints and models your app uses, and turn on a hard spend limit.
Your Anthropic API key is in your frontend. Anyone can use Claude on your bill.
A Claude API key (it starts with sk-ant-api) in browser JavaScript can be copied and used on your account. How to replace it, move Claude calls to a server, drop dangerouslyAllowBrowser, and cap your spending in the Claude Console.
Your OpenRouter key is in your frontend, or your prompts were read. What to do now.
An OpenRouter key (sk-or-v1-) in browser JavaScript lets anyone use any model on your credits. And in November 2026, OpenRouter told customers that prompts sent to MiniMax models may have been read by a third party. How to replace the key, cap what it can spend, move calls to a server, and check what your prompts gave away.
Call OpenAI from a Supabase Edge Function so your API key never reaches the browser
Step by step for Lovable, Bolt and other Supabase apps: store the OpenAI key as an Edge Function secret, write a function that only signed-in users can call, call it with supabase.functions.invoke, fix CORS, and cap what a leak or abuse can cost.
There's an AWS access key in your website's code. Shut it off first, then find out what it did.
An AWS access key ID (it starts with AKIA or ASIA) in browser JavaScript usually ships with its secret access key, and together they act as your AWS identity. How to deactivate the key, check CloudTrail for misuse, revoke temporary sessions, and move S3 uploads and other AWS calls off the browser.
There's a GitHub token in your website's code. Revoke it, then check what it touched.
A GitHub personal access token (ghp_ or github_pat_) or OAuth token (gho_) in browser JavaScript lets anyone act as you on GitHub, up to the token's permissions. How to delete or revoke it, check your security log, and move GitHub API calls to a server.
There's a Slack token in your website's code. Revoke it before someone reads your workspace.
A Slack bot token (xoxb-) or user token (xoxp-) in browser JavaScript lets anyone call the Slack API as your app or as you, up to the token's scopes: read channel messages, post as your bot, list members. How to revoke it with auth.revoke, check your access logs, and move Slack calls to a server.
There's a Twilio API key in your website's code. Delete it before someone runs up your bill.
A Twilio API key (SID starting with SK, plus its secret) in browser JavaScript lets anyone call the Twilio API on your account: send SMS, place calls, read message logs. How to delete the key, check your Messaging, Call and Audit logs, lock down Geo permissions, and move Twilio calls to a server.
There's a private key in your website's code. Shut it off, then find out what it was used for.
A PEM private key (-----BEGIN PRIVATE KEY-----) in browser JavaScript is most often a Google Cloud or Firebase Admin SDK service account key, copied in to read Google Sheets or the database from the page. How to find which key it is, delete it, check the audit logs, and move the code to a server.
Your database password is in your website's code. Change it, end the old sessions, then lock the door.
A database connection string (postgres://, mysql:// or mongodb+srv://) with a password in browser JavaScript lets anyone connect to your database directly, past your app and its login checks. How to reset the password on Supabase, Neon, MongoDB Atlas or your own server, end sessions that are already open, restrict who can connect, and keep the URL on the server.
Your email API key is in your website's code. Delete it before someone sends spam as you.
A SendGrid key (SG.…) or Resend key (re_…) in browser JavaScript lets anyone send email from your verified domain, and a full-access key can also change your email account. How to delete the key, check what was sent, clean up the account and send email from a server instead.
There's a Google API key in your website's code. Here's how to lock it down.
A Google Maps or Google Cloud API key (it starts with AIza) in your JavaScript can be copied and used on your bill, and an unrestricted key may reach the Gemini API. How to restrict it to your website and the APIs you use, split keys, and when to rotate.
Your secret key is in a VITE_ variable. Everyone can read it.
Vite copies every VITE_ variable into the JavaScript it builds, so a secret API key in one is public. Which values are fine there, how to move secrets to a server function, and why you still need to rotate the key.
Your secret key is in a NEXT_PUBLIC_ variable. Everyone can read it.
Next.js copies every NEXT_PUBLIC_ variable into the JavaScript it sends to the browser, so a secret API key in one is public. Which values are fine there, how to move secrets into Server Components, Route Handlers or Server Actions, and why you still need to rotate the key.
Your .env file can be downloaded from your website.
If yoursite.com/.env loads, every secret in it is public. What to rotate first, how the file ends up in your deploy (public/ and dist/), how to check git history, and how to block dotfiles at the host so it can't happen again.
Your Claude Code settings file can leak the tokens in commands you approved.
Every "Yes, and don't ask again" in Claude Code is saved to .claude/settings.local.json with the full command, including any token or password in it. How to check if yours is public on your website, in git or in an npm package, and what to rotate.
Your MCP config file may be holding API keys in plain text. Here's how to check and fix it.
MCP config files for Claude Code (.mcp.json) and Cursor (.cursor/mcp.json) list the servers your coding agent connects to, often with API keys pasted into env or headers. .mcp.json is made to be committed. How to check your live site and git history, what to rotate, and how to reference keys from environment variables instead.
Is your Next.js app still running a version with React2Shell? How to check in one minute.
React2Shell (CVE-2025-66478) lets anyone run code on the server of an unpatched Next.js App Router app. How to see which Next.js version your live site runs, which versions are affected by it and by the December 2025 follow-up flaws, and what to upgrade to.
A trusted script became a card skimmer at 178 organizations. How to check your site.
On November 16, 2026, an attacker added code to Optimizely Web projects, and sites like Zoom, GitLab and the BBC served a card skimmer and crypto wallet swapper from Optimizely's own CDN. What happened, how to check an Optimizely project, and how to limit what any outside script on your site can do.
Your app's secret link isn't a lock. What the Grok Build leak shows, and how to check yours.
In November 2026, researchers opened 35,578 Grok Build apps without signing in because their unguessable share links ended up in public DNS databases. Why an unlisted address isn't access control, how to see where yours has leaked, and how to lock an app properly.
Is your Lovable app one of the 24,664 that showed data to strangers? How to check.
In November 2026, researchers reported that 24,664 Lovable-built apps on Supabase returned database records without a login. How to test your own app in 10 minutes, close the gap, and what to do if data was readable.
Is Row Level Security turned off on your Supabase tables? How to check and fix it.
A Supabase table without Row Level Security can be read and changed by anyone holding your public key. How to find unprotected tables, turn RLS on, set grants and write policies.
Supabase stopped exposing new tables automatically on October 30. What to check, and how not to undo it.
Since October 30, 2026, new tables in public on existing Supabase projects need an explicit grant before your app can reach them. Tables you already have don't change, so open ones stay open. What to check now and how to fix the 42501 error safely.
Supabase says "permission denied for table" (42501). Here's the fix that doesn't open your data to everyone.
Since October 30, 2026, new tables on existing Supabase projects return error 42501 until you grant access. Write the minimal grants, RLS and policies for your table with the generator, and tell it apart from "new row violates row-level security policy".
Your Firestore database is still in test mode. Here's how to lock it down.
Firestore test mode lets anyone read and overwrite your data. How to spot open rules, including ones with an expiry date, and replace them with owner-only rules you can test.
Your source maps are public. Anyone can read your original code.
Public .map files let anyone rebuild your app's readable source code, comments and file names. How to turn off production source maps in Vite and Next.js, or keep them private for error tracking.
Your .git folder can be downloaded from your website.
If yoursite.com/.git/HEAD loads, anyone can rebuild your source code and every secret ever committed, plus any token saved in .git/config. What to rotate first, how to stop deploying .git, how to block dotfiles, and when rewriting history is worth it.
How to add security headers to a site on Vercel
Vercel already forces HTTPS and sends HSTS, but Content-Security-Policy, X-Frame-Options, X-Content-Type-Options and Referrer-Policy are up to you. Copy-paste config for vercel.json (Vite, React, static sites) and next.config.js (Next.js and v0 apps), and how to switch the CSP on without breaking the site.
How to add security headers to a site on Netlify
Copy-paste _headers and netlify.toml config for Content-Security-Policy, X-Frame-Options, X-Content-Type-Options, Referrer-Policy and HSTS on Netlify, where the file has to go for Vite, React and other builds, why pages rendered by functions or Next.js don't get them, and how to switch the CSP on without breaking the site.
How to add a Content Security Policy to a React + Vite app
A copy-paste starting Content-Security-Policy for a React single-page app built with Vite (the setup Lovable and Bolt generate), what each line is for, the sources Supabase and Stripe need, why Vite needs data: for images and fonts, how to test it with vite preview, and how to switch it from report-only to enforcing without breaking the app.
How to add an HSTS header (and which max-age to use)
What the Strict-Transport-Security header does, which max-age to pick and how to roll it out safely, when includeSubDomains and preload are safe to add, copy-paste config for Vercel, Netlify, Cloudflare, nginx, Apache and Express, and how to undo it.
"Page can be embedded by other sites": how to fix it
What clickjacking is, X-Frame-Options vs CSP frame-ancestors and which value to use, why neither works in a meta tag, copy-paste config for Netlify, Cloudflare, Vercel, nginx, Apache and Express, and how to allow the few sites that should frame you.
"Missing X-Content-Type-Options header": how to fix it
What X-Content-Type-Options: nosniff does, why security scanners and pen testers flag it, copy-paste config for Netlify, Cloudflare, Vercel, nginx, Apache and Express, and the one thing that can break when you turn it on (files served with the wrong Content-Type).
A security checklist for apps built with AI.
Seven checks to run before you launch an app built with Lovable, Bolt, v0, Replit, Cursor or Claude Code: secret keys, database rules, .env and .git files, source maps and security headers.
Free checks
Not sure what to fix yet? Start with a check: