On this page
- Check this in your repo
- How to read the result
- The query for the live database
- How to read the result
- A missing table grant can still leave columns readable
- The same facts in your migrations
- Signed in is not the same as trusted
- Close the open tables
- Related guides
- Official docs behind this checklist
- FAQ for builders before launch
Supabase question
Which of my Supabase tables can anyone read with the anon key?
Start by listing each public table with its row level security state, read privileges including column grants, and policies for anon or public. No table-level SELECT grant does not prove that no columns can be read: a column grant can permit a narrower SELECT, while RLS still limits which rows it returns.
npx -y viberaven@1.8.0 checkIt reads supabase/migrations and reports a public table with no enable row level security as rls_disabled, a table granted to anon or authenticated with row level security off as data_api_grant_without_rls, and a select policy with using (true) as rls_policy_allows_all_read.
Or ask your coding agent to "run npx -y viberaven@1.8.0 check and fix what it reports".
Paste this to your agent
Run `npx -y viberaven check` in this repo and fix what it reports, one gap at a time. Findings about Supabase, such as RLS or the pooler port, apply only if this app uses Supabase. Do not add Supabase or any other provider this app does not already use. Also check that no table in my migrations can be read by anyone with the anon key. Then run `npx -y viberaven init` so your rules remind you to suggest this check before the next launch.The check runs locally, with no sign-in and no API key. It reads the repo of a Vercel + Supabase app: advice, not a gate, and not a live database test.
Check this in your repo
Find open tables in your migrations
For AI-built Vercel + Supabase apps, run the command below from your app folder with Node.js 20 or newer. It reads the SQL in supabase/migrations and reports a public table that no migration enables row level security on as rls_disabled, a table that a migration grants to anon or authenticated while row level security is off as data_api_grant_without_rls, and a policy whose condition is a bare true for reading as rls_policy_allows_all_read.
It is a repository check, not a live database test: it cannot see changes made in the dashboard or policies that never reached a migration, so run the SQL query below on the live project too. It is advice, not a gate, and it exits with code 1 when it finds a blocker.
npx -y viberaven@1.8.0 checkWhat it printed on a fixture repo
Historical CLI 1.6.12 capture. The current command above uses 1.7.8; its output can differ.
On 2026-10-28 we ran VibeRaven 1.6.12 on a small fixture repo made for this page, not a customer repo, with one migration: public.profiles with no row level security and a grant to anon and authenticated, public.posts with a using (true) read policy for anon, and public.notes with an owner-only policy. The same SQL, run on Postgres 17, gave the query result shown further down. The output is below, with the folder shortened to ~/app. Two findings are blockers, so the exit code was 1.
$ npx -y viberaven@1.6.12 check
viberaven check · ~/app
🔴 No RLS policy proof in migrations (rls_disabled)
1 public table without row level security: public.profiles (supabase/migrations/20261001000000_init.sql:1). The Data API does not enforce row restrictions for roles and operations allowed by the table's grants. Verify those grants to determine who can read or change rows.
🔴 Table granted to the Data API with RLS off (data_api_grant_without_rls)
public.profiles is granted to anon and authenticated (supabase/migrations/20261001000000_init.sql:2) but row level security is off. A grant without RLS is the dangerous combination: the Data API serves every row to that role. Enable RLS and add policies before granting. Fix: alter table public.profiles enable row level security;
🟡 A policy lets anyone read every row (rls_policy_allows_all_read)
Policy "anyone can read posts" on public.posts (supabase/migrations/20261001000000_init.sql:6) lets anyone, signed in or not, read every row: using (true). Fine for truly public content; wrong for anything per-user.
Verdict: ❌ 2 blockers, 1 warning · score 50
Fix: viberaven fix · Details: ~/app/.viberaven/agent-tasklist.mdHow to read the result
Treat the query below as a review list, then test the columns your app requests as anon on your project. Repository migrations show intended grants and policies, not proof of the deployed state.
The query for the live database
Run it in the Supabase SQL editor. It lists public tables, their RLS state, whether anon has SELECT on the table or at least one column, and policies directly assigned to anon or public. A true privilege flag does not mean all columns or rows are readable, and this is not a complete audit of inherited roles, restrictive policies, views, functions or API exposure settings. Test the exact request too.
select c.relname as table_name,
c.relrowsecurity as rls_enabled,
has_any_column_privilege('anon', c.oid, 'select') as anon_can_select,
coalesce(string_agg(p.policyname || ': using (' || coalesce(p.qual, '') || ')', '; '), '') as anon_select_policies
from pg_class c
join pg_namespace n on n.oid = c.relnamespace
left join pg_policies p on p.schemaname = n.nspname and p.tablename = c.relname
and p.cmd in ('SELECT', 'ALL') and p.roles && array['anon', 'public']::name[]
where n.nspname = 'public' and c.relkind in ('r', 'p')
group by c.relname, c.relrowsecurity, c.oid
order by anon_can_select desc, rls_enabled, table_name;How to read the result
anon_can_select now means anon holds SELECT on the table or at least one column. With RLS off, the role can read the granted columns of every row if schema and API access allow the request. With RLS on, policies still decide which rows are visible; a permissive using (true) policy can be narrowed by restrictive policies. A false flag means no effective SELECT privilege on any column through this direct table path, not that views or functions cannot expose data. Test the exact selected columns and role before changing permissions. The output below is the original October 28 fixture result from the earlier table-grant query; that fixture had no column-only grants. Its historical output is preserved.
table_name | rls_enabled | anon_can_select | anon_select_policies
---------------+-------------+-----------------+-------------------------------------
profiles | f | t |
notes | t | t |
posts | t | t | anyone can read posts: using (true)
private_stuff | f | f |A missing table grant can still leave columns readable
On October 30, 2026, a disposable PostgreSQL 17.11 fixture had RLS enabled and granted SELECT only on id and body to a non-owner role without BYPASSRLS. has_table_privilege returned false, has_any_column_privilege returned true, and selecting id and body returned its one permitted row. SELECT * failed with 42501; after revoking the column grant, selecting body failed with 42501 too. This was a local SQL test, not a Supabase REST request or a production-project audit.
Use has_column_privilege when you need to inspect a specific column. Keep the grant check and the row-policy test separate. A column grant does not bypass RLS, and neither a repository check nor this census proves the entire application is secure.
select has_table_privilege('anon', 'public.your_table', 'select') as table_select,
has_any_column_privilege('anon', 'public.your_table', 'select') as any_column_select;The same facts in your migrations
Search the migrations for the three statements. A create table with no enable row level security after it, or a policy with using (true) on a table that holds per-user data, is the line to fix.
grep -rniF -e "enable row level security" -e "create policy" -e "using (true)" -e "to anon" supabase/migrationsSigned in is not the same as trusted
If sign-ups are open, a read policy for authenticated with using (true) lets anyone who creates an account read every row. Whether a new table gets the anon grant on its own depends on the project's Data API setting; see the October 30 Data API change.
Close the open tables
- 1Find open tables in your migrations. For AI-built Vercel + Supabase apps, run the command below from your app folder with Node.js 20 or newer. It reads the SQL in supabase/migrations and reports a public table that no migration enables row level security on as rls_disabled, a table that a migration grants to anon or authenticated while row level security is off as data_api_grant_without_rls, and a policy whose condition is a bare true for reading as rls_policy_allows_all_read. It is a repository check, not a live database test: it cannot see changes made in the dashboard or policies that never reached a migration, so run the SQL query below on the live project too.
Terminal npx -y viberaven@1.8.0 check - 2Run the query above on the production project and list every table anon can read.
- 3For each one, decide whether the rows are meant to be public.
- 4For a table that is not public, turn on row level security and add a policy that matches each row to its owner, in a new migration:
SQL alter table public.profiles enable row level security; create policy "read own profile" on public.profiles for select to authenticated using ((select auth.uid()) = id); - 5Replace using (true) on per-user tables with a condition on auth.uid().
- 6Run the query again and test with the anon key: an open table should now return no rows.
Related guides
Official docs behind this checklist
Browse all launch guides · Read resources · How to make and check your next change
FAQ for builders before launch
Does a view count?
Yes. A view in the public schema runs with its owner's rights by default, so it can return rows the table's policies would hide. Add views to the query with relkind 'v', or see the security_definer_view page.
Is a table with RLS on and no policies open?
No. Row level security with no policy returns no rows to anon and authenticated; only the service role can read it.