More screenshots

    Works with the AI Agents you already use

    AI App Security Check: Supabase RLS & Leaked Keys

    by Mike Dufour

    1

    This skill makes your agent check for all of them before you launch, the way a security reviewer would: 1.

    Free

    Security scanned

    What it does

    • Finds API keys, tokens and the Supabase service-role key in client code, shipped .env files, prompts and logs
    • Checks every Supabase table and policy for missing RLS, using (true) and write grants to anon
    • Flags open CORS, XSS sinks, string-built SQL, debug routes and client-only admin checks
    • Reviews AI agent, MCP and n8n tools for prompt injection and dangerous actions
    • Writes a P1 to P3 report with copy-paste SQL and code fixes
    • Re-tests after your fixes and reports fixed, still open and new

    Who it's for

    Founders building with AI app builders

    Make sure your app is safe before you share the link with the world.

    Try asking: “Check my Lovable app for any leaked API keys or open database tables before I launch.”

    Developers using AI agents and MCP servers

    Find dangerous tools or prompt holes that could let someone control your agent.

    Try asking: “Review my agent's tools and system prompt for security risks.”

    Small shop owners using Supabase or Bolt

    Verify that only your customers can see their own data.

    Try asking: “Audit my Supabase RLS policies to make sure my customer data is private.”

    AI App Security Check: Supabase RLS & Leaked Keys

    AI App Security Check: Supabase RLS & Leaked Keys

    Example session with this skill installed

    I'm launching my Lovable app with Supabase next week. Check the project for leaked keys, missing row-level security and anything else that could get us hacked, then tell me exactly what to fix.

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

    Summary

    Static review of the sample app 1-voor-herstel (5 files: dist bundle, server/api.js, supabase/migrations, prompts, .env). Network: none.

    12 findings: 5 P1, 4 P2, 3 P3. All start as needs_validation; secrets are redacted to type + fingerprint.

    Findings

    IDPriorityStatusFindingLocation
    F001P1needs_validationSupabase service-role JWT in bundle.env:2
    F002P1needs_validationSupabase service-role JWT in bundledist/assets/index-8c1f.js:1
    F006P1needs_validationSecret in a prompt template or logprompts/support.txt:2
    F009P1needs_validationSQL built from interpolated stringsserver/api.js:3
    F012P1needs_validationTable created without row-level securitysupabase/migrations/001_init.sql:1
    F004P2needs_validationRaw HTML injection sinkdist/assets/index-8c1f.js:3
    F007P2needs_validationPermissive CORSserver/api.js:1
    F008P2needs_validationDebug route or debug modeserver/api.js:2
    F010P2needs_validationSensitive value written to logsserver/api.js:5
    F003P3needs_validationAdmin or internal routedist/assets/index-8c1f.js:5
    F005P3needs_validationRole check in client codedist/assets/index-8c1f.js:4
    F011P3needs_validationPublic read policysupabase/migrations/001_init.sql:4

    Evidence (secrets redacted)

    • F002 dist/assets/index-8c1f.js:1 → const SERVICE_KEY = "[REDACTED:jwt:cddfa8f97499]"; decoded role = service_role: anyone who opens the site can read and write every table.
    • F012 001_init.sql:1 → create table klanten (id uuid primary key, email text, plan text); with no enable row level security.
    • F009 server/api.js:3 → "SELECT * FROM klanten WHERE email='" + req.body.email + "'": SQL injection.
    • F008 server/api.js:2 → /api/debug/env returns process.env to anyone.

    Fix these three first

    1. Rotate the service-role key in Supabase now (it has shipped), remove it from the bundle and .env in dist/, and call privileged actions from an edge function that holds the key server-side.
    2. Turn on RLS with owner-only policies:
    alter table public.klanten enable row level security;
    create policy "owner reads own row" on public.klanten for select using (auth.uid() = id);
    create policy "owner updates own row" on public.klanten for update using (auth.uid() = id) with check (auth.uid() = id);
    
    1. Parameterise the query and delete the debug route: db.query("select * from klanten where email = $1", [req.body.email]); remove /api/debug/env; set CORS to your own origin.

    Then: strip the key from prompts/support.txt, log user IDs instead of authorization headers, replace dangerouslySetInnerHTML with escaped text, and enforce the admin role in RLS instead of localStorage.

    Re-test after the fixes

    python3 scripts/scan_bundle.py 2-na-herstel --out r2 --compare r1/findings.json
    Fixed: 12 · still open: 0 · new: 0

    Next steps

    • Reproduce each P1 once in a local test project with fake data before you close it.
    • Add the scan to CI so a new key or table without RLS fails the build.

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

    About this skill

    Most AI-built apps ship with the same handful of holes: a Supabase service-role key in the browser bundle, a table without row-level security, a policy that says using (true), CORS open to every site, or an agent tool that can send email or run SQL on whatever a web page tells it.

    This skill makes your agent check for all of them before you launch, the way a security reviewer would:

    1. Maps the project: client code, server code, SQL migrations, agent tools and n8n exports.
    2. Secrets first: Anthropic, OpenAI, Stripe, AWS, Google, GitHub and Slack keys, private keys, and Supabase JWTs (it decodes the role: service_role is critical, anon is fine). Secrets are shown only as type, file:line, first 4 characters and length.
    3. Supabase / Postgres: tables without RLS, disabled RLS, always-true policies, grants to anon, security definer without a fixed search_path, and SQL built from strings.
    4. Web surface: wildcard CORS, dangerouslySetInnerHTML / innerHTML / v-html, debug and admin routes, client-only role checks, JWT verification switched off, secrets in logs.
    5. AI agents: shell, SQL, file, email and payment tools without allow-lists or human confirmation, and untrusted text placed in the system prompt.
    6. Report and fix: a prioritised report with why it matters, how to validate safely, and the exact fix (RLS policies scoped to auth.uid(), server-side proxy for keys, deny-by-default tool gate).
    7. Re-test: after your fixes it runs again and reports fixed / still open / new.

    Static and offline: it reads your files and never calls your production system or a third-party site. Every finding starts as needs_validation, so you get evidence, not alarm.

    The checks match the open-source, MIT-licensed scanner bundled as scripts/scan_bundle.py (23 rules, Python standard library only), so you can also run it in CI.

    This is a static code review, not a live attack. It cannot find bugs in live servers or third-party platforms you use.

    Works in any agent that loads SKILL.md (Claude Code, Codex CLI, Cursor, Gemini CLI, Copilot). The agent does the review with its own file tools; no install needed. Optional deterministic run (Python 3.8+, standard library only, no network): python3 scripts/scan_bundle.py <project-or-dist> --out security-report/ python3 scripts/scan_bundle.py <project> --out security-report-2/ --compare security-report/findings.json Outputs findings.json, REPORT.md, scope-manifest.json and RETEST.md. Secret values are never stored: only type, location and a one-way fingerprint. reference/rules.md lists all 23 rules with why, how to validate and the fix. Source and tests: the public ai-app-security-check repository (MIT).

    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

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 1 day ago

    • Free with an Agensi account

    Nothing to install. It runs in your AI agent.

    Optional
    Python 3.8+ (only for the scripted scan)

    Permissions

    Terminal / Shell
    Read Files
    Write Files

    Reads your project files to find issues and writes security-report.md. The optional scanner runs locally with python3 and makes no network calls; secret values are never stored or printed.

    Listed1 day ago

    What's inside

    Frequently Asked Questions

    This skill acts as a safety inspector for apps built with AI tools. It scans your code and database settings to find hidden mistakes that hackers use, such as private keys left in the browser or database tables that are open for anyone to read.

    You just need to point your AI agent to your project folder or the files you downloaded from your app builder. The skill runs a local scan of your files and does not require you to sign up for any new accounts or send your data to the internet.

    You receive a detailed security report that lists every risk found, ranked by how serious it is. The skill also provides the exact code or database commands you need to copy and paste to fix those holes.

    This skill is a static review of your code and files. It is not meant for scanning systems you do not own, performing live attacks on websites, or testing how a live app behaves while it is running.

    You can tell your agent to check your app before you launch it or ask if you have leaked any API keys. It is also helpful to ask for a review of your database rules or to check if your AI agent tools have too much power.

    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.

    Free