Supabase "permission denied for table" (42501) in a Lovable or Bolt app? The Oct 30 change and how to fix it (2026)
Prices and facts checked on each tool's official site. Plans change often, so confirm before you pay.
You asked your AI builder for a new feature, like comments, bookings or a settings page. It looks fine, but nothing saves or loads, and the browser console shows permission denied for table with error code 42501. Your older features still work. If that sounds familiar, it's probably Supabase's platform change that reaches every existing project on October 30, 2026. Here's what changed in plain English, the safe fix, and when it's worth getting help.
Quick answer
Supabase no longer lets new tables in your database's public schema be reached by your app automatically. Each new table now needs a one-line permission called a GRANT. Ask your builder to add a migration that grants only what the table needs (usually select, insert, update, delete to the authenticated role), keeps row level security on, and adds a policy per action. Don't grant everything to everyone, and don't turn RLS off. If you're not sure which tables should be public, or the table holds user data or payments, have a person check it.
What Supabase changed, and when
Until now, every table created in the public schema was automatically readable and writable through Supabase's Data API (the auto-generated API that supabase-js calls, which is how Lovable and Bolt apps usually talk to the database) for the anon, authenticated and service_role roles. Supabase is turning that off so new tables aren't exposed before anyone has secured them. It rolled out in steps:
| Your Supabase project | When new tables need a GRANT |
|---|---|
| Created with "Automatically expose new tables" unchecked (possible from Apr 28, 2026) | Already |
| New project created after May 30, 2026 (gradual rollout over a few weeks) | Most likely already |
| Any older, existing project | From October 30, 2026 |
Tables you already have keep their access and keep working. It's the next table your builder creates that needs a GRANT. Supabase specifically calls out AI coding tools that create tables and expect them to be reachable right away. Apps that only connect over a direct Postgres connection (an ORM or server with a connection string) aren't affected.
How to tell this is your problem
- A new feature won't save or shows an empty list, while older features work.
- The browser console (
Cmd + Option + Jon Mac,Ctrl + Shift + Ion Windows) shows code42501andpermission denied for table your_table. Supabase's error includes a hint naming the exact GRANT that's missing. - If the error instead says
new row violates row-level security policy, the table has access but no matching policy. That's a different fix, covered in our Supabase RLS error guide.
The safe fix: grant, then RLS, then policies
Supabase says to treat three steps as one unit, because without the grant Postgres rejects the request before row level security is even checked:
- Grant each role only what it needs.
- Enable row level security on the table.
- Add policies so each user only sees and changes the right rows.
For a typical table where signed-in users manage their own rows, the SQL your builder should produce looks like this:
grant select, insert, update, delete on public.notes to authenticated;alter table public.notes enable row level security;create policy "users manage their own notes" on public.notes for all to authenticated using (auth.uid() = user_id) with check (auth.uid() = user_id);
Grant select to anon only for data that's truly meant to be public, like published posts. Server code that uses the service_role key also needs its own grant.
Free tool: make the exact GRANT + RLS SQL and a paste-in prompt for your table in 10 seconds.
What to paste into Lovable or Bolt
Copy this into the chat, changing the table name:
The notes table returns "permission denied for table" (error 42501). Supabase no longer grants access to new tables automatically. Add a migration that grants select, insert, update and delete on public.notes to the authenticated role only. Keep row level security enabled and make sure there are policies so each user can only read and change their own rows. Don't grant anything to anon, don't use grant all, and don't disable RLS. Show me the SQL before applying it.
For future features, ask it to always include grants, RLS and policies in the same migration whenever it creates a table. If you use Bolt with your own Supabase project, you can also run the SQL yourself in the Supabase SQL Editor, and Supabase's Security Advisor lists the affected tables with the SQL to fix them.
Shortcuts to avoid
- Granting every table to everyone (for example
grant ... on all tables in schema public to anon, authenticated, service_role) undoes the protection and can expose tables that were meant to be private. Supabase offers that bulk grant only as a rollback. - Turning RLS off to stop the errors makes your data readable and writable by anyone with access.
- Putting the service_role or secret key in the browser skips all of this, and Supabase says it must only live in server code. Check yours with our 3-minute exposed API key check.
When it's time to get help
Often this is one missing GRANT your builder adds in a minute. Get a second pair of eyes when:
- The AI keeps adding grants or policies and the error comes back.
- You're not sure which tables should be public and which should be private.
- The table holds personal data, orders or Stripe payments, where a wrong grant can leak data or lose sales.
- You're about to launch and want the whole app checked, not just one table.
| Option | Price | What you get |
|---|---|---|
| App Audit | $49 one-time | A plain-English written fix list, including which tables are missing grants or are exposed when they shouldn't be, within 3 business days |
| Payments Live | $199 one-time | Stripe payments wired into your app and tested with test cards before going live |
| Launch Pack | $499 one-time | Agreed bug fixes, Stripe payments, and your app published on your own domain with HTTPS |
We confirm the scope by email before any work starts, and you can ask questions first without paying. Never send anyone your password or your Supabase secret key.
Related guides
- Seeing
new row violates row-level security policyinstead? See the Supabase RLS error guide. - Launching a Lovable app? Run through the Lovable + Supabase launch checklist.
- Stuck in a fix loop? See Lovable app stuck in an error loop? or Bolt app stuck in an error loop?
Sources
- Supabase changelog: tables not exposed to Data and GraphQL API automatically (Apr 28, May 30 and Oct 30, 2026 dates, existing tables keep grants, 42501 hint, grant + RLS + policies as a unit, AI coding tools, Security Advisor, rollback bulk grant)
- Supabase: securing your API (grant only the privileges each role needs)
- Supabase: Database API 42501 errors (checking a table's grants, enable RLS after granting)
- Supabase: Row Level Security (secret key bypasses RLS)
FAQ
Why does my new Supabase table say "permission denied for table"?
From October 30, 2026, Supabase stops giving new tables in the public schema automatic access for the anon, authenticated and service_role roles. Until a GRANT is added, the Data API (what supabase-js uses) can't see the table, and you get error 42501 "permission denied for table".
Will my existing Lovable or Bolt app break on October 30?
Supabase says existing tables keep their current grants and stay reachable. The change hits the next new table your builder creates, so a new feature can fail while older features keep working.
Should I grant everything to everyone to make the error go away?
No. Grant only the roles and actions the table needs, usually select, insert, update and delete for authenticated (signed-in) users, and select for anon only if the data is meant to be public. Keep row level security on with policies; grants decide who can touch the table, RLS decides which rows.
When should I pay someone to fix this?
When your builder keeps failing to add the right grant, when you're unsure which tables should be public, or before you launch an app with user data or payments. StackMatch's App Audit is $49 for a written fix list, and fixes plus launch start at $199.
Some links are referral links; we may earn a commission at no extra cost to you. It never changes our recommendations.