Supabase RLS explained for non-technical founders

Supabase RLS explained in plain English: why your app needs it, how to check it in 10 minutes, and what the 30 Oct 2026 "permission denied" change means.

Row Level Security (RLS) is the rule inside your Supabase database that decides which rows each user may read or change. A Supabase app's browser code talks to the database directly, using a key that anyone can see. So RLS is usually the only thing stopping a stranger from reading, editing or deleting every row in a table. If you built your app with Lovable, Bolt or an AI agent, checking RLS is the most valuable ten minutes you can spend on its security.

This post explains RLS without assuming you write code. It covers how to check yours, what good and bad rules look like (so you can ask the right questions), and what Supabase's 30 October 2026 change means if your app or your AI tool suddenly hits "permission denied for table."

TL;DR#

  • RLS is a per-row permission check the database runs on every request. With it on and the right rules, user A only ever gets user A's rows.
  • Your Supabase key in the browser is public by design. Without RLS, Supabase's own warning says anyone with your project URL "can read, edit, and delete all data" in that table.
  • Check it in Advisors → Security. "RLS disabled in public" is an error, not a suggestion. "Permissive policy" warnings matter too.
  • RLS switched on isn't the same as RLS done right. A rule that says using (true) lets everyone in.
  • Since 30 October 2026, new tables need an explicit grant as well. If your AI tool "fixes" the resulting error by turning RLS off, undo it.

What is RLS in Supabase, in plain English?#

Think of your database as an office building and each row as a filing cabinet. Without RLS, anyone who gets through the front door can open every cabinet. With RLS, every cabinet checks the visitor's badge, and only opens for the person it belongs to.

In technical terms, a policy is a rule attached to a table, and Supabase describes it well: "Think of a policy as adding a WHERE clause to every query." If the policy says "only rows where user_id is the signed-in user," then a request for "all invoices" quietly returns only that user's invoices. Nobody has to remember to add the filter in the app code, because the database adds it every time.

Two more things are worth knowing:

  • RLS on with no policies means nobody gets in through the API. Supabase: "Once RLS is enabled, no data is accessible through the API when using a publishable key, until you create policies."
  • RLS protects the data however it's reached, which is why Supabase calls it "defense in depth."

Why does a Supabase app need RLS when other apps don't?#

In a traditional app, the browser talks to your server, your server checks who you are, and only the server talks to the database. The database is never reachable from the internet.

Supabase apps usually skip that middle step. The browser talks to the database through Supabase's Data API, using your project URL and your publishable key (called the anon key in older projects). That key ships inside your app's JavaScript, and anyone can find it in their browser's developer tools in seconds. That's fine and intended, but only because RLS does the checking a server would have done.

Without RLS, a request using the public key goes straight from the browser through Supabase's Data API to every row in the table, including other customers' rows; with RLS, the same request passes a policy check and only the signed-in user's own rows come back
The key in your browser is public. RLS is what makes that safe.

What it means for you: if one table holding customer data has RLS off, that data is effectively public. It doesn't matter that your app's screens never show it.

What does "RLS disabled in public" mean?#

It's the most serious warning Supabase's Security Advisor shows, and the one founders most often ask about. Supabase's linter lists it as an ERROR named "Table publicly accessible," and spells out the consequence: "Anyone with your project URL can read, edit, and delete all data in this table because Row-Level Security is not enabled."

"Public" here is the name of the database schema (the default folder your tables live in), not a setting you chose. The fix is to turn RLS on for that table and then add policies. Turning it on alone will make the table look empty to your app until the policies exist, so do both together, ideally on a copy of the app first.

These are the Security Advisor warnings about access rules, in plain English:

Warning in Supabase What it means How urgent
RLS disabled in public (Table publicly accessible) Anyone with your project URL can read, edit and delete this table Fix today
Security definer view (View bypasses row-level security) A view (a saved query) ignores the rules on the tables behind it Fix today
Permissive RLS policy (allows unrestricted access) A rule exists, but it lets everyone through, often using (true) Fix before launch
RLS enabled, no policy (No access rules defined) Locked to everyone through the API Fine if intended; otherwise a feature is broken
Policy exists, RLS disabled (Security policy not enforced) Someone wrote a rule but never switched RLS on, so it does nothing Fix today

