Guide
Supabase RLS check
Row level security decides which rows a role can touch after that role is allowed to touch the table at all. ShipShape Scan does not run this check. A public anon key is not evidence that RLS is on or off.
Grants first, then policies
Supabase’s Data API uses Postgres roles. A grant says the role may select or insert. A policy says which rows. If the grant is missing, PostgREST returns 42501 and the policy never runs. Supabase’s changelog states that split directly. From 30 October 2026, new tables in public on existing projects need the grant written down. See the 30 October explainer and the changelog entry.
RLS is documented in Row Level Security. Enabling it without a policy denies rows to anon and authenticated. The API returns no rows. service_role bypasses RLS, which is why that key does not belong in the browser.
Automatic RLS for new public tables
Supabase documents an optional event trigger that turns RLS on for tables created after you install it. It is not a switch this scan can see, and it is not on until you add it. The function is rls_auto_enable(). The event trigger is ensure_rls. It runs on ddl_command_end for CREATE TABLE, CREATE TABLE AS, and SELECT INTO. The function only calls enable row level security when the new table is in the public schema. The SQL below is the statement on Supabase’s event triggers guide. That page is the reference.
CREATE OR REPLACE FUNCTION rls_auto_enable()
RETURNS EVENT_TRIGGER
LANGUAGE plpgsql
SECURITY DEFINER
SET search_path = pg_catalog
AS $$
DECLARE
cmd record;
BEGIN
FOR cmd IN
SELECT *
FROM pg_event_trigger_ddl_commands()
WHERE command_tag IN ('CREATE TABLE', 'CREATE TABLE AS', 'SELECT INTO')
AND object_type IN ('table','partitioned table')
LOOP
IF cmd.schema_name IS NOT NULL AND cmd.schema_name IN ('public') AND cmd.schema_name NOT IN ('pg_catalog','information_schema') AND cmd.schema_name NOT LIKE 'pg_toast%' AND cmd.schema_name NOT LIKE 'pg_temp%' THEN
BEGIN
EXECUTE format('alter table if exists %s enable row level security', cmd.object_identity);
RAISE LOG 'rls_auto_enable: enabled RLS on %', cmd.object_identity;
EXCEPTION
WHEN OTHERS THEN
RAISE LOG 'rls_auto_enable: failed to enable RLS on %', cmd.object_identity;
RAISE;
END;
ELSE
RAISE LOG 'rls_auto_enable: skip % (either system schema or not in enforced list: %.)', cmd.object_identity, cmd.schema_name;
END IF;
END LOOP;
END;
$$;
DROP EVENT TRIGGER IF EXISTS ensure_rls;
CREATE EVENT TRIGGER ensure_rls
ON ddl_command_end
WHEN TAG IN ('CREATE TABLE', 'CREATE TABLE AS', 'SELECT INTO')
EXECUTE FUNCTION rls_auto_enable();
Supabase’s note on that page says this applies to tables created after the trigger is installed. Read that limit as four separate facts.
It creates no policies. A new table with RLS on and no policy returns no rows to anon and authenticated until you add a policy. The trigger does not write that policy for you.
It does not touch existing tables. Tables that are already there stay as they are. Those still need alter table … enable row level security if the flag is off. Run this read-only query in the SQL editor. It lists public tables where RLS is off, using pg_tables.rowsecurity. That column is the view of pg_class.relrowsecurity.
select schemaname, tablename from pg_tables where schemaname = 'public' and rowsecurity = false order by tablename;
It does not stop someone from later disabling RLS. The trigger fires for those three create commands. It does not fire when a later migration, the dashboard, or a person runs disable row level security. Nothing in the trigger turns the flag back on.
Put the function and the event trigger in a migration you commit, and run that migration in every environment. Pasting it once into the production SQL editor does not install it on a new preview branch or on a teammate’s local database. If one environment has the trigger and another does not, new tables will not behave the same.
What to look at in the dashboard
Open the table in the Supabase Table Editor. The RLS badge should say enabled, not disabled.
Open Authentication policies for that table. A policy with using (true) for anon is a public table, even with RLS on. A policy that compares auth.uid() to a user column is the usual shape for private rows. Enabling RLS, including with the event trigger, does not write that policy.
alter table public.your_table enable row level security; create policy "read own rows" on public.your_table for select to authenticated using (auth.uid() = user_id);
A manual test with two users
This is a check you run. ShipShape Scan does not log in, and it does not do this for you. The Launch Report does not either. It opens the same passive pass.
Create two users if you only have one. Log in as user A and note the id of a row that belongs to A. Log in as user B. Request that same id: change it in the URL, or change it in the API call the app makes. User B’s response should not include A’s row. If it does, the policy is wrong even when the RLS badge says enabled. A policy of using (true) fails this test on purpose. It returns every row.
What a ShipShape scan can add
If the published page contains a Supabase project URL or an anon key, the Quick Check reports it as client config. That is expected for a browser app. If it contains a service_role key, the finding is critical and the key should be rotated. The Launch Report includes the SQL above, plus the grants the October change requires. Pasting that SQL is still your step. The scan does not query tables, and it does not test row level security. Paying for the report does not turn that on.
The badge can say enabled while the rows are still public. A policy of using (true), a with check (true) added to clear an insert error, a policy that trusts user_metadata, or a SECURITY DEFINER function the anon role can call will do that. The guide on leaks with RLS on walks through each one. This scan still cannot see those policies. It can report a service_role key or a database connection string in the page. It cannot tell you the policy is wrong.
Questions
How do I check if RLS is on?
In the Supabase Table Editor the RLS badge should say enabled. In the SQL editor, select schemaname, tablename from pg_tables where schemaname is public and rowsecurity is false. That lists public tables where RLS is off. pg_tables.rowsecurity is the same flag as pg_class.relrowsecurity. ShipShape Scan does not run that query.
Does a grade A mean my Supabase data is safe?
No. A grade is a reading of the public page, scripts, headers, and a fixed list of files. It does not mean row level security is on, and it does not mean a policy is correct. The Launch Report opens that same pass. It does not query tables.
Does Supabase turn on RLS for every new table by itself?
Not unless you install the event trigger Supabase documents. The function is rls_auto_enable() and the event trigger is ensure_rls, on ddl_command_end, for CREATE TABLE, CREATE TABLE AS, and SELECT INTO, in the public schema only. It enables RLS. It creates no policies, it does not change existing tables, and it does not stop someone from disabling RLS later. Record it in a migration so every environment matches.
Does enabling RLS create policies?
No. Enabling RLS with no policy denies rows to anon and authenticated. A new table then returns no rows until a policy exists. service_role still bypasses RLS. You still write a policy for the rows a role should see.
Does the free check test row level security?
No. It does not query tables and it does not test row level security. A public anon key is not evidence that RLS is on or off. Paying for the Launch Report does not turn that on.