Your app worked yesterday. You (or your AI tool) added a new table, and now every request to it fails with 42501. Nothing is broken. Supabase changed a default, and the fix takes one minute. But the fix the error suggests isn't always the one you want.
Supabase announced on April 28, 2026 that new tables in the public schema are no longer exposed to the Data API automatically. It became the default for new projects from May 30, and was applied to all existing projects on October 30, 2026.
Before, every new table was granted to anon, authenticated and service_role the moment it was created. Now a new table needs an explicit GRANT before supabase-js can reach it. Existing tables keep their grants. Apps that connect to Postgres directly (psql, an ORM, a server with a connection string) aren't affected.
The error looks like this:
{
"code": "42501",
"message": "permission denied for table your_table",
"hint": "Grant the required privileges to the current role with: GRANT SELECT ON public.your_table TO anon;"
}
The hint names the role that made the failing request. If your app called the table before anyone signed in, that role is anon: anyone on the internet holding your public key. A grant only decides whether a role can touch the table at all. Row-level security decides which rows it gets. So:
anon on a table with RLS off: the whole table is readable by anyone.anon with a using (true) policy: same result.grant ... on all tables in schema public to anon, authenticated. That re-opens every table, including the private ones you never meant to expose.Supabase's own guidance is to treat grant, RLS and policy as one unit. For a table that holds per-user data:
-- 1. Grant only the roles that need it (signed-in users, not anon)
grant select, insert, update, delete on public.your_table to authenticated;
-- 2. Turn on row-level security
alter table public.your_table enable row level security;
-- 3. Say which rows each user gets
create policy "owner can read" on public.your_table
for select to authenticated using (auth.uid() = user_id);
create policy "owner can write" on public.your_table
for insert to authenticated with check (auth.uid() = user_id);
Grant to anon only for genuinely public data (a product catalogue, published posts), and pair it with a select-only policy. Never grant insert, update or delete to anon unless you mean "anyone can write here".
A 42501 during sign-up is a different problem, and a grant to anon or authenticated won't fix it. Supabase Auth writes new users as its own role, supabase_auth_admin. If a trigger on auth.users copies each new user into your profiles table, that trigger runs as the Auth role and gets refused. Supabase's fix is to make the trigger function security definer, pin its search path, and write table names in full:
create or replace function public.handle_new_user()
returns trigger language plpgsql
security definer set search_path = ''
as $$
begin
insert into public.profiles (id) values (new.id);
return new;
end;
$$;
Check the Auth logs first: Supabase's troubleshooting page lists other causes too, like a missing table or an unmet constraint.
If the hint says TO authenticated, the user is signed in and only the grant is missing. Run step 1 for authenticated. If the request still fails, or returns no rows, the policy is the problem. See insert "works" but no row appears.
After the fix, open your live app in a private window, signed out, and confirm the new table's data doesn't load. Then run the second-user test: sign in as account B and try to read account A's rows. In the Table Editor, Supabase's Data API exposure badge and the Security Advisor also list tables worth reviewing.
The free Ship-Ready quick scan runs offline on your code and flags tables with RLS off and using (true) policies in your migrations, the two cases where an anon grant leaks data. The Crew (59-check scan, $39) adds more checks and a two-user test template.
Related: is my anon key a problem? · test your Supabase app as a second user · views that bypass RLS