Futurista Soft Book a call (opens in a new tab)
Founder guide

“RLS Disabled in Public” in Supabase: what it means and how to fix it

Last reviewed 30 November 2026

Written by Futurista Soft · Reviewed by Bikram Saini and Amol Chhabra

You open Supabase’s Security Advisor, or Lovable’s security check, and a table is flagged for missing row-level security. It’s one of the few warnings worth stopping for. Here’s what it exposes and how to fix it without leaving your app blank.

Short answer

The warning means a table your app’s API can reach has no Row Level Security (RLS), so anyone with your project’s address and public key can read, change and delete its rows. Write policies that say who may see and change which rows, then switch RLS on in the same change. Test with two accounts. Never fix errors by turning RLS off, allowing everyone, or putting the secret key in the browser.

Rather talk it through with someone? Tell us about your app →

What the warning means

Supabase’s advisors are built-in checks on your database. This one is called RLS Disabled in Public (0013_rls_disabled_in_public), and Supabase gives it the level “ERROR”. Its summary is two words: “Table publicly accessible”. Each finding names a table, along the lines of “Table public.orders is public, but RLS has not been enabled.”

Tables in the public schema can be reached through Supabase’s API. Your app talks to that API with a publishable key (older projects call it the anon key), and that key sits in every visitor’s browser. That’s by design: Supabase says (opens in a new tab) it only reaches what Row Level Security allows. With RLS off, nothing is checked. The advisor’s explanation (opens in a new tab) says anyone with your project’s URL can then read, edit and delete all data in that table.

Find every table it applies to

If you’re comfortable in the SQL Editor, this lists the tables in public with RLS off:

select tablename
from pg_tables
where schemaname = 'public' and not rowsecurity;

Before you switch RLS on

Turning RLS on is the fix, but on its own it can make your app look broken. Supabase’s RLS guide (opens in a new tab) says that once RLS is on, no data is accessible through the API with a publishable key until you create policies. Lists come back empty and saves fail.

So decide, for each flagged table, who should reach it:

Back up first. Then write the policies and switch RLS on in the same change, ideally a migration, so the app is never left with RLS on and no rules. Our backup guide covers Lovable apps.

The fix, step by step

This follows the patterns in Supabase’s RLS guide, for an orders table with a user_id column:

-- Signed-in users can see their own orders
create policy "Users can view their own orders"
on public.orders for select
to authenticated
using ((select auth.uid()) = user_id);

-- Signed-in users can only add orders as themselves
create policy "Users can create their own orders"
on public.orders for insert
to authenticated
with check ((select auth.uid()) = user_id);

-- Now switch RLS on
alter table public.orders enable row level security;

Updates and deletes need their own policies, and Supabase notes that an update needs a matching select policy to work as expected. For a table everyone may read, a select policy to anon, authenticated using (true) is acceptable, and Supabase says to use it only for data that’s meant to be public. The “RLS Policy Always True” check may still flag it, and Supabase lists public read-only tables as a case where that’s intended.

Supabase also asks you to check table grants, which apply before any policy. That’s for whoever writes your migrations.

Then test it with two accounts. Sign in as A and create something. As B, try to see, change and delete it, then try again signed out. All of it should fail. Developers can turn this into tests that Supabase runs with supabase test db. Finally, rerun the Security Advisor.

A prompt to paste into Lovable to fix it

On Lovable’s built-in backend the policies view is read-only, so you make this change through the chat. Choose Plan in the mode picker first. Lovable’s Plan mode guide (opens in a new tab) lists designing database schemas and investigating errors among its uses, and it never changes your code. Send this once for each flagged table:

The security check says the table [table name] has no row level security.

Don’t change anything yet. First tell me:
1. Which pages and functions read or write this table, and as which users.
2. Whether each row belongs to one user, is public to read, or is only for the server.
3. The policies you would write for select, insert, update and delete, and the single migration that adds them and switches RLS on together.
4. How I can test it with two accounts, and while signed out.

Don’t write policies that let everyone change data, don’t add a rule that lets signed-out requests through, and don’t use the service_role key in frontend code to get round RLS. Leave other tables alone.

Check the plan against who should really see the data before you click Approve, then rerun the checks in Lovable’s Security view (opens in a new tab). If the plan opens a private table to everyone, or you can’t tell, ask a developer to review the policies first.

Where this comes from in Lovable and Bolt apps

What not to do

When to get a review

Get a second pair of eyes if the table holds personal, health or payment data, if real customers used the app while RLS was off, or if fixing one table keeps breaking another. If the data may have been exposed, check what the law asks of you, as well as fixing the rules. For the wider picture, read whether Lovable apps are secure and our security checklist for AI-built apps. When we review and fix AI-built apps, we start with a written audit of every table and its rules, before anything changes.

Questions founders ask

Will switching RLS on break my app?

It can. With RLS on and no policies, the browser can’t read or write that table at all. Write the policies first and switch RLS on in the same change, then test with two accounts.

The table is meant to be public. Can I leave RLS off?

It’s better not to. Without RLS, visitors can change and delete rows as well as read them. Switch RLS on and add a read-only policy instead.

Can Lovable fix this for me?

Lovable’s auto-fix handles common RLS mistakes, and you can ask it in the chat to review your policies. Check the result yourself with two accounts, and rerun the security checks afterwards.

Read next