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 found | Do this | Urgency |
|---|---|---|
| A secret key in the browser | Rotate it at the provider, then move the call to an Edge Function | Today |
A table with RLS off or true policies | Enable RLS and add auth.uid() policies | Today |
| Private files in a public bucket | Make the bucket private, use signed URLs | Today |
Downloadable .env or .git | Rotate every secret in it, block the path | Today |
| Open sign-ups you don't need | Turn them off in your authentication settings | This week |
| Missing headers | Add them at your host or custom domain | This 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.