Supabase "RLS disabled in public" warning: how to fix it safely
Supabase's Security Advisor shows RLS Disabled in Public, or you got an email saying a table is publicly accessible. It means anyone with your app's public key can read, and often change, every row in that table. Here's how to close it without your app suddenly showing empty pages.
Stuck on this? Get it fixed for €49.
Fixed in 48 hours or you don't pay. Launch deal for the first 5 customers (normally €79). You get the tested fix as a pull request, so nothing changes until you merge it.
Get it fixed for €49What the warning means
Tables in the public schema are reachable through Supabase's API. The key your app uses in the browser (the anon or publishable key) is visible to anyone who opens your site. Row level security (RLS) is what decides which rows that key can see. With RLS off, the answer is all of them. Supabase's linter docs describe this check as lint 0013_rls_disabled_in_public.
AI builders often create tables quickly and leave RLS off, so this is one of the most common warnings on Lovable, Bolt and Cursor apps.
1. Find the tables
In the Supabase dashboard open Advisors, then Security Advisor. Each RLS Disabled in Public row names a table. You can also run this in the SQL editor:
select tablename
from pg_tables
where schemaname = 'public' and rowsecurity = false;
2. Decide who should see each table
Before you switch anything on, write one line per table: who should read it, and who should write to it. Typical answers are "only the signed-in user who owns the row", "any signed-in user can read", or "everyone can read, nobody can write from the browser" (a public product list, for example).
3. Turn on RLS and add policies in one go
Turning RLS on with no policies blocks the browser key completely. The API then returns an empty list instead of an error, which looks like your data has vanished (our guide to empty data with no error covers this). So add the policies in the same step. For a table where each row belongs to a user through a user_id column:
alter table public.notes enable row level security;
create policy "Users read own notes" on public.notes
for select to authenticated
using ((select auth.uid()) = user_id);
create policy "Users add own notes" on public.notes
for insert to authenticated
with check ((select auth.uid()) = user_id);
create policy "Users edit own notes" on public.notes
for update to authenticated
using ((select auth.uid()) = user_id)
with check ((select auth.uid()) = user_id);
create policy "Users delete own notes" on public.notes
for delete to authenticated
using ((select auth.uid()) = user_id);
For a table everyone may read but nobody may change from the browser, one policy is enough:
alter table public.products enable row level security;
create policy "Anyone can read products" on public.products
for select to anon, authenticated
using (true);
Change the table and column names to match yours. Supabase's row level security guide has more patterns, such as team or organisation access.
4. Tables the browser should never touch
Some tables are only used by your server, an Edge Function or a webhook: payment records, admin logs, internal settings. Turn RLS on and add no policies. Server code using a secret (or service_role) key skips RLS, so it keeps working, while the browser key gets nothing. Better still, move those tables to a schema the API doesn't expose.
5. Test as a real user
Open your live app in a private window, sign in as an ordinary test user and click through every page that shows or saves data. Then sign in as a second user and check you can't see the first user's rows. If a page goes blank, a policy is missing for that action; check the browser's Network tab for the request that came back empty or with a 401 or 403.
Watch out for these
- Views can skip RLS even when the table has it. See Supabase view bypasses RLS.
- Storage buckets have their own policies. See storage upload 403.
- New tables in projects affected by Supabase's 30 October change also need explicit grants, or you'll see permission denied (42501).
using (true)on insert, update or delete puts the hole straight back. Only usetruefor reads of genuinely public data.
Quick checklist
- Every table in
publichas RLS on - Each table has policies for the actions the app really uses
- Server-only tables have RLS on and no browser policies
- Tested as two different users on the live site
- Security Advisor shows no
RLS Disabled in Publicrows
Stuck on this? Get it fixed for €49.
Fixed in 48 hours or you don't pay. Launch deal for the first 5 customers (normally €79). You get the tested fix as a pull request, so nothing changes until you merge it.
Get it fixed for €49Still stuck?
Mendlark fixes this kind of problem for a fixed €49 (launch price, normally €79). We agree the problem first, test the fix and send it as a pull request, so nothing changes in your app until you merge it. If we can't fix it, you don't pay. Get the €49 fix, or start with a free scan.
Not sure what else is wrong? Paste your app link into the free instant check and get a plain-English list of problems in seconds.