Security guides for AI-built apps
Short, practical guides to the security mistakes AI coding tools make most.
- Supabase RLS policy generator (free)
Free Supabase Row Level Security policy generator. Pick who should see and change each table and get copy-paste SQL with the right grants for the 30 October 2026 change, plus a prompt for Lovable, Bolt or Cursor. - Is this API key safe in my frontend? Free key checker
Paste an API key or token and see what it is and whether it can go in frontend code: OpenAI, Anthropic, Stripe, Supabase anon vs service_role, Firebase, AWS and more. Runs in your browser; the key is never sent anywhere. - Security scan MCP server for Claude Code, Cursor and other AI agents
Add LeakPatrol to Claude Code, Cursor, VS Code or Windsurf in one line and let your coding agent check your live app for leaked API keys, open Supabase settings and other security mistakes after every deploy. Free, read-only, no API key. - Supabase October 30 grants change: what it fixes for your app's security, and what it doesn't
Since 30 October 2026, new Supabase tables are no longer exposed to the Data API automatically. Existing tables kept their access. What broke, what is still open, and two queries to check your tables now. - Supabase "42501 permission denied for table": the safe fix (not GRANT ALL)
Since 30 October 2026 new Supabase tables have no Data API grants, so Lovable and Bolt apps hit error 42501. The safe grant, the RLS policy to add first, and the fixes AI tools suggest that leave your data open. - Supabase "new row violates row-level security policy": 5 causes and the safe fix
Why Supabase blocks your insert, update, upsert or file upload with "new row violates row-level security policy" in Lovable, Bolt and Cursor apps, how to find which cause it is, and the fixes AI tools suggest that open your data. - Supabase service_role key exposed? What to do in the next hour
Your Supabase service_role or sb_secret_ key ended up in frontend JavaScript, a public GitHub repo or a VITE_ variable. Why it is critical, how to revoke it without breaking your app, and how to check whether anyone used it. - Supabase select returns an empty array but the data is there: the RLS fix
Your Supabase query returns [] (or PGRST116 with .single()) even though the rows exist in the Table Editor. Why Row Level Security causes it, five causes in order, and the safe fix, without disabling RLS. - Supabase "Database error saving new user": find the cause and fix it safely
Sign-up fails with AuthApiError "Database error saving new user" (status 500). Almost always a trigger on auth.users that inserts into a profiles table. How to find the real error in the logs and fix it without opening up your database. - Supabase Storage upload: "new row violates row-level security policy" fixed
Uploading a file to a Supabase Storage bucket fails with "new row violates row-level security policy" or a 403. The storage.objects policies you need, why upsert and the file path matter, and why a public bucket does not allow uploads. - Supabase "infinite recursion detected in policy for relation" fixed
Supabase returns "infinite recursion detected in policy for relation profiles" (error 42P17) when an RLS policy queries its own table. Why it happens, the security definer function fix, and the unsafe fixes to avoid. - Supabase Edge Function "blocked by CORS policy" fixed
Calling a Supabase Edge Function from Lovable, Bolt or a Vite app fails with "has been blocked by CORS policy: Response to preflight request doesn't pass access control check". The OPTIONS handler and headers you need, and why "*" plus no auth check is risky. - Supabase "Forbidden use of secret API key in browser" (401) fixed
Your Supabase request fails with 401 and "Forbidden use of secret API key in browser". Why Supabase blocks sb_secret_ keys in the browser, the safe fix with the publishable key and an Edge Function, and why the key may already be leaked. - Supabase "Legacy API keys are disabled" or "Invalid API key": what it means and the fix
"Legacy API keys are disabled" means your app still sends an old eyJ anon key after legacy keys were switched off. What it means, the five usual causes (wrong project, stale build, old key hardcoded, legacy keys switched off, stray quotes), how to check each in two minutes, and the one fix you should never use. - Supabase login or magic link redirects to localhost:3000 (fixed)
Your live app sends users to localhost:3000 after Supabase sign-up, magic link, password reset or Google login. Why it happens (Site URL and the Redirect URLs allow list), the exact settings to change, and the wildcard you should not add. - Is your Supabase storage bucket public? What anyone can see, and the fix
Lovable, Bolt and Cursor often create public Supabase storage buckets. What "public" really means, how a broad select policy lets anyone list every file, a 2-minute test, and how to move private files (IDs, invoices, uploads) to a private bucket with signed URLs. - Where to put your OpenAI API key in a Lovable app (so nobody can copy it)
A VITE_ variable is not secret: anyone can read it in your JavaScript. How to move your OpenAI key into a Supabase Edge Function secret in Lovable, Bolt or Cursor, check your live site for a leaked sk- key, and what to do if it already leaked. - Supabase "Function Search Path Mutable" warning: what it means and the one-line fix
The Supabase Security Advisor flags "Function Search Path Mutable" on functions without a fixed search_path. What the risk is, how to find every affected function, the one-line fix, and how not to break your triggers. - Supabase "email rate limit exceeded" fixed (and "you can only request this after 60 seconds")
Supabase sign-up, magic link or password reset fails with "email rate limit exceeded" (429, over_email_send_rate_limit). Why the built-in email sender stops, the custom SMTP fix, and the shortcuts that weaken your app. - Lovable data exposure study: is your app one of the 24,664?
Researchers found 24,664 of 159,041 Lovable apps sending database records to anyone, without a login. A 5-minute test to see if your app is one of them, and how to fix it with Row Level Security. - Lovable security check: is your Lovable app safe?
Free security check for Lovable apps. Find leaked API keys, Supabase tables without Row Level Security, and missing protections, with fixes you can paste back into Lovable. - Bolt.new security check: is your Bolt app safe?
Free security check for apps built with Bolt.new. Find API keys in VITE_ variables, Supabase tables without Row Level Security, public .env files and missing headers, with fixes you can paste back into Bolt. - Launch checklist for apps built with Lovable, Bolt and Cursor
Nine things to check before you share your AI-built app: page title, link preview, favicon, phone layout, sitemap, analytics, your own domain and email that lands in the inbox. Free automatic check. - Supabase security check: is your anon key safe? (RLS checker)
Is your Supabase anon key safe in the frontend? Yes, if Row Level Security is on. Check RLS, the service_role key, storage buckets and views, with copy-paste SQL. - How to check if your API key is exposed on your website
Check whether OpenAI, Stripe, AWS or other secret API keys are visible in your website's JavaScript, what each key prefix means, and what to do if one leaked. - Are VITE_ env variables secret? How to hide API keys
VITE_ environment variables are bundled into your frontend JavaScript, so anyone can read them. What is safe to put there, how to hide API keys in a Vite or React app, and how to check what your live site exposes. - Stop users giving themselves your paid plan (Supabase)
If your Supabase profiles table lets users update their own row, they can set is_pro, plan or credits from the browser console. How to test it, and three SQL fixes so only your payment webhook can change billing columns.