Short answer: run two queries in the Supabase SQL editor: one lists every table in public with its RLS status, the other lists every policy and what it allows. Any table with RLS off, or a policy that says true on private data, is readable with the public anon key your app ships. Then prove it with a "stranger test": request a row using only that key. Fix by enabling RLS and writing policies that match auth.uid().
Why RLS is the whole lock
Many AI-built apps that use Supabase query it straight from the browser using the anon (publishable) key. That key is public by design. Row Level Security is the rule set that decides what that key can actually read and write. Turn it off, or write a policy of true, and the key becomes a pass to the whole table.
Check 1: which tables have RLS off
In your Supabase project's SQL editor, run:
select tablename, rowsecurity from pg_tables where schemaname = 'public' order by rowsecurity, tablename;
Every row with rowsecurity = false is open to the public key, unless you've removed that role's privileges on it. Supabase's Security Advisor also reports tables with RLS disabled.
Check 2: which policies are too loose
select tablename, policyname, cmd, roles, qual, with_check from pg_policies where schemaname = 'public' order by tablename;
Read the qual (who can see a row) and with_check (what can be written) columns:
truewith roleanonorpublic: anyone on the internet passes. Fine for a blog posts table, wrong for profiles, orders or messages.truewith roleauthenticated: any signed-in user sees every row. If sign-up is open, that's effectively anyone.- An
insertorupdatepolicy with an emptywith_check: users may be able to write rows that belong to someone else. - No policies at all on an RLS-enabled table: locked for the anon and authenticated roles. Safe, but the app may break.
Check 3: the stranger test
Policies can look right and still leak. Ask the API directly with only the public key and no login:
curl "https://YOUR-PROJECT.supabase.co/rest/v1/orders?select=*&limit=1" \ -H "apikey: YOUR_ANON_OR_PUBLISHABLE_KEY"
Repeat for each table that holds user data. [] or a permission error is good. A real row means a stranger can read it. Only test projects you own.
How to fix open tables
Private, per-user data
For a table with a user_id column that stores the owner's id:
alter table public.orders enable row level security; create policy "Owners read their orders" on public.orders for select to authenticated using ( (select auth.uid()) = user_id ); create policy "Owners create their orders" on public.orders for insert to authenticated with check ( (select auth.uid()) = user_id );
Add update or delete policies only if the app needs them, each with the same auth.uid() condition.
Content that really is public
Make the rule narrower than true where you can, for example only published rows:
create policy "Anyone reads published posts" on public.posts for select to anon, authenticated using ( published = true );
Remove the loose policy
drop policy "Enable read access for all users" on public.orders;
Use the exact policy name from Check 2. Then run Checks 1–3 again and click through your app signed in as a normal test user.
Or ask your AI builder
List every table in the public schema with its RLS status and policies. Enable RLS on all of them. For tables with user data, replace any policy using "true" with policies that only allow rows where auth.uid() matches the owner column, and add with check on insert and update. Keep public read access only for tables I confirm are public. Show the SQL before running it.
What CapLeak checks here
CapLeak does a version of the stranger test from the outside. When it finds your Supabase project URL and public key in your app's code, it asks Supabase, with that public key only, how many rows each table would return. It checks up to 20 tables: the ones your code refers to, plus Supabase's public table list if your project exposes it. It's a count-only request, so no row is ever downloaded, and a table only counts as a problem when it would really return rows to a stranger. The free score shows the result as Problem found or No problem found under "Database (Supabase) access". It also flags a leaked service_role or sb_secret_ key, which bypasses RLS entirely.
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. CapLeak can't read your policies, so run Checks 1 and 2 above as well. If you find a service_role key in your frontend, see Exposed Supabase service_role key: what to do. 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.