Guide · Supabase
Supabase RLS checker: can strangers read your tables?
Your Supabase public key is in your app's page code, and that is fine. What protects your data is Row Level Security. Here is how to test it the way a stranger would, and how to fix what you find.
Free instant check, no sign-up. It only reads what your app already shows to any visitor.
Why the public key is not the problem
A Supabase app running in the browser talks to the database directly. To do that it needs two things that every visitor can see: the project address (https://xxxx.supabase.co) and the public key (the anon key, or a key starting with sb_publishable_). Supabase is designed this way.
The public key only works through Row Level Security. With RLS on and good policies, it can read only what you allow. With RLS off, it can read the whole table. So the question is never "is my key hidden?" but "what does my key let a stranger do?".
Test a table the way a stranger would
Do this only on your own project. Take the project address and public key from your app's page code (or from Project Settings → API) and the name of a table, then run:
curl "https://YOUR-PROJECT.supabase.co/rest/v1/profiles?select=*&limit=1" \
-H "apikey: YOUR_PUBLIC_KEY" \
-H "Authorization: Bearer YOUR_PUBLIC_KEY"
| Answer | What it means |
|---|---|
[{"id":…,"email":…}] | Anyone can read this table. |
[] | RLS hides the rows from strangers, or the table is empty. Check which. |
| Error 401 or 404 | Access is refused, or there is no such table. |
Repeat for every table your app uses. The names are in your code wherever it calls .from("table_name").
Find every table without RLS
Run this in the Supabase SQL Editor. Every row it returns is a table that answers anyone with the public key:
select tablename
from pg_tables
where schemaname = 'public' and not rowsecurity;
The Security Advisor (Advisors → Security Advisor in the dashboard) reports the same and a few related problems.
Fix it: turn RLS on and write real policies
Turning RLS on with no policies blocks everything, which is safe but breaks the app. Add policies that say who may do what. For a table where each row belongs to one user:
alter table public.notes enable row level security;
create policy "Read own notes" on public.notes
for select using (auth.uid() = user_id);
create policy "Add own notes" on public.notes
for insert with check (auth.uid() = user_id);
create policy "Change own notes" on public.notes
for update using (auth.uid() = user_id) with check (auth.uid() = user_id);
create policy "Delete own notes" on public.notes
for delete using (auth.uid() = user_id);
For data that really is public, such as published posts, allow reading only the public rows: for select using (published = true).
Five mistakes that look like protection
using (true). RLS is on, but the policy lets every request through. The table is as open as without RLS.- Insert without
with check. Users can add rows in someone else's name, for example by settinguser_idto another user. - A role column users can change. If the update policy allows changing every column, a user can set
role = 'admin'orpaid = trueon their own profile. Keep such columns in a table users cannot write to. - Views. A view runs with the rights of its owner by default, so it can show rows that RLS hides. Create views with
with (security_invoker = true). - The service role key in the browser. It skips RLS entirely. If it is in your page code, rotate it now; no policy helps.
A prompt for your AI tool
If you built the app with Lovable, Bolt, Cursor or another AI tool, paste this:
Turn on Row Level Security for every table in the public schema. For each table, add separate policies for select, insert, update and delete so a signed-in user can access only their own rows (user_id = auth.uid()), and use "with check" on insert and update. Remove every policy whose condition is just "true". Make sure users cannot change role, plan or payment columns. Show me the SQL before running it.
Let ShipProof run the test for you
The free check finds the Supabase project in your live app and looks for the service_role key and other secret keys in the page code.
The full check runs after you prove the app is yours by adding one tag to your home page. It then takes the table names from your app's code and tries to read each one with the public key, the same request as above. Tables that answer are reported with the names of the fields a stranger could read, never their values, plus a fix prompt for each. Every request is read-only.
Check your Supabase app
A grade and the problems in plain language in a few seconds.