Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Vibe-App Pre-Deploy Secrets & RLS Audit Gate

    1

    Pre-deploy audit gate for AI-built apps: catches client-exposed secrets, hardcoded keys, .gitignore gaps, and Supabase tables missing Row Level Security or policies. 100% static scan, offline, exit-1 gate.

    $19

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Vibe-App Pre-Deploy Secrets & RLS Audit Gate

    Example session with this skill installed

    Run a security audit on my current Next.js and Supabase project to check for leaked secrets and missing RLS policies before I deploy to Vercel.

    • Read your context and instructions
    • Compiled the vibe-app pre-deploy secrets

    I have completed the static security audit of your project. The audit gate found 3 critical violations that are blocking deployment.

    Security Audit Report: [BLOCKED]

    Rule IDSeverityFileLineFinding
    CLIENT_SECRET_EXPOSURECRITICAL.env.local4NEXT_PUBLIC_STRIPE_SECRET contains a secret-shaped value (sk_live_...)
    RLS_MISSINGCRITICALsupabase/migrations/01_init.sql12CREATE TABLE "profiles" lacks matching ENABLE ROW LEVEL SECURITY
    GITIGNORE_GAPHIGH.env.productionN/AFile exists but is not covered by patterns in .gitignore

    Audit Summary:

    • Status: BLOCKED (Exit Code 1)
    • Total Files Scanned: 24
    • Critical Findings: 2
    • High Findings: 1

    The scan detected a production Stripe secret prefixed for client exposure, which would have bundled the key into your frontend JavaScript. Additionally, your profiles table is missing Row-Level Security, meaning it is currently open to public access if the Supabase API is exposed.

    Next steps

    1. Move NEXT_PUBLIC_STRIPE_SECRET to a server-only variable name and rotate the key immediately since it was detected in a client-exposed format.
    2. Add ALTER TABLE "profiles" ENABLE ROW LEVEL SECURITY; followed by explicit CREATE POLICY rules to your SQL migration.
    3. Update your .gitignore to include .env.production to prevent accidental commits of production credentials.

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

    About this skill

    Above-the-Fold Hook (3-Second Value)

    Never push an AI-built ("vibe-coded") Next.js, Vite, or Supabase app to production with a secret bundled into NEXT_PUBLIC_, a hardcoded service-role key, an unignored .env, or a Postgres table missing Row-Level Security (RLS).

    Vibe-App Pre-Deploy Secrets & RLS Audit Gate delivers a deterministic 3-layer pre-deploy security package (SKILL.md numbered audit SOP + JSON Schema Draft 2020-12 policy & report contracts + zero-dependency Python 3 stdlib static scanner) that inspects .env* files, .gitignore, application source/config files, and SQL migrations 100% offline without executing a single line of target code — catching CLIENT_SECRET_EXPOSURE, HARDCODED_SECRET, GITIGNORE_GAP, RLS_MISSING, POLICY_MISSING, and DESTRUCTIVE_MIGRATION (DROP TABLE / DROP COLUMN), redacting secret values in output, and exiting 1 ([BLOCKED]) on any blocking finding or 0 ([PASS]) only when clean.


    What's Inside (3-Layer Architecture + 60-Second Test Pack)

    • Layer 1 — Pre-Deploy Audit Gate SOP (SKILL.md): Numbered 6-step pre-deploy security workflow, hard gate matrix, and non-negotiable security rules tailored for Claude Code, Cursor, and Codex CLI.
    • Layer 2 — JSON Schema Draft 2020-12 Contracts (schemas/):
      • schemas/audit_policy.schema.json: Strictly typed policy schema controlling fail_on_severities, destructive_migration_severity, client_prefixes, ignore_dirs, sql_migration_globs, optional ignored_rule_ids, and max_file_size_bytes.
      • schemas/audit_report.schema.json: Machine-readable report contract covering status, exit_code, target, files_scanned, tables_audited, counts_by_rule, counts_by_severity, per-table RLS/policy summaries, and line-level findings with remediation guidance.
    • Layer 3 — Zero-Dependency Static Gate (scripts/vibe_predeploy_gate.py): 100% pure Python 3 standard library (argparse, fnmatch, json, os, pathlib, re, sys, typing) with zero third-party packages and zero execution of target code:
      • CLIENT_SECRET_EXPOSURE (CRITICAL): Detects NEXT_PUBLIC_, VITE_, and PUBLIC_ variables in .env* or source/config files assigned secret-shaped material (sk_live_, sk_test_, sk-, sb_secret_, eyJ... JWTs, or opaque tokens >= 20 chars), while excluding safe public URLs and placeholders.
      • HARDCODED_SECRET (CRITICAL): Detects hardcoded sb_secret_... keys, 3-part base64url JWTs (eyJ...), sk_live_.../sk-.../ghp_.../AKIA... API keys, and PEM private keys in source files without double-counting CLIENT_SECRET_EXPOSURE lines.
      • GITIGNORE_GAP (HIGH): Flags live .env / .env.local / .env.production files when .gitignore is missing or fails to cover them (excluding safe templates like .env.example).
      • RLS_MISSING (CRITICAL) & POLICY_MISSING (HIGH): Strips SQL comments (--, /* ... */) while preserving exact line numbers, tracks every CREATE TABLE across migrations in sorted order, and catches tables missing ALTER TABLE ... ENABLE ROW LEVEL SECURITY or missing CREATE POLICY ... ON <table>.
      • DESTRUCTIVE_MIGRATION (Policy-configured, default HIGH): Flags DROP TABLE and DROP COLUMN statements in SQL migrations with severity governed by destructive_migration_severity.
      • Emits redacted evidence and pure-ASCII (cp1252-safe) terminal reports, supports --json stdout and --out-report <path>, and exits 0 ([PASS]) or 1 ([BLOCKED]).
    • 60-Second Test Pack (examples/):
      • examples/audit_policy.json: Strict default pre-deploy policy (fail_on_severities: ["CRITICAL", "HIGH"], destructive_migration_severity: "HIGH").
      • examples/sample_app_fail/: Mini Next.js/Supabase-style fixture repo planting 5 synthetic violations (1 CLIENT_SECRET_EXPOSURE, 1 HARDCODED_SECRET, 1 GITIGNORE_GAP, 1 RLS_MISSING, 1 POLICY_MISSING).
      • examples/sample_app_pass/: Clean mini repo with .gitignore covering .env, a safe public NEXT_PUBLIC_APP_URL, server-side process.env reads, and full RLS + CREATE POLICY coverage across both SQL tables (0 findings, exit 0).

    Who This Is For & Prerequisites

    Built for:

    • Indie builders, founders, and developers shipping AI-assisted Next.js, Vite, React, and Supabase/Postgres apps who want an instant offline pre-deploy guardrail before git push, vercel --prod, or supabase db push.
    • Teams running Claude Code, Cursor, Codex CLI, or CI pre-deploy checks that need deterministic exit codes (0/1) and JSON Schema Draft 2020-12 audit reports without SaaS lock-in or pip install.

    Prerequisites:

    • Python 3.9+ (uses Python 3 standard library only — zero external packages, zero network calls, 100% static file inspection).
    • Cross-platform: pure-ASCII terminal output verified cp1252-safe on Windows as well as macOS and Linux.

    60-Second Quick-Start

    Run directly from the skill folder:

    # 1. Run FAIL fixture -> [BLOCKED] (exit code 1, catches all 5 planted violations)
    python scripts/vibe_predeploy_gate.py \
      --target examples/sample_app_fail \
      --policy examples/audit_policy.json
    
    # 2. Run PASS fixture -> [PASS] (exit code 0, 0 findings across 5 files and 2 tables)
    python scripts/vibe_predeploy_gate.py \
      --target examples/sample_app_pass \
      --policy examples/audit_policy.json
    
    # 3. Emit machine-readable JSON report (or save to disk with --out-report report.json)
    python scripts/vibe_predeploy_gate.py \
      --target examples/sample_app_pass \
      --policy examples/audit_policy.json \
      --json
    

    Real Terminal Proof

    1. BLOCKED Gate — Catching All 5 Planted Violations in examples/sample_app_fail (exit code 1)

    $ python scripts/vibe_predeploy_gate.py --target examples/sample_app_fail --policy examples/audit_policy.json
    ==========================================================================
    VIBE-APP PRE-DEPLOY SECRETS & RLS AUDIT GATE -- STATIC REPORT
    ==========================================================================
    Target         : examples/sample_app_fail
    Policy         : strict-predeploy-default (fail_on=CRITICAL,HIGH)
    Mode           : 100% Static Scan (zero code execution, offline)
    Summary        : Files=5 | Tables=2 | Findings=5 | Blocking=5
    Severity Count : CRITICAL=3 | HIGH=2 | MEDIUM=0 | LOW=0
    Rule Counts    : CLIENT_SECRET=1 | HARDCODED=1 | GITIGNORE=1 | RLS=1 | POLICY=1 | DESTRUCTIVE=0
    --------------------------------------------------------------------------
    SQL TABLE RLS AUDIT:
      - public.invoices [RLS=OFF | POLICIES=0] (supabase/migrations/001_init.sql:3)
      - public.user_profiles [RLS=ON | POLICIES=0] (supabase/migrations/001_init.sql:11)
    --------------------------------------------------------------------------
    [BLOCKED] Pre-deploy gate REJECTED target: 5 blocking finding(s) detected. DO NOT DEPLOY.
    
    FINDINGS:
      1. [CRITICAL] CLIENT_SECRET_EXPOSURE (BLOCKING) at .env:2
         Detail   : Client-exposed env variable 'NEXT_PUBLIC_STRIPE_SECRET' contains secret/key material.
         Evidence : NEXT_PUBLIC_STRIPE_SECRET=sk_live_TE***REDACTED***aabb
         Fix      : Remove the client prefix (NEXT_PUBLIC_/VITE_/PUBLIC_), move the secret to a server-only env var, and rotate the exposed key.
      2. [CRITICAL] HARDCODED_SECRET (BLOCKING) at src/server_client.ts:3
         Detail   : Hardcoded credential detected in source: Supabase secret key (sb_secret_).
         Evidence : const SUPABASE_SERVICE_KEY = "sb_secret_***REDACTED***9900";
         Fix      : Replace the hardcoded literal with a server-side environment variable lookup and rotate the exposed credential.
      3. [CRITICAL] RLS_MISSING (BLOCKING) at supabase/migrations/001_init.sql:3
         Detail   : Table 'public.invoices' is created without ENABLE ROW LEVEL SECURITY.
         Evidence : CREATE TABLE public.invoices (
         Fix      : Add 'ALTER TABLE public.invoices ENABLE ROW LEVEL SECURITY;' and explicit least-privilege CREATE POLICY rules in SQL migrations.
      4. [HIGH] GITIGNORE_GAP (BLOCKING) at .env:1
         Detail   : Secret env file '.env' is not covered by .gitignore.
         Evidence : .env (uncovered by .gitignore)
         Fix      : Add '.env' (or '.env' and '.env.*') to .gitignore and verify it is untracked in git.
      5. [HIGH] POLICY_MISSING (BLOCKING) at supabase/migrations/001_init.sql:18
         Detail   : Table 'public.user_profiles' enables Row-Level Security but defines zero CREATE POLICY rules.
         Evidence : ALTER TABLE public.user_profiles ENABLE ROW LEVEL SECURITY;
         Fix      : Add explicit least-privilege CREATE POLICY ... ON public.user_profiles statements (for example scoped to auth.uid()).
    ==========================================================================
    # Exit code: 1
    

    2. PASS Gate — Clean Fixture Approved (exit code 0)

    $ python scripts/vibe_predeploy_gate.py --target examples/sample_app_pass --policy examples/audit_policy.json
    ==========================================================================
    VIBE-APP PRE-DEPLOY SECRETS & RLS AUDIT GATE -- STATIC REPORT
    ==========================================================================
    Target         : examples/sample_app_pass
    Policy         : strict-predeploy-default (fail_on=CRITICAL,HIGH)
    Mode           : 100% Static Scan (zero code execution, offline)
    Summary        : Files=5 | Tables=2 | Findings=0 | Blocking=0
    Severity Count : CRITICAL=0 | HIGH=0 | MEDIUM=0 | LOW=0
    Rule Counts    : CLIENT_SECRET=0 | HARDCODED=0 | GITIGNORE=0 | RLS=0 | POLICY=0 | DESTRUCTIVE=0
    --------------------------------------------------------------------------
    SQL TABLE RLS AUDIT:
      - public.invoices [RLS=ON | POLICIES=1] (supabase/migrations/001_init.sql:3)
      - public.user_profiles [RLS=ON | POLICIES=1] (supabase/migrations/001_init.sql:18)
    --------------------------------------------------------------------------
    [PASS] Pre-deploy gate APPROVED target: 0 blocking finding(s) across 5 file(s) and 2 table(s).
    ==========================================================================
    # Exit code: 0
    

    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.

    Static analysis only. Does not execute code or SQL. Requires Python 3 standard library. Audit is limited to files matching configured globs.

    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 today

    Software
    PythonGit

    Permissions

    Terminal / Shell
    Network Access
    Read Files
    Write Files
    Environment Variables

    Allowed Hosts

    demo.example.com
    app.example.com
    Listedtoday

    What's inside

    Frequently Asked Questions

    It prevents the two most common Supabase security failures: accidentally leaking high-privilege 'service_role' keys into your frontend code and shipping database tables that lack Row-Level Security (RLS) protections.

    The skill includes a portable, zero-dependency Python audit script, a customizable JSON security policy schema, and documentation for integrating the gate into your local development or CI/CD pipelines.

    Because the scanner is written in pure Python 3 using only the standard library, it can be executed by any AI agent or environment with access to a Python interpreter, including local CLI tools and cloud-based agents.

    Unlike LLMs that might hallucinate security status, this skill uses a deterministic static analyzer to ensure every single table is checked for RLS—providing a consistent 'pass/fail' result that isn't subject to prompt variance.

    While optimized for the Next.js and Supabase ecosystem, the scanner can audit any project using Postgres SQL migrations and standard .env configuration patterns for sensitive key detection.

    No, the script performs a static analysis of your source code and SQL files locally; it does not execute your code or connect to your live database, ensuring your secrets remain private.

    New in Security