LatchDog

← Guides

Supabase RLS checker: how to tell if a table is public

A Supabase RLS checker answers one question: can a signed-out visitor read a table with only the public anon or publishable key? The most direct check is a read-only request, using that key alone, for one row of a table in a project you own. How to send the request, and what each official response means, is below.

This page is a checker, not a policy-testing tutorial. To prove a policy allows and blocks the right rows as two signed-in users, or to automate that with pgTAP, use how to test Supabase RLS policies.

Check a table from the outside with the public key

Only test a project you own. Copy the project URL and the anon or publishable key from your API settings (or from the same names your site already ships). Do not use a secret key or a service_role key: that role bypasses Row Level Security, so every table would look open.

Send one read-only request for a single row. Replace the project host, the table name, and the key:

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

The Data API serves tables in exposed schemas (normally public) the same way your browser client does. Read the response as follows. These meanings come from current Postgres, PostgREST and Supabase docs (fetched Nov 21, 2026); they are not guesses.

A JSON array that contains a row

The anon role can read that table. Either Row Level Security is off and the role still has a grant, or a policy allows signed-out reads (for example a select policy that uses true). If the data is meant to stay private, that is the finding to fix. If the table is meant to be public, such as a published catalog, this result is expected. Leave those tables readable.

An empty JSON array

No row was visible to anon. Postgres: "If no policy exists for the table, a default-deny policy is used, meaning that no rows are visible or can be modified." (PostgreSQL: Row Security Policies.) After you have already enabled RLS, Supabase's tables guide says to add a policy that describes who can read the table: "Until one exists, Data API requests return no rows." Security Advisor lint 0008 is the same case: "Row-Level Security is enabled but no policies exist, so no data can be read or written through the API," and "no data will be selectable via Supabase APIs." (Supabase: Tables and data; Supabase: Advisors, read Nov 21, 2026.)

An empty table looks the same as a closed one, because there is no row to return. Confirm in the Table Editor that the table has rows before you treat an empty array as proof that anon is blocked.

HTTP 401 or 403, with Postgres code 42501

The role is missing a grant, so the request is denied before a policy runs. Supabase's PostgREST error map: code 42501 is "insufficient privileges", and the HTTP status is "if authenticated 403, else 401." A signed-out curl that sends only the public key, and no user access token, is not authenticated, so expect 401. A request that also carries a user token may return 403. (Supabase: PostgREST error codes, read Nov 21, 2026.)

Supabase's 42501 guide: these errors "imply the request lacked adequate privileges" and are "often reported by clients as 401 or 403 errors." For a missing table grant, the message is of the form "permission denied for table" followed by the table name. The tables guide: "a request that fails with permission denied for table points at a revoked grant rather than a missing policy." (Supabase: Database API 42501 errors; Supabase: Tables and data.)

HTTP 404, with PostgREST code PGRST205

The table name in the URL is not in the API's schema cache. Official description: "Caused when the table specified in the URI is not found." HTTP status 404. PostgREST's example message is "Could not find the table" plus the schema-qualified name "in the schema cache." That usually means the name is wrong, the table is not in an exposed schema, or the schema cache is stale after a recent change. It is not the same as a privilege error. (Supabase: PostgREST error codes and PostgREST: Errors, read Nov 21, 2026.)

List open tables and loose policies in SQL

The outside request proves what anon can see today. To see why, run these in the SQL editor on the same project. They only read catalog data.

Tables in an exposed schema with Row Level Security off, plus whether the API roles can still select. relrowsecurity on pg_class is the same flag as rowsecurity on pg_tables.

select
  n.nspname as schema_name,
  c.relname as table_name,
  c.relrowsecurity as rls_enabled,
  has_table_privilege('anon', c.oid, 'select') as anon_can_select,
  has_table_privilege('authenticated', c.oid, 'select') as authenticated_can_select
from pg_class c
join pg_namespace n on n.oid = c.relnamespace
where n.nspname in ('public') -- add every exposed schema
  and c.relkind in ('r', 'p')
  and not c.relrowsecurity
order by 1, 2;

Every row is a table with RLS off. If anon_can_select is true, a signed-out visitor with your public key can read it today. If it is false, a missing grant is blocking the API for now, but the table still has no RLS, so enable it anyway. Supabase's tables guide: "A table in the public schema is reachable through the Data API. Until you enable row level security and write a policy, anyone holding your project's publishable key can read and write every row in it." The RLS guide: "A table in an exposed schema without RLS is readable and writable by any role with a grant on it." (Supabase: Tables and data; Supabase: Row Level Security, read Nov 21, 2026.)

The same flag, from pg_tables:

select schemaname, tablename, rowsecurity
from pg_tables
where schemaname = 'public'
order by tablename;

Then list policies that name the public API roles, or that use a true or empty condition. Advisor lint 0024 also flags always-true patterns such as 1=1, which this query does not try to list in full.

select schemaname, tablename, policyname, cmd, roles, qual, with_check
from pg_policies
where schemaname = 'public'
  and (
    'anon' = any (roles)
    or 'public' = any (roles)
    or qual is null
    or qual = 'true'
    or with_check is null
    or with_check = 'true'
  )
order by tablename, cmd;

A select policy that uses true for anon is correct for data that is meant to be public. Do not revoke or tighten those as a blanket rule. For private tables, replace a true condition with an owner check such as the one in the fix prompt below. Related: rls_disabled_in_public and related Advisor errors and Supabase RLS for vibe-coded apps.

