Check the Supabase RPC your AI builder generated to make the error disappear.

Paste redacted Lovable, Bolt, Replit, Cursor, or v0-generated Supabase SQL and check for the privilege patterns that often hide behind a green launch: SECURITY DEFINER RPCs, auth.role() = 'authenticated' policy drift, public views that lost security_invoker = true, and Security Advisor search_path tradeoffs.

AI-generated SQL triage

  • 1
    Find quick-fix RPCsFlag security definer, exposed schemas, missing search_path, and comments showing the function was generated to bypass a permission failure.
  • 2
    Check caller reachabilityLook for broad grant execute / grant select access to anon, authenticated, or all public users.
  • 3
    Keep auth separate from authorizationFlag auth.role() = 'authenticated' when the policy still needs ownership, team, tenant, or admin checks.
Use redacted text only. Do not paste secrets, private connection strings, real user data, customer records, payment data, private screenshots, full names, private handles, full transaction identifiers, credential values, or service-role keys. This page runs locally in the browser and does not use network requests, browser storage, or a backend.

Ready.

AI SQL findings

Acceptance checks before launch

CI guard

For generated migration output, fail the build when a high-risk definer RPC or public view drift appears in redacted SQL.

npx --package github:kayalopez/ai-agent-launch-tools#v0.1.29 supabase-rpc-audit --file supabase_migration.redacted.sql --fail-on high

For Security Advisor Function Search Path Mutable packets, the report also calls out SQL-function inlining/performance review when a stable set-returning SQL function has SET search_path.

The command exits 2 after printing the report when a high-severity finding is present. Keep migration SQL redacted before sharing logs publicly.

Need a second pass?

The fixed-scope report can review one redacted generated-app Supabase SQL/RPC/view packet: likely RLS-bypass path, exposed function or view risk, auth.role() policy drift, grants to tighten, and concrete anon/authenticated regression checks. The sample report is fictional and shows the shape before checkout.

Source-backed problem set