The full list, with remediation steps, is in Supabase's database advisors docs.

How to check your Supabase RLS in 10 minutes#

You can do the first three steps yourself, without writing code.

1. Open the Security Advisor#

In your Supabase dashboard, go to Advisors → Security. Any error mentioning RLS or "publicly accessible" is a blocker. Screenshot the list; it's your to-do list.

2. Read the policies, table by table#

Go to Database → Policies. For every table that holds customer data, look for three things:

  • RLS is enabled
  • There's a policy for each action the app uses (reading, creating, updating, deleting)
  • No policy on private data says true on its own, which means "everyone"

3. Do the two-account test#

Sign up twice, as user A and user B, in two different browsers. As A, create something private (an invoice, a note, a profile). As B, try to open it: paste A's page URL, or change an ID in the address bar. If B can see it, the policy is wrong, however the dashboard looks.

4. Ask your developer to try the public key directly#

This is the test that matters most, because it's what an attacker does. It skips your app entirely and asks the database for a table using only the public key:

# Read a table the way a stranger could: no login, just the public key from your site
curl "https://<project-ref>.supabase.co/rest/v1/profiles?select=*" \
  -H "apikey: <your-publishable-key>"

# Pass: an empty list [] or a permission error.
# Fail: rows of real users. That table is readable by anyone on the internet.

Repeat for every table with customer data, and repeat it signed in as user B with B's access token, to make sure B only gets B's rows. My production readiness audit for vibe-coded apps puts this test next to the other checks that should pass before launch.

What a good policy looks like#

You don't need to write these, but you should be able to recognise them. This is Supabase's own example of "users can only see their own profile":

-- Turn RLS on for the table (nothing is readable until policies exist)
alter table profiles enable row level security;

-- Signed-in users can read only the row whose user_id is their own
create policy "Users can view their own profile."
on profiles for select
to authenticated                          -- logged-out visitors never match this rule
using ( (select auth.uid()) = user_id );  -- the signed-in user's ID must equal the row's owner

-- Updates check the row before AND after the change,
-- so nobody can edit someone else's row or hand their row to someone else
create policy "Users can update their own profile."
on profiles for update
to authenticated
using ( (select auth.uid()) = user_id )
with check ( (select auth.uid()) = user_id );

And this is the pattern to worry about when you see it on private data:

-- "Everyone can read everything": fine for a public price list, a leak for invoices
create policy "Enable read access for all users"
on invoices for select
using (true);

Supabase's RLS guide recommends a separate policy for each action, always naming who it applies to with to, and an index on the columns policies filter by. For apps where users belong to teams or companies, the rules get more involved. I cover those patterns in multi-tenant SaaS in PostgreSQL.

Every Supabase Data API request passes three gates in order: a grant must let the role use the table, or the request fails with permission denied 42501; RLS must be enabled on the table; and a policy must match the row, or the row is silently left out; only rows that pass all three are returned
Since 30 October 2026, new tables start closed at the first gate.

The 30 October 2026 change: "permission denied for table"#

Supabase announced in April that it would stop exposing new tables to the Data API automatically. The change reached new projects from 30 May 2026, and all existing projects on 30 October 2026. Existing tables keep working. But any table created since then needs an explicit grant, a separate permission that lets the app's roles use the table at all. Without it, the app gets this error:

{
  "code": "42501",
  "message": "permission denied for table your_table"
}

Here's the risk for AI-built apps. An AI tool that sees "permission denied" may try the wrong things: switching RLS off, or using the secret key in the browser. Neither fixes the real cause, and both open the table to everyone. Supabase's announcement gives the right fix as three steps that go together: grant the access the app needs, enable RLS, and add the policies. "Treat these three steps as a unit."

If a new feature broke in the last week and someone "fixed" it quickly, open the Security Advisor today.

Common RLS mistakes in AI-built apps#

