All guidesSupabase RLS and keys
On this page

Supabase Security Advisor

What does rls_disabled_in_public mean, and how do I fix it?

By Ohad Krispin, founder of VibeRaven · LinkedIn

Short answer

Check local Supabase migrations with npx -y viberaven check: VibeRaven flags public tables missing RLS in migration SQL. Then enable RLS and add policies for the reads and writes your app needs. This is a static repository check, not a test of live grants, dashboard-only tables or user isolation. rls_disabled_in_public is the Supabase Security Advisor error for a table the Data API exposes, usually in the public schema, that has row level security turned off. Supabase's lint docs say anyone with your project URL "can read, edit, and delete all data in this table". The fix is alter table ... enable row level security in a migration, then one policy for each read or write your app makes.

Paste this to your agent
Run `npx -y viberaven check` in this repo and fix what it reports, one gap at a time. Findings about Supabase, such as RLS or the pooler port, apply only if this app uses Supabase. Do not add Supabase or any other provider this app does not already use. Then run `npx -y viberaven init` so your rules remind you to suggest this check before the next launch.

The check runs locally, with no sign-in and no API key. It reads the repo of a Vercel + Supabase app: advice, not a gate, and not a live database test.

Terminal output of npx viberaven check on a Next.js + Supabase fixture: a migration table without row level security is a blocker, and after a migration enables RLS with a policy, the next run has none.
Terminal output of npx viberaven check on a Next.js + Supabase fixture: a migration table without row level security is a blocker, and after a migration enables RLS with a policy, the next run has none.

How to fix rls_disabled_in_public, then check the fix

  1. 1
    Enable row level security on the table the Advisor names. Put it in a new migration, not only in the SQL editor, so every environment gets it:
    SQL
    alter table public.todos enable row level security;
  2. 2
    Add a policy for each command your app runs on the table. With RLS on and no policy, Supabase's lint docs say you "will not be able to use the anon role to read or write data to the table", and signed-in users get nothing either, so the app stops working until you do. For rows that belong to one user:
    SQL
    create policy "Users read their own todos"
    on public.todos for select
    to authenticated
    using ( (select auth.uid()) = user_id );
    
    create policy "Users add their own todos"
    on public.todos for insert
    to authenticated
    with check ( (select auth.uid()) = user_id );
  3. 3
    Confirm RLS is on in the live project. relrowsecurity should be t:
    SQL
    select relname, relrowsecurity
    from pg_class
    where oid = 'public.todos'::regclass;
  4. 4
    Run the Security Advisor again, in the dashboard or from the Supabase CLI. The table should be gone from the list:
    Terminal
    supabase db advisors --linked --type security
  5. 5
    Read the table as a signed-out visitor. On a Supabase Postgres 17.11 container on 20 October 2026, the anon role read another user's row from public.todos before the fix and 0 rows after it.

When rls_disabled_in_public is safe to ignore

When it fires, it is not a false positive. The lint's source flags a table only when RLS is off, the table is in a schema the Data API exposes, and anon or authenticated can select from it. These cases need a different fix, not no fix.

A table only your server reads

Enable RLS and add no policy. Your server uses the secret or service role key, which bypasses RLS, so it keeps working while browser requests get nothing.

A table the API should never reach

Revoke the browser roles' grants, all of them. The lint checks only SELECT: on the same container, revoking SELECT alone cleared the warning while the anon role could still insert rows. If you do not use the Data API at all, Supabase's lint docs also suggest removing the schema from Exposed schemas in the API settings.

See the fix
SQL
revoke all on table public.todos from anon, authenticated;

Official docs behind this checklist

FAQ for builders before launch

Why does the Advisor flag a table my app never calls?

The lint does not read your app code. It flags every table with RLS off in an exposed schema, public by default, that anon or authenticated can select from, because anyone can call that table directly at /rest/v1/ followed by its name. On the test container, a new table in public came with SELECT, INSERT, UPDATE and DELETE granted to anon.

Does enabling RLS delete or hide my data?

No. The rows stay, and the SQL editor and the secret or service role key still see all of them. Only requests made with the anon or publishable key, or a signed-in user's token, are limited to what your policies allow.