new row violates row-level security policy (Supabase)
Your insert or update is blocked by RLS. Add a policy for that exact write, without turning RLS off.
The table has no GRANT for your role. Add the grant, keep RLS on, and add policies.

Grant the role the privilege it's missing, in a migration, and keep RLS on. The error's hint tells you which role and privilege it needs:
-- Signed-in users manage their own notes; signed-out visitors get nothing
grant select, insert, update, delete on table public.notes to authenticated;
alter table public.notes enable row level security;
-- ...plus one policy per operation (see our RLS guide)
Only grant to anon for data that's meant to be public.
Postgres checks grants before policies. Supabase's RLS guide says a missing grant "raises a 42501 error before any policy runs", so check grants before you change policies (Supabase: RLS). To see a table's grants (Supabase: 42501 errors):
select grantee, privilege_type
from information_schema.role_table_grants
where table_name = 'notes';
Why you may see it more from October 30, 2026: Supabase is applying a change to all existing projects. After it, new tables in public need an explicit grant before the Data API can reach them. Existing tables keep their grants (Supabase changelog). Our Oct 30 grants guide covers this in detail.
Not every 42501 is a missing grant. Supabase lists other causes, including restricted schemas, column-level restrictions and RLS blocking an insert or update (Supabase: 42501 errors). If the message says "new row violates row-level security policy", see our RLS error fix.
Don't disable RLS, don't grant everything to anon without policies, and don't move the secret or service_role key into the frontend (Supabase: API keys).
Did this error appear after a migration, a new table or an AI-generated change? Tell us. We're tracking which ones trip people up most.
This guide is educational and based on the vendor's public docs as of the review date. Platforms change: check the linked sources. Not a security audit. Disclaimer.
The BuiltSafely weekly
Platform changes that affect the security of AI-built apps, checked against official docs. Free. Unsubscribe any time.