What Supabase Security Advisor already catches

Run Security Advisor in the Dashboard, or supabase db advisors. Supabase calls advisors "deterministic checks that ship with the platform" and notes that "Some findings may be intentional, so check them against your intended schema and access model before you change anything." (Supabase: Advisors, read Nov 21, 2026.) The lint names and levels on this table were verified in those docs today.

LintLevelWhat it flags
0013 rls disabled in publicERRORSummary: Table publicly accessible. "Anyone with your project URL can read, edit, and delete all data in this table because Row-Level Security is not enabled."
0007 policy exists, RLS disabledINFOSummary: Security policy not enforced. "A security policy exists but has no effect because Row-Level Security hasn't been turned on for the table."
0008 RLS enabled, no policyINFOSummary: No access rules defined. "Row-Level Security is enabled but no policies exist, so no data can be read or written through the API." This is the empty-array case above, and it can be intentional.
0024 permissive RLS policyWARNSummary: Security policy allows unrestricted access. "An RLS policy uses an always-true condition like USING (true), which defeats the purpose of having Row-Level Security enabled." The lint also looks for tautologies and some missing conditions. A true policy on a public catalog can be intentional.

Official lint identifiers, as listed in the Advisors docs today:

0013_rls_disabled_in_public
0007_policy_exists_rls_disabled
0008_rls_enabled_no_policy
0024_permissive_rls_policy

Advisor looks at configuration from inside the project. It does not send the outside request in the first section, and it does not prove whether one signed-in user can read another user's rows. For views that skip RLS, definer functions, Storage, or role columns, see Supabase views bypass RLS, SECURITY DEFINER functions, are my Supabase Storage files public?, and can a user make themselves admin?. A side-by-side of Advisor and an outside scan is in LatchDog vs Supabase Security Advisor.

What LatchDog checks (and what it does not)

LatchDog keeps watching your live app after launch. Starter ($19/month, up to 3 apps) and Pro ($39/month, up to 10 apps) re-scan it automatically every day and after every deploy (triggered by a deploy hook from your host or CI), and email you only when something changes. Nothing to install: you verify your domain once.

The public anon or publishable key is meant to be in the browser; the danger is what that key can read. See is the Supabase anon key safe to expose?. For a routine after each deploy, see how to monitor leaked keys and open RLS.

Other public checkers

A search today for this query also finds standalone tools. Two that name this job, described only from their own pages:

RLS Radar says you paste an application URL you own. It reads public HTML and JavaScript for leaked secret keys, exposed env and git files, and missing security headers. If it finds a Supabase config, it runs read-only requests: table names from the API schema plus count requests that ask for zero rows. It says it returns status codes and counts, not row contents, stores no scan results, and is free.

GetVouch says it finds the project URL and anon key in the page and linked JavaScript, queries the OpenAPI endpoint for table names, then sends an unauthenticated SELECT with a three-row limit to the tables it found. It says no row data is logged, and findings show column names. If the key lives in a dynamically imported chunk, it says it marks the result inconclusive.

Use any of them only on a project you are allowed to test. They do not replace the official SQL and Advisor checks above, or a signed-in policy test.

Paste-in fix prompt for Lovable, Bolt or Cursor

Please check whether any Supabase table in an exposed schema is readable
with the public anon or publishable key, and fix only the ones that should
be private. Do not use a secret or service_role key in client code.

1. List every table in each exposed schema. For each one, say whether RLS
   is on (relrowsecurity / rowsecurity) and whether anon or authenticated
   can SELECT it.
2. List policies that name anon or public, or that use a true / empty
   condition. Keep policies that are meant to make public data readable.
3. For private tables: enable RLS if it is off, revoke grants the role
   does not need, and add per-operation policies. Name the role with
   to authenticated. Use (select auth.uid()) in the expression, for
   example:
   create policy "owner can read" on public.orders
     for select to authenticated
     using ( (select auth.uid()) = user_id );
4. Do not disable RLS, do not grant all privileges to anon, and do not
   put a service_role or sb_secret_ key in client code to make anything
   work.
Show me the SQL migration first and explain which role can read what
afterwards. Do not apply it until I approve.

Review what the AI changes, re-run the list query, and repeat the outside request with your public key.

Check yours

Start with the curl and the SQL on this page, then open Security Advisor. After you publish, the free LatchDog check can look for a leaked secret key in your JavaScript; the deep scan, after you verify the domain, can tell you whether named tables or views return a row to the public key.

Sources

Keep watching your app, not just checking it once

LatchDog keeps watching your live app after launch. Starter ($19/month, up to 3 apps) and Pro ($39/month, up to 10 apps) re-scan it automatically every day and after every deploy (triggered by a deploy hook from your host or CI), and email you only when something changes. Nothing to install: you verify your domain once.

Start with the free check (headers, HTTPS, leaked keys in your JavaScript, source maps, .env/.git). Open-table checks run after you verify your domain. See plans

Free, read-only public check: no sign-up, no card. Headers, HTTPS, leaked keys in your JavaScript (always masked), public source maps and exposed .env/.git files. Supabase table checks run after you verify you own the domain.

Want the open-table check too? Get my free deep scan: sign in with your email (no password) and verify you own the domain. Your first deep scan is free and adds CORS, more of your JavaScript and, if your app uses Supabase, whether anyone can read its tables and views with your public key.