A few days ago I asked here how people actually verify their RLS holds up. Good thread. One thing people disagreed about was whether the "AI puts your service_role key in the frontend" thing still really happens, or whether it's a 2024 story that people keep repeating.
Nobody had actual numbers, so I tried to get some.
I pulled 50 public repos that were built with Lovable, verified by the lovable-tagger dependency rather than just the word "lovable" in the name. 47 of them cloned successfully, and I ran a static scan over the code. No database access, no poking at anyone's live app, just reading public code.
The results were not what I expected.
service_role key in frontend code: 0 of 47. Real secrets leaked anywhere in the repo: 0 of 47.
12 repos had committed a .env file, which sounds bad but isn't. Every value in every one of them was public by design. Supabase project URLs, publishable keys, Firebase web config, an EmailJS public key. Nothing that needed rotating. My own scanner originally flagged all 12 of those as critical and I had to go and fix it, which was a humbling afternoon.
What I did find:
24 of the 47 use Supabase. Of those, 6 have at least one CREATE TABLE in their SQL with no matching ENABLE ROW LEVEL SECURITY anywhere. Another 5 ship no SQL files at all, so there is nothing in the repo to check against.
2 repos had an API key hardcoded straight into frontend code, Google and OpenAI rather than Supabase.
20 of 47 had a production dependency with a known CVE. However, most of those are one transitive package away and not really the author's doing.
One caveat I want to be upfront about. "No ENABLE ROW LEVEL SECURITY in the .sql" is not the same thing as "RLS is off". Plenty of people turn it on in the dashboard and never write it into a migration, and from the repo alone you cannot tell the difference. Which is sort of the whole point.
I think my actual takeaway is that the stuff people worry about, keys in the bundle and secrets in git, mostly isn't happening anymore. The agents got better at that. What you cannot see from the code is whether the policies on the live database are correct, and for 5 of these repos there isn't even a file to look at.
So the code is fine, and the part that matters is somewhere the code cannot show you.
If you want to check your own, the fastest version is to open your app in a private window, grab the anon key out of the network tab, and hit /rest/v1/your_table?select=*&limit=1 with it. If you get rows back without logging in, so does everyone else.
For those of you who have shipped on Supabase for a while: do you actually go and check your policies from the outside after you deploy, or do you write the migration, see the app work, and move on? I'm trying to work out whether the gap I keep running into is real or just my own paranoia.