CapLeak / Guides

Is my Lovable app secure?

Get a free outside-in score of what a stranger's browser can see in your published Lovable app. Then work through the six checks below.

Scan your app freeFree score in seconds. No password, no card.

Short answer: it can be, but "it works" and "it's secure" are different tests. A Lovable app runs in your visitor's browser and often talks straight to Supabase, so security depends on six things you can check today: no secret keys in the frontend, Row Level Security on every table, private storage buckets, sensible login settings, no downloadable .env or .git files, and basic security headers. Most problems take minutes to fix once you know they're there.

What "secure" means for a Lovable app

Everything Lovable builds for the browser (HTML, JavaScript, and any key it uses) is public the moment you publish. That's normal. The question is whether anything in that public code, or reachable with it, lets a stranger do more than a normal visitor should. This page is the wider checklist. If you already found a Supabase secret key in your app, go straight to Exposed Supabase service_role key: what to do.

The 6-point check

1. No secret keys in the browser

Open your published app (not the editor preview), open DevTools, and search all sources (Ctrl+Shift+F / Cmd+Option+F) for sk-, sk_live_, sb_secret_, service_role and AKIA. Any hit is a secret that belongs on a server. Calls to OpenAI, Stripe or email providers should go through a Supabase Edge Function or another server, never from the page itself.

2. Row Level Security on every table

In your Supabase dashboard, run the Security Advisor and fix every table it reports with Row Level Security (RLS) disabled: those tables are readable with the public key your app ships. Also read each policy: using (true) on a table with user data means anyone can read it. Our Supabase RLS checker guide walks through this step by step.

3. Storage buckets that match their content

In Supabase Storage, check which buckets are public. Public is fine for logos and product images. It's wrong for invoices, ID photos or user uploads, because anyone with a file's URL can open it. Make those buckets private and serve files with signed URLs.

4. Login settings

In your Supabase authentication settings, decide whether strangers should be able to sign up at all. If your app is just for you or a small team, turn off open sign-ups. If it's public, keep email confirmation on, and remember that "signed in" is not the same as "allowed": an authenticated policy without an auth.uid() check lets every user read every other user's rows.

5. No downloadable env or git files

Visit /.env, /.env.local and /.git/config on your live domain. Getting your homepage back is fine. Seeing KEY=value lines or a git config is not. See Did my .env leak? for what to do. Check for leftover backups too (backup.zip, db.sql, .DS_Store), and for public API docs (/openapi.json, /swagger.json, /docs) that list every endpoint your server has.

6. HTTPS and security headers

Your app should redirect to HTTPS and send headers such as HSTS, a Content-Security-Policy, clickjacking protection and X-Content-Type-Options: nosniff. These don't fix a leaky database, but they limit damage from other bugs. If you use a custom domain, check the headers on that domain too.

What to fix first

If you foundDo thisUrgency
A secret key in the browserRotate it at the provider, then move the call to an Edge FunctionToday
A table with RLS off or true policiesEnable RLS and add auth.uid() policiesToday
Private files in a public bucketMake the bucket private, use signed URLsToday
Downloadable .env or .gitRotate every secret in it, block the pathToday
Open sign-ups you don't needTurn them off in your authentication settingsThis week
Missing headersAdd them at your host or custom domainThis week

A prompt you can paste into Lovable to start the cleanup:

Do a security pass on this app. 1) Make sure no secret API keys (OpenAI, Stripe secret, Supabase service_role or sb_secret_) are in frontend code; move any call that needs one into a Supabase Edge Function that checks the user is signed in. 2) Enable Row Level Security on every table and replace any policy using "true" on user data with policies that match auth.uid(). 3) List every storage bucket and tell me which are public. Show me each change before applying it.

Review what it changes. AI builders sometimes "fix" a broken page by loosening a policy again, so re-run the checks after each round of edits.

Where CapLeak fits

CapLeak checks your live app from the outside, the way a stranger's browser sees it. The free score reads your homepage and the JavaScript files it loads, and gives a score, a grade, problem counts by severity and a result for each check: secret keys in public code, database (Supabase) access, hidden files (.env, .git, source maps), HTTPS, browser safety headers, Google basics, robots.txt and sitemap.xml, and broken links. That covers checks 1, 2, 5 and 6 from the outside. For the database, CapLeak uses only the public key your app already ships and asks Supabase for a row count, so no row is ever downloaded. For hidden files, the free check only asks whether the file is served, without downloading it.

The $12 full report (one time, per app) shows where each issue is, with a plain-English fix and a copy-paste prompt for Lovable, Bolt or Cursor, right after checkout. The deep part (database tables, hidden files like .env and .git, and source maps) is added after a quick ownership check, which takes about a minute. Storage buckets and login settings live in your Supabase dashboard, so check those (points 3 and 4) yourself. To keep an app watched every week, Watch is $15 a month per app and Unlimited is $39 a month for up to 25 apps, with no report needed first.

CapLeak runs passive checks only. A passing grade means none of its checks failed; it is not a guarantee of security.

FAQ

Lovable security, answered.

Does Lovable make my app secure automatically?

Lovable generates working code quickly, but you still own the configuration. Check Row Level Security, storage buckets, login settings and keys yourself before you share the app widely.

Is my Supabase anon key in the app a problem?

Not by itself. The anon or publishable key is meant to be public. It is only safe when Row Level Security is on for every table and policies are narrow. A service_role or sb_secret_ key in the frontend is a real leak.

Can someone see my Lovable app's code?

Yes, the frontend code. Everything that runs in the browser can be read by any visitor with DevTools. Keep secrets and privileged logic in Supabase Edge Functions or a server.

What does CapLeak's free score check on a Lovable app?

Secret keys in your homepage and the JavaScript it loads, database (Supabase) access using only your public key and a row count, whether hidden files like .env and .git are served, HTTPS, browser safety headers, Google basics, robots.txt and sitemap.xml, and broken links. You get a score, a grade and problem counts. The $12 full report shows where each issue is and how to fix it.

If I pass, is my app secure?

A passing grade means none of CapLeak's passive checks failed. It is not a guarantee of security; a passive scan can't see server code or database policies that aren't exposed.

Know your score before you share the link.

Free score in seconds. No password, no card.

Get my free score