“RLS Disabled in Public” in Supabase: what it means and how to fix it
Last reviewed 30 November 2026
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.
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
- Your own Supabase project: open the Security Advisor in the dashboard. Each finding lists the table. Developers can run the same checks with
supabase db advisors. - Lovable’s built-in backend: go to More → Database → Manage → Policies. Lovable’s database guide (opens in a new tab) says each table shows whether RLS is on and how many policies it has. The view is read-only, so you change policies through the chat.
- Bolt’s database: its Security page, titled “Security Audit”, uses the same checks as Supabase’s Security Advisor, according to Bolt’s guide (opens in a new tab).
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:
- Private to each user, like orders or profiles. The table needs a column holding the owner’s user ID.
- Public to read, like a product list or blog posts. Visitors may read it, but nobody should change it from the browser.
- Server only, like admin logs. RLS on with no policies is fine here, and Supabase suggests making that intent explicit with a policy that always says no.
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
- Tables added another way. Lovable says it sets up these rules when it builds features that store user data, and Bolt says (opens in a new tab) it turns on RLS for the tables it creates. Tables added by hand in the dashboard, by an import or by pasted SQL may not have it, so check those first.
- Sites without sign-in. Bolt warns that if you haven’t asked it to add sign-in, it may write policies that let any visitor view, add, change and delete data. Supabase and Bolt both flag these as “RLS Policy Always True”.
- Policies with RLS off. Supabase flags “Policy Exists RLS Disabled” when a table has policies that do nothing, for example after someone switched RLS off to clear an error.
- Server code with the secret key. Policies don’t apply to the
service_role, so Lovable says server code that uses it must check permissions itself.
What not to do
- Don’t turn RLS off to make an error go away. “Permission denied” and empty lists have proper fixes, covered in fixing Lovable and Supabase connection problems.
- Don’t open private tables to everyone with
using (true). Supabase’s check for this calls it a policy that “allows unrestricted access”. - Don’t add
or auth.uid() is nullto let signed-out requests through. Supabase’s guide shows that this returns every row to anyone who isn’t signed in. - Don’t put the secret key in the browser to get round RLS. It’s the
service_rolekey on older projects. Supabase says never to put it in a browser, a shipped app or source control. - Don’t just dismiss the finding. Check it against who should really see the data first.
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.