Private, server-only table
No access from the browser. Your server reads and writes.
-- public.your_table: private
alter table public.your_table enable row level security;
revoke all on table public.your_table from anon, authenticated;
grant select, insert, update, delete on table public.your_table to service_role;
-- no policies: with RLS on and no policy, anon and authenticated read nothing.
-- service_role bypasses RLS. Keep its key on your server only.
How it stays private
anonandauthenticatedhave no grant, so the Data API answers 42501 to any browser request.- RLS is on with no policy, a second barrier if a grant is added by mistake later.
service_rolehas the table privileges and bypasses RLS. It is used with the secret key, which must stay on the server.
Fits: audit logs, payment records, internal queues, anything written by a webhook or an edge function.
One detail from Supabase's RLS guide: a secret key bypasses RLS only when the request carries no user access token. If it carries one, the request runs under that user's policies.
Write the fix for your tables
One table is free. The whole schema with a rollback file is $9 one-time, free during launch.
Waiting for a paste.
Who can reach each table
Your tables show up here, one row each, with a choice of who can reach them.
Parsed in your browser. Your SQL is never uploaded, and no site or database is scanned.
Questions
My app still shows 42501 for this table.
Then the browser is calling it directly. That is the table doing its job. Move the call to server-side code, or choose a different access level.
Sources
- Supabase docs: Row Level Security, read 2026-11-10
- Supabase docs: Postgres Roles, read 2026-11-10
- Supabase docs: Securing your API, read 2026-11-10
Related
- New Supabase table not showing in the APITwo checks tell you if the grant is missing. Then fix it below.
- Grants vs row level securityTwo checks run on every request. A grant comes first.
- permission denied for sequenceThe table is granted and its id counter is not. One more grant fixes it.
- Check the grants on a tableOne query lists every role and privilege on a table.