How to check your Supabase RLS policies before you launch
By Abhinav, founder of IdeaFlo. Updated 17 November 2026.
Open every table in your public schema and confirm row level security is on, then read each policy and test it as a signed-out visitor and as a second user. If either can read or change rows that are not theirs, the policy is unsafe. Supabase's Security Advisor flags tables with RLS turned off, but only a real test as another user proves your policies work.
Step 1. Find tables with RLS off
In the Supabase dashboard, open Advisors, then Security Advisor. Then open the Table Editor, where tables without RLS show a warning. Every table in the public schema needs RLS on.
Step 2. Read each policy
Open each table's policies and look for these unsafe patterns:
- A policy with
using (true), which lets everyone through. - A policy that only checks that the user is signed in (
auth.role() = 'authenticated') instead of matchingauth.uid()to the row's owner column. - Insert or update policies with no
with check, so a user can write rows that belong to someone else. - Storage buckets set to public that hold private files.
Step 3. Test as a signed-out visitor
Call your project's REST API with only the anon key and confirm private tables return no rows.
curl "https://your-project.supabase.co/rest/v1/your_table?select=*" \
-H "apikey: your-anon-key"Step 4. Test as a second user
Sign up a second test account and try to read and edit the first account's rows from the browser console or the app. If you can see or change anything that belongs to the first account, the policy is unsafe.
Step 5. Check what runs with the service role key
The service role key bypasses RLS, so it must only be used in server code or edge functions, never in the browser bundle. Search your code for it, including environment variables that start with VITE_ or NEXT_PUBLIC_.
Common fixes
Match auth.uid() to the column that stores the row's owner. This example assumes a projects table with a user_id column:
alter table public.projects enable row level security;
create policy "Owners can read their projects"
on public.projects for select
using (auth.uid() = user_id);
create policy "Owners can add their projects"
on public.projects for insert
with check (auth.uid() = user_id);
create policy "Owners can update their projects"
on public.projects for update
using (auth.uid() = user_id)
with check (auth.uid() = user_id);After changing a policy, run Steps 3 and 4 again.
Want us to check it for you?
We check and fix Supabase access rules in the code you already have. See how we fix broken Lovable apps, or start with the $499 Strategy Audit, credited toward any build.
Frequently asked questions
How do I check if my Supabase RLS policies are secure before launching my AI-built app?
Open every table in your public schema and confirm row level security is on, then read each policy and test it as a signed-out visitor and as a second user. If either can read or change rows that are not theirs, the policy is unsafe. Supabase's Security Advisor flags tables with RLS turned off, but only a real test as another user proves your policies work.
Is Lovable's security scan enough?
No scan proves your policies work. Treat automated checks, including Lovable's scan and Supabase's Security Advisor, as a first pass, then test as a signed-out visitor and as a second user before you launch.
What happens if I launch with RLS off?
Anyone with your project's anon key, which ships in your app's browser code, can call the REST API and read, and often change, every row in that table.
Does the service role key bypass RLS?
Yes. The service role key bypasses row level security completely. Use it only in server code or edge functions, never in the browser bundle.