If your app was built with Lovable, Bolt or Cursor and stores data in Supabase, there is a good chance anyone on the internet can read some of it. Not because someone hacked you, but because the database was never told who is allowed to see what.
That instruction is called row level security, or RLS. AI coding tools set up Supabase quickly and the app works in every test you run as yourself. The gap only shows up when someone else looks.
This post covers the RLS mistakes we see most often in AI-built apps, and a way to test your own project in about ten minutes without being a developer.
Why your Supabase key being public is normal (and why that matters)
Open your deployed app, view the page source or the network tab, and you will find a long string called the anon key. Many people panic when they spot it. Don't. Supabase is designed so that this key sits in the browser.
The catch is what that design assumes. The anon key is a public pass, and the only thing between that pass and your data is RLS. With RLS switched on and sensible policies, a stranger holding the key gets nothing. With RLS off, a stranger holding the key can ask your database for every row in a table, and it will hand them over.
So the key is not the secret. The policies are the lock.
The mistakes we see most
RLS was never switched on for a table
Tables created through the Supabase dashboard's table editor have RLS enabled by default. Tables created by running SQL, which is exactly what an AI tool does when it generates a migration, may not. The app still works, because with RLS off every query succeeds. Nothing in the app tells you anything is wrong.
If a table holds anything personal, such as orders, messages, profiles or uploaded documents, check this one first.
A policy exists but it says "allow everyone"
Some AI-generated policies are written to make an error go away. You ask the tool to fix "new row violates row-level security policy" and it responds with a policy whose condition is simply true. The error disappears and so does the protection.
A policy like this on a table that holds user data is the same as having no RLS at all, except it looks like you do.
Read is locked down, but update and delete are not
A policy covers one action. Someone writes a careful select policy so users only see their own rows, then a loose update policy so the app "just works". Now a logged-in user cannot read other people's rows, but can overwrite them if they guess or find an ID.
Update policies need two checks: which existing rows you can touch, and what the row is allowed to look like afterwards. Generated code often only has the first.
The policy trusts something the user can edit
Supabase auth stores a block of data called user_metadata on each user, and users can change their own. If a policy checks something like user_metadata ->> 'role' = 'admin', a user can make themselves an admin from the browser console. Roles and permissions belong in app_metadata or in your own table that only the server writes to.
Views quietly skip your policies
A database view that joins two tables can return data from both without your RLS applying, because by default it runs with the permissions of whoever created it. If your app reads from a view and you assumed the policies on the underlying tables protect it, they may not. Recent Postgres versions let you set security_invoker on the view to fix this, and it is worth asking whoever built the app whether they did.
The service role key ended up in the front end
This is the worst one, and it is less rare than it should be. The service role key skips RLS entirely. It must only ever live on a server. If it shows up in your browser code, an environment variable prefixed for the front end, or a public GitHub repo, every policy you wrote is irrelevant.
Storage buckets with no rules
File uploads have their own policies, separate from your tables. A bucket marked public serves every file in it to anyone with the URL. Profile photos are fine that way. Invoices, ID scans and contracts are not.
How to check your own app in ten minutes
You do not need to read any code for the first pass. You are going to ask your database for data the way a stranger would.
Find your project URL and anon key. The URL is in your Supabase project settings, and the anon key is the same one visible in your app's browser traffic.
Pick a table name you know exists, like
profilesororders. Your table list is under Table Editor in the dashboard.In a terminal, run this, replacing the placeholders:
curl "https://YOUR-PROJECT.supabase.co/rest/v1/profiles?select=*&limit=5" \
-H "apikey: YOUR_ANON_KEY" \
-H "Authorization: Bearer YOUR_ANON_KEY"
If you get back [], an empty list, that table is either empty or protected. If you get back real rows, anyone can read them without logging in.
Repeat for every table that holds user data. Then do it again while logged in as an ordinary test user, and try to read a row that belongs to a different account.
Supabase also has a Security Advisor in the dashboard that flags tables with RLS disabled and a few of the other issues above. Run it, but treat it as a starting point. It cannot tell you that a policy saying true is a bad idea for your particular data.
What to do when you find a problem
Switch RLS on for the table first, because an empty list in your app is a much smaller problem than a leaked one. Then write the policies properly, usually along the lines of "a user can only see and change rows where the owner column matches their own user ID".
Expect the app to break in places after that. Anything that was quietly relying on open access will start returning nothing. Fixing those is the real work, and it is where AI tools tend to loop, adding true policies again to get unstuck. If you see that happening, stop and get a human to look.
If any personal data was readable while the table was open, it is worth working out for how long, and if UK or EU users were involved, whether you have a duty to tell anyone. That is a question for a professional, but knowing the dates helps.
Where to go from here
RLS is one area of many that decide whether an AI-built app is safe to put real users on. Vibe Code Guardian runs a free surface check that looks at what is publicly visible on a domain you own, and a launch-readiness audit where a developer goes through the app point by point and gives you a ranked list of fixes. If you would rather have someone else confirm your database is locked down before you launch, that is what they are for.
If you only do one thing today, run the curl test on your most sensitive table. It takes two minutes and the answer is either reassuring or very much worth knowing.