These are the gaps that show up again and again:

  • Tables created by SQL or migrations without RLS. Tables made in Supabase's Table Editor get RLS on by default, but Supabase's docs say tables created in the SQL editor or "through another tool" need it enabled explicitly. AI agents usually create tables with SQL. Supabase documents an event trigger that turns RLS on automatically for new tables.
  • A read rule but no update rule, or the reverse. The screen works, but a user can edit rows they can't see.
  • Trusting the user ID the browser sends. Policies must compare against auth.uid(), the verified login, not a field in the request.
  • Views that skip the rules. "Views bypass RLS by default," per Supabase, unless they're created with security_invoker = true.
  • The secret key in the frontend. Supabase's secret key (or the legacy service_role key) bypasses RLS entirely and must never reach a browser. If it ever did, replace it; my 10-minute API key check shows where to look.
  • Storage buckets left public. Uploaded files have their own access rules. Check that a private file's link doesn't open in a logged-out browser.

Want a second pair of eyes on your RLS?#

Reading policies is quick. Knowing whether they're right for how your app actually works takes a developer who tests them the way an attacker would. My Supabase RLS review goes table by table with two accounts and no account, and gives you a plain-language list of what to fix first. Get your RLS reviewed.

Do I need RLS if my app has its own backend?#

If your browser never talks to Supabase directly and every request goes through your own server, RLS is no longer the only lock, but it's still worth having. A forgotten endpoint or a leaked key then hits a second wall. If you don't use the Data API at all, Supabase's own alternative is to remove the public schema from the exposed schemas in the API settings, so there's nothing for the public key to reach.

If you're moving a Lovable app to your own Supabase project, the policies come across with the database, but check them again on the new project. I go through that in migrating Lovable Cloud to Supabase.

Get your Supabase app checked#

I review Supabase apps built with Lovable, Bolt, Cursor and Claude Code: every table's RLS and grants, views, storage buckets and keys, tested with real accounts and no account, with fixes written as migrations your app can apply. If something is already broken in production, start with what to fix first in an AI-built app. Start a project.

FAQ#

What is RLS in Supabase?#

Row Level Security is a PostgreSQL feature that Supabase uses to decide which rows each user can read or change. Each table gets policies, rules such as "a user can only see rows where user_id is their own ID," and the database applies them to every request, whatever the app code does.

Is Supabase secure without RLS?#

No, not for any table your app reaches from the browser. Supabase's own warning for a public table without RLS is that anyone with your project URL can read, edit and delete all of its data. Supabase is secure when RLS is on and every table has correct policies.

What does "RLS disabled in public" mean in Supabase?#

It means a table in your main public schema has Row Level Security switched off, so it's open to anyone holding your public key. Supabase marks it as an error. The fix is to enable RLS on that table and add policies for each action your app uses, testing on a copy first.

Is it safe to expose the Supabase anon or publishable key?#

Yes, it's designed to be public and ships in your frontend code. It's only safe because RLS limits what it can do. The secret key (or legacy service_role key) is different: it bypasses RLS and must never appear in browser code.

Why does Supabase say "permission denied for table"?#

Since 30 October 2026, new tables in existing Supabase projects aren't exposed to the Data API until you grant access. The error (code 42501) means that grant is missing. Fix it by granting the roles the access they need, enabling RLS and adding policies together. Don't fix it by disabling RLS.

Does the service role key bypass RLS?#

Yes. Supabase's secret key and the legacy service_role key act as a role with the bypassrls attribute, so policies don't apply to them. Use them only on a server for admin tasks, and never in an app's frontend.

Muhammad Huzaifa Abdulahad
Written by

Muhammad Huzaifa Abdulahad

Full-Stack Software & DevOps Engineer

I build SaaS platforms with Node.js, NestJS, TypeScript and PostgreSQL, and run them on Linux, Docker, AWS and CI/CD — from the first line of code to production.

Related articles

See all posts →

Have a complex idea? Let's build it together.

From MVPs to scalable products, let's turn your idea into reliable software built for real-world impact.