PatchPaste · Guides

Last updated 22 November 2026

Supabase "Access to schema is forbidden": hidden isn't locked

If you open https://[projectref].supabase.co/rest/v1/ with your anon key and get Access to schema is forbidden, that is Supabase working as intended. Since 2026 the anon key can no longer download the list of your tables and columns. It is a welcome default, but it hides your table names, not your data.

Short answer: nothing is broken, and your app's normal queries still work. But a table without Row Level Security is still readable by anyone with your anon key who knows or guesses its name, such as profiles, users or orders. Turn RLS on for every exposed table and test each one as a logged-out stranger.

What Supabase changed

Supabase's changelog explains that the Data API used to return the full OpenAPI spec for any exposed schema at the root path to anyone with the anon key. They removed that because it gave away "more information about your schema than most production applications need". Requests with the anon key now get:

{"message":"Access to schema is forbidden","hint":"Accessing the schema via the Data API is only allowed using a secret API key."}

The timeline Supabase published:

The service_role key and the new secret API keys can still read it. Supabase called this "the first in a series of changes" to tighten default security.

Why hidden isn't locked

The spec was a map. Removing the map doesn't lock any doors. Supabase's changelog is clear that requests to /rest/v1/your_table "will continue to work exactly as they do today". Whether that request returns rows is decided only by your table grants and Row Level Security policies.

Table names are rarely secret anyway:

So if a table has RLS off, or a policy like using (true), hiding the list only slows a stranger down.

1. List your exposed tables yourself

Run this in the Supabase SQL editor to see every table in public and whether RLS is on:

select c.relname as table_name,
       c.relrowsecurity as rls_enabled
from pg_class c
join pg_namespace n on n.oid = c.relnamespace
where n.nspname = 'public'
  and c.relkind in ('r', 'p')
order by rls_enabled, table_name;

Any row with rls_enabled = false is open to the anon key unless you have revoked its grants. Fix those first; see RLS Disabled in Public.

2. Test each table as a stranger

From a terminal, with only your public anon (or publishable) key, the same key your site already ships:

curl "https://YOUR-PROJECT.supabase.co/rest/v1/profiles?select=*&limit=1"   -H "apikey: YOUR_ANON_KEY"

Good: [] or a permission error. Bad: a real row. Repeat for every table from step 1. An empty array can also mean the table is simply empty, so test tables that have data. Only test projects you own.

3. Review policies that let everyone in

RLS switched on with a using (true) select policy for anon is the same as RLS off for reading. Check RLS using (true) for when that is fine (truly public content) and when it isn't (anything with emails, orders or messages).

If your app really needed the spec

Supabase's advice is to move the call server-side, for example into an Edge Function, and use the service_role key or a new secret API key there. Never put either in browser code; see exposed service_role key and Edge Function secrets.

A prompt to paste into Lovable

Supabase now returns "Access to schema is forbidden" for the OpenAPI spec with the anon key, which hides table names but does not protect data. Audit my database without disabling anything that works and without using the service_role key in the client. 1) List every table in the public schema and whether Row Level Security is enabled. 2) Enable RLS on any table where it is off. 3) For each table, list its policies and flag any select policy for anon or public that uses (true) on a table holding personal data, orders, messages or payments. 4) Propose owner-only policies using (select auth.uid()) for those tables. 5) Give me a curl command per table, using only the anon key, that I can run to confirm a logged-out visitor gets no rows.

Related: Is the Supabase anon key safe to expose?, Supabase RLS check, Lovable apps exposing data and Is my Lovable app secure?

Supabase "Access to schema is forbidden" FAQ

What does "Access to schema is forbidden" mean in Supabase?

It is the error the Data API returns when you request the OpenAPI spec at https://[projectref].supabase.co/rest/v1/ with the anon key. Supabase's changelog gives the full message: "Access to schema is forbidden", with the hint "Accessing the schema via the Data API is only allowed using a secret API key."

When did Supabase make this change?

Supabase's changelog set the timeline: published 17 February 2026, newly created projects blocked from 11 March 2026, and all existing projects from 8 April 2026. The changelog said dates might be pushed back but not forward.

Does this break my app?

Almost certainly not. Supabase says normal Data API usage, such as /rest/v1/your_table or any client library, keeps working exactly as before. You are only affected if your app fetches the Swagger/OpenAPI spec with the anon key. Supabase put that at less than 0.1% of projects in the 24 hours before the announcement.

Does hiding the table list make my Supabase tables private?

No. Supabase's own changelog says the spec never exposed row data, only table, column and type names. A table with Row Level Security off, or with a policy like using (true), can still be read by anyone who has your anon key and guesses or finds the table name, for example in your shipped JavaScript.

How do I fetch the schema now if I need it?

Supabase says to move that call server-side, such as into an Edge Function, and use the service_role key or one of the new secret API keys. Never put either in browser code. Supabase also added a Management API endpoint for the CLI and third-party tools that needs only read-only project database access.

Can PatchPaste check this?

Partly. PatchPaste's free scan works from outside like any visitor. It finds the Supabase URL and public key your site ships, then checks whether common table names answer without a login (read-only, at most one row, discarded). It cannot sign in, read your policies or see tables with unusual names, so also use Security Advisor and the curl test on this page.

Check your live app from outside, free

Paste your live URL for a free A to F report. PatchPaste checks whether common Supabase tables answer to your public anon key without a login (read-only, at most one row, discarded), searches the JavaScript your site sends for secret keys, and flags exposed .env/.git/source maps and missing headers. It does not sign in or read your policies. Fix prompts for that report are a one-off £9 (or £29 for 10). Scans are free to rerun after each change.

Free. No login. No code access.

Want to see one first? View a sample report.

Sources (checked 22 Nov 2026): Supabase changelog Breaking Change: Removing access to OpenAPI spec via the anon key (the error message, what changed and why, the less-than-0.1% figure, the rollout timeline, normal Data API usage unaffected, the 23 March 2026 Management API update); Supabase Row Level Security. Screen wording varies between Supabase Studio and Lovable.