App Security Preflight: Supabase RLS, Webhooks, Keys

    by Ala Ud Din Burki

    1

    The security review an AI coding agent skipped.

    $5.99

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    What it does

    • Finds Supabase tables with no row-level security
    • Flags RLS policies that miss insert, update or delete
    • Catches keys committed to source, shown truncated
    • Spots service-role keys inside client components
    • Finds webhooks that never verify the signature
    • Flags write routes with no identity check

    Who it's for

    Founders using AI tools like Lovable or v0

    Check if your AI-generated code accidentally left your user data open to the public.

    Try asking: “Check my new Lovable app for security leaks before I launch.”

    Freelance web developers building with Next.js and Supabase

    Make sure you didn't leave debug mode on or commit a private API key before handing over the project.

    Try asking: “Scan my client project for hardcoded keys or missing database security.”

    Small shop owners with custom webhooks

    Verify that your payment notifications from Stripe or Shopify are actually coming from them.

    Try asking: “Check my Shopify webhook code to see if the signature is being verified.”

    App Security Preflight: Supabase RLS, Webhooks, Keys

    Example session with this skill installed

    Before I launch, check my Next.js + Supabase app for the security mistakes AI coding agents usually make.

    • Read your context and instructions
    • Compiled the app security preflight

    Sample output (real runs, 2026-12-02)

    A deliberately broken demo app (made by node scripts/make-demo.mjs, all keys fake)

    $ node scripts/make-demo.mjs && node scripts/preflight.mjs preflight-demo-app
    ────────────────────────────────────────────────────────────────────────
      App Security Preflight: preflight-demo-app
    ────────────────────────────────────────────────────────────────────────
      6/6 files read · 13 rules · verdict: findings
      🔴 4 critical · 🟠 3 high · 🟡 0 medium · ⚪ 0 low
    
      🔴 CRITICAL Webhook endpoint that accepts a body without checking its signature
         app/api/webhooks/stripe/route.ts:1
         > export async function POST(request: Request) {
         why: Anyone who can find the URL can POST to it.
         check: Confirm the signature is not checked in shared middleware or a wrapper this file cannot see, and that the check follows the provider's own construction (Stripe, GitHub and Shopify each differ).
    
      🔴 CRITICAL Privileged key read inside client-side code
         app/components/Admin.tsx:3
         > const supabase = createClient(process.env.NEXT_PUBLIC_SUPABASE_URL!, process.env.SUPABASE_SERVICE_ROLE_KEY!);
         why: Client code is delivered to the browser and the value is compiled into it.
         check: Confirm the file really ships to the browser — a `use client` marker at the top of a Next.js server component is a mistake too — and that the name is not a public publishable key.
    
      🔴 CRITICAL Credential written into source
         app/config.ts:1
         > export const mailer = { api_key: "Zx8***" };
         why: A key committed to a repository is published to everyone who can read it, and to every clone, fork and CI log that ever existed.
         check: Check whether the value is a live credential and, if so, revoke and re-issue it — removing the line does not un-leak it.
    
      🔴 CRITICAL Table created with no row-level security
         supabase/migrations/001_init.sql:1  (table todos)
         > create table todos (id uuid primary key, owner uuid, title text);
         why: With row-level security off, anyone holding the app's public database key can read and write every row — the app's own users are not the boundary.
         check: Confirm whether this migration is the live schema, and whether access is instead gated by a proxy, a server-only key or a view.
    
      🟠 HIGH     Write endpoint with no identity check in the file
         app/api/todos/route.ts:4
         > await db.from("todos").delete().eq("id", id);
         why: The pattern an agent reaches for when it wants the client to work: take the payload, write it, return the result.
         check: Check the framework's middleware, route guards and any auth wrapper around this handler.
    
      🟠 HIGH     Untrusted value passed to the DOM as HTML
         app/components/Admin.tsx:5
         > return <div dangerouslySetInnerHTML={{ __html: bio }} />;
         why: Handing a string to the parser as markup turns whatever it contains into script that runs with the page's own privileges, including its session.
         check: Find where the value originates and whether anything sanitises it on the way (DOMPurify, a server-side allowlist, a markdown renderer with HTML disabled).
    
      🟠 HIGH     Row-level security on, but no policy covers every operation
         supabase/migrations/001_init.sql:3  (table invoices, missing: insert, update, delete)
         > alter table invoices enable row level security;
         why: Enabling RLS with no policy blocks writes entirely, and enabling it with a read policy only leaves the other three operations closed — both are failures, in opposite directions.
         check: Confirm the intended policy for each missing operation, and read the `using`/`with check` expressions of the policies that do exist: a policy that says `using (true)` is open to every authenticated user, whatever it is named.
    
      Patterns in source, not proven exploits: each finding says what a human must confirm. Nothing was run.
    

    A real public starter: Vercel's Next.js + Supabase subscription template (high and above)

    $ node scripts/preflight.mjs --repo vercel/nextjs-subscription-payments --min-severity high
    ────────────────────────────────────────────────────────────────────────
      App Security Preflight: vercel/nextjs-subscription-payments
    ────────────────────────────────────────────────────────────────────────
      78/90 files read · 13 rules · verdict: findings
      🔴 0 critical · 🟠 10 high · 🟡 0 medium · ⚪ 0 low
    
      🟠 HIGH     Row-level security on, but no policy covers every operation
         schema.sql:15  (table users, missing: insert, delete)
         > alter table users enable row level security;
         why: Enabling RLS with no policy blocks writes entirely, and enabling it with a read policy only leaves the other three operations closed — both are failures, in opposite directions.
         check: Confirm the intended policy for each missing operation, and read the `using`/`with check` expressions of the policies that do exist: a policy that says `using (true)` is open to every authenticated user, whatever it is named.
    
      🟠 HIGH     Row-level security on, but no policy covers every operation
         schema.sql:44  (table customers, missing: select, insert, update, delete)
         > alter table customers enable row level security;
         why: Enabling RLS with no policy blocks writes entirely, and enabling it with a read policy only leaves the other three operations closed — both are failures, in opposite directions.
         check: Confirm the intended policy for each missing operation, and read the `using`/`with check` expressions of the policies that do exist: a policy that says `using (true)` is open to every authenticated user, whatever it is named.
    
      🟠 HIGH     Row-level security on, but no policy covers every operation
         schema.sql:65  (table products, missing: insert, update, delete)
         > alter table products enable row level security;
         why: Enabling RLS with no policy blocks writes entirely, and enabling it with a read policy only leaves the other three operations closed — both are failures, in opposite directions.
         check: Confirm the intended policy for each missing operation, and read the `using`/`with check` expressions of the policies that do exist: a policy that says `using (true)` is open to every authenticated user, whatever it is named.
    
      🟠 HIGH     Row-level security on, but no policy covers every operation
         schema.sql:98  (table prices, missing: insert, update, delete)
         > alter table prices enable row level security;
         why: Enabling RLS with no policy blocks writes entirely, and enabling it with a read policy only leaves the other three operations closed — both are failures, in opposite directions.
         check: Confirm the intended policy for each missing operation, and read the `using`/`with check` expressions of the policies that do exist: a policy that says `using (true)` is open to every authenticated user, whatever it is named.
    
      … (10 high findings in total; most are RLS policy gaps on tables the template writes only from the server. The "check" line says what to confirm.)
    

    Connects securely to your tools. The creator never sees your data.

    About this skill

    The security review an AI coding agent skipped. Point it at a Next.js / Supabase / Node app and get the file and line of each mistake agents make most: tables without row-level security, half-written RLS policies, keys in source, privileged keys shipped to the browser, unverified webhooks, write routes with no auth. An agent skill for Claude Code, Codex, Cursor and any agent that reads SKILL.md; also a plain CLI.

    Ported from a production data tool; 130 test checks (npm test).

    What's inside

    FilePurpose
    SKILL.mdwhen to use it, how to read the findings
    scripts/preflight.mjsthe command (local folder or public GitHub repo)
    scripts/lib/the 13 rules, file selection, coverage report, GitHub fetch
    scripts/make-demo.mjswrites a small deliberately broken app (fake keys) to try it on
    examples/sample-output.mdreal runs on the demo app and on a public Vercel starter

    Requirements

    Node 18+. No packages, no accounts. Optional GITHUB_TOKEN for scanning large public repos.

    Honest limits

    Pattern matching over source text: a finding can be handled somewhere this file cannot see (middleware, a wrapper, a database policy created in the dashboard). Every finding says what to confirm. It does not run the app, scan dependencies (use ship-check for that) or replace a penetration test.

    This skill only scans text patterns in code files. It cannot guarantee an app is 100% safe or find bugs that require running the app to see.

    Node 18+ script, no npm dependencies. 13 rules over source text; scans a local folder or a public GitHub repo. Never runs the app or connects to a database. 130 test checks included.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 2 days ago

    Software
    Node.js 18+

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Network Access
    Environment Variables
    Listed2 days ago
    Updatedtoday

    What's inside

    Frequently Asked Questions

    This skill searches your code for specific patterns that lead to data leaks, such as missing database security rules, private keys accidentally left in visible files, and webhooks that do not verify who is sending them. It helps catch common mistakes made when building apps quickly with AI tools.

    You only need to provide the folder where your app is stored or a link to a public GitHub repository. The skill is designed to work with apps built using technologies like Next.js, Supabase, and Node.

    Your AI agent will give you a list of findings that includes the exact file and line number where a risk was found. You also get a explanation of why it is a risk and a step-by-step check to help you confirm and fix the issue.

    This skill only reads your code files to look for risky patterns and does not actually run your app or touch your live database. Because it only looks at the code provided, it might not see security checks that happen in files it cannot access.

    You can simply ask your AI agent to check if an app you built is secure or tell it to perform a pre-launch security review on a specific folder or repository link.

    If the skill finds a secret key in your code, it will show you a shortened version of it so you can identify which one it is. It will then advise you to cancel that key and get a new one, as just deleting the line of code does not stop the key from being leaked.

    New in Security

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Security.