What you see
The Supabase dashboard’s Security Advisor, the CLI (supabase db advisors) or the get_advisors MCP tool lists an error like this:
RLS Disabled in Public
Table `public.profiles` is public, but RLS has not been enabled.
Level: ERROR · rls_disabled_in_public
Supabase’s summary for it is “Table publicly accessible”, and the ramification it gives is: “Anyone with your project URL can read, edit, and delete all data in this table because Row-Level Security is not enabled.”
You may also see a warning on tables that do have RLS:
Security policy allows unrestricted access
Level: WARN · permissive_rls_policy
Why it happens
Vibe-coded apps call Supabase straight from the browser with the project URL and the public (anon / publishable) key. Both are in your JavaScript, so anyone can copy them. That is fine only because Row Level Security decides which rows each request may touch.
Supabase’s docs explain the two checks a request goes through:
- Grants decide whether a role may run an operation on the table at all. On existing projects, “a new table in
publicstarts with every privilege already granted” toanon,authenticatedandservice_role. - Policies decide which rows the operation applies to, but only when RLS is on.
So a table created with SQL (often by an AI agent or a migration) without enable row level security is open to the whole internet with full create, read, update and delete. Supabase calls this “a critically unsafe configuration.”
The warning is the quieter version of the same leak. A policy with USING (true) or WITH CHECK (true) turns RLS on in name only. Supabase’s advisor docs say this commonly happens when “developers create placeholder policies during development and forget to update them.”
Fix it
Run these in the SQL Editor, or better, in a migration so every environment gets the same change. Replace profiles and user_id with your table and owner column.
1. Turn RLS on
alter table public.profiles enable row level security;
Supabase: once RLS is enabled, “no data is accessible through the API when using a publishable key, until you create policies.” Your app will stop seeing this table until step 3, so do all three steps together.
2. Trim the grants
Policies don’t remove the default grants. Supabase’s RLS page warns that “a table protected only by policies still hands anon an insert path if you never revoke the grant.” Revoke everything, then give back only what your app uses:
revoke all on table public.profiles from anon, authenticated;
grant select, insert, update, delete on table public.profiles to authenticated;
3. Add policies that check the owner
create policy "Users read own profile"
on public.profiles for select
to authenticated
using ( (select auth.uid()) = user_id );
create policy "Users update own profile"
on public.profiles for update
to authenticated
using ( (select auth.uid()) = user_id )
with check ( (select auth.uid()) = user_id );
4. Replace always-true policies
Find policies whose condition is true, 1=1 or missing, and replace them with a real condition like the ones above. Keep to anon using (true) only for data that is genuinely meant to be public. Supabase’s docs say it “grants every unauthenticated visitor read access to every row.”
If a write then fails with new row violates row-level security policy, your policy is now doing its job but doesn’t cover that insert yet. See fixing “new row violates row-level security policy”. To hide specific columns (like is_admin or plan) from updates, see protecting columns under RLS.
If you don’t use the Data API at all
Supabase also documents a blunter option: remove public from Exposed schemas in the API settings, which makes everything in it unreachable over the API.
Check it worked
- Re-run the Security Advisor.
rls_disabled_in_publicandpermissive_rls_policyshould be gone for your tables. - Sign in as a second test user and try to load the first user’s rows. You should get nothing back.
- Run the free production-readiness checker on your live URL. It finds your Supabase project in the bundle, flags any
service_rolekey shipped to the browser, and reminds you which RLS settings to test by hand.
The advisor can’t tell whether a policy matches what your app means to allow. If you want a human to read your policies and the rest of your launch path, get a written pre-launch audit.