A zero-dependency Python CLI statically audits Supabase migrations and client code for missing RLS, unsafe policies, vulnerable SECURITY DEFINER functions, stale RPC calls and exposed secrets.
The Supabase RLS & Vibe-Code Security Auditor is a single-file Python CLI designed to detect silent security misconfigurations in Supabase projects before deployment. It reads SQL migrations in filename order and scans client source code, then reports findings with file-and-line locations and suggested fixes.
The auditor enforces five rules: it flags public tables without Row Level Security, policies using unrestricted true conditions without an authenticated scope, SECURITY DEFINER functions without a fixed search_path or explicit authentication guard, client RPC calls for functions removed by later migrations, and real service-role keys, VITE secrets or JWTs in client-accessible files.
The tool maintains a running schema state as migrations are applied. This lets it detect problems that arise later in a project’s history, such as a client continuing to call a function dropped in a cleanup migration. It can output Markdown or JSON and supports CI failure thresholds for high- and critical-severity findings.
The auditor performs local static analysis without a database connection, Docker or Node.js. It does not validate the full correctness of policy logic, parse complex dynamic SQL, or replace Supabase database-linting tools. Its repository examples include findings from a production multi-tenant workshop SaaS codebase, including dropped RPC calls, missing search paths and unrestricted policies.