Is my Lovable app secure? A 15-minute check before you launch
How to check a Lovable + Supabase app for leaked API keys, open tables and missing security headers, with copy-paste fixes and a free read-only scan.
Lovable is great at getting an app live fast, but once it's live, anyone can see the code that runs in the browser. This guide covers the four things to check before real users show up. Every step is free.
Short answer: Lovable has built-in Quick and Deep security scans, and you should run them. Lovable's own docs say they "cannot guarantee complete security" (Lovable docs). So check your live site from the outside too, the way an attacker would.
Why this matters
In 2025, Matt Palmer scanned 1,645 Lovable projects and found 170 (about 10.3%) with inadequate Row Level Security, which exposed data to unauthenticated requests. This became CVE-2025-48757 (statement). Lovable has added more protections since then, but your app still needs RLS rules that match how it actually works.
1. Run Lovable's built-in scans
Open your project's Security view. The Quick scan runs on every publish and checks database rules, dependencies and exposed MCP servers. The Deep scan reviews your code for leaked secrets, access control problems and unauthenticated endpoints (docs). Fix anything marked Critical first.
2. Make sure no secret keys are in your frontend
Anything prefixed VITE_ is built into the browser bundle and is public (Lovable Secrets docs).
- Fine to be public:
VITE_SUPABASE_URL, the Supabase publishable/anon key. - Never public: OpenAI/Anthropic keys, Stripe secret keys (
sk_live_), Resend keys, Supabaseservice_role/sb_secret_keys. Supabase's docs say secret keys bypass Row Level Security (Supabase API keys).
How to check: open your live site, go to DevTools → Sources (or Network → JS files), and search for sk-, sk_live_, service_role, sb_secret_, re_.
If you find one: (1) rotate the key in the provider's dashboard first, (2) store the new key in Lovable Secrets, (3) call the API from an Edge Function that checks who the user is.
Prompt to paste into Lovable:
Move every third-party API call that uses a secret key into a Supabase Edge Function. Read the key from Secrets, verify the caller's JWT with supabase.auth.getUser(), and make the frontend call the function instead. Remove all secret keys from frontend code and VITE_ variables.
3. Check Row Level Security on every table
Your anon key is in your bundle, and that's expected. That's why RLS is what actually protects your data. In Supabase → Table Editor, any table marked "RLS disabled" is a problem. Policies like using (true) on private data are a problem too.
Test it as a signed-out visitor:
curl "https://YOUR-PROJECT.supabase.co/rest/v1/profiles?select=*&limit=1" \
-H "apikey: YOUR_ANON_KEY"
If you get rows back for data that should be private, fix the policy:
alter table public.profiles enable row level security;
create policy "own rows" on public.profiles
for select using ((select auth.uid()) = user_id);
New in 2026: from 30 October 2026, Supabase stops exposing new public tables to the Data API automatically on existing projects. New tables need explicit GRANTs, and RLS works the same as before (Supabase changelog). If your AI tool hits a 42501 permission denied error, grant only what's needed (usually to authenticated). Don't let it "fix" the error by disabling RLS or granting everything to anon.
4. Add basic security headers
Check that you have Content-Security-Policy, X-Frame-Options (or CSP frame-ancestors), Strict-Transport-Security, X-Content-Type-Options: nosniff and Referrer-Policy. See MDN's HTTP headers reference and the OWASP Secure Headers Project.
5. Make sure no files are exposed
Try /.env, /.git/config, and *.js.map on your live domain. They should return 404 or nothing useful.
Scan it for free in one step
KeyMoat runs outside-in checks on your live URL: common secret-key patterns in your HTML and same-site JS bundles, exposed .env/.git/config and public source maps, missing security headers, and, if it finds your Supabase URL and anon key, whether a sample of up to 8 tables returns rows anonymously (it counts rows only and never downloads data). It's read-only and needs only your URL. Only scan apps you own.
Want it re-checked every week after each Lovable change? Monitoring (from $5/mo) monitors one app and emails you when something new shows up, with a fix prompt you can paste.
An outside scan can't prove your app is secure. It can't see logic bugs or what signed-in users can access of each other's data. For apps that handle sensitive data, get a professional review.
Run a free, read-only scan of your live app
Paste your URL. Checks leaked keys, exposed files, security headers and anonymous Supabase access. Only scan sites you own.
Scan my site free →