Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Client Secret-Leak & Supply-Chain Pre-Commit Guard

    1

    Stop NEXT_PUBLIC_ and VITE_ browser secret leaks, malicious npm postinstall scripts, unpinned deps, and localStorage JWTs before git push—with a spy-tested zero-.env-read Python scanner.

    $5

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Client Secret-Leak & Supply-Chain Pre-Commit Guard

    Client Secret-Leak & Supply-Chain Pre-Commit Guard

    Example session with this skill installed

    Run a pre-commit client secret-leak and supply-chain security guard on our Next.js + Supabase repo before we push to GitHub. Block any browser-bundle leaks or risky npm scripts without reading our .env file.

    • Read your context and instructions
    • Compiled the client secret-leak

    Client Secret-Leak & Supply-Chain Pre-Commit Report

    Verdict: BLOCK · Score: 0 / 100 · Secret .env Files Skipped (Never Opened): 1

    RuleSeverityLocationFindingRemediation
    CSC-001Criticalsrc/client.ts:4NEXT_PUBLIC_SUPABASE_SERVICE_ROLE_KEY inlined into browser JSMove to server-only SUPABASE_SERVICE_ROLE_KEY in API route; rotate key
    CSC-003Criticalpackage.json:11postinstall script executes curl ... | shRemove lifecycle shell hook; run npm ci --ignore-scripts
    CSC-005High.env.env present without matching .gitignore ignore ruleAdd .env* + !.env.example to .gitignore
    CSC-004Highpackage.json:18Dependency pinned to "latest" / "*"Pin exact semver + commit lockfile
    CSC-008Mediumsrc/client.ts:19localStorage.setItem('auth_token', ...) exposed to XSSMove session token to HttpOnly; Secure; SameSite=Lax cookie

    Immediate Actions (Approval Required)

    1. Rotate SUPABASE_SERVICE_ROLE_KEY immediately if previously built or deployed.
    2. Reply

    "Apply pre-commit fixes" to move the secret to a server-only Route Handler, harden .gitignore, and clean package.json.

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

    About this skill

    Stop Shipping Private API Keys Inside Your Browser Bundle

    One wrong NEXT_PUBLIC_ or VITE_ prefix—or a single compromised npm postinstall script—can leak your database service-role key to every visitor in seconds. Client Secret-Leak & Supply-Chain Pre-Commit Guard gives your AI coding agent a strictly read-only Python static scanner (scripts/scan_client_supply_chain.py) that catches client-bundle secret leaks and supply-chain risks before you push—without ever opening a single .env file.

    What It Blocks (8 Modern Web-App Security Rules)

    • CSC-001 (Critical): Secret-like env vars prefixed with NEXT_PUBLIC_*, VITE_*, REACT_APP_*, NUXT_PUBLIC_*, or EXPO_PUBLIC_* (e.g., SERVICE_ROLE, STRIPE_SECRET, OPENAI_API_KEY, DATABASE_URL).
    • CSC-002 (Critical): High-confidence hardcoded credentials/tokens in tracked source files (strictly masked as [REDACTED] in all output).
    • CSC-003 (Critical): Suspicious package.json lifecycle scripts (preinstall/install/postinstall) running curl, wget, bash, sh -c, eval, or node -e.
    • CSC-004 (High): Floating/unpinned dependency versions (*, latest, unpinned git branches) in package.json, requirements.txt, or pyproject.toml.
    • CSC-005 (High): .env / .env.local / .env.production present without a matching .gitignore rule (checks path & .gitignore text only—never opens .env*).
    • CSC-006 (High): Secret-like variables baked into Dockerfile ARG or echoed in CI workflow run: steps.
    • CSC-007 & CSC-008 (Medium): Missing lockfiles / npm install in CI and storing auth tokens/JWTs in localStorage instead of HttpOnly cookies.

    How to Use

    Ask your AI agent before pushing a PR or shipping a frontend/full-stack release:

    • "Run a client secret-leak and supply-chain pre-commit scan on this Next.js/Vite repo."
    • "Check if any private keys are exposed via NEXT_PUBLIC_ or VITE_ and verify our package.json lifecycle hooks."

    Or run the read-only scanner directly:

    python3 scripts/scan_client_supply_chain.py --path . --format markdown
    

    What's Inside (22 Files)

    • SKILL.md — Deterministic 5-step pre-commit gate (PASS / WARN / BLOCK) with strict redaction rules
    • scripts/scan_client_supply_chain.py — Pure Python 3 stdlib scanner (0–100 score, --fail-on CI gate, JSON/Markdown output)
    • references/ — Client-bundle leak guide (Next.js/Vite/Supabase), npm/Python supply-chain defense, and rule catalog
    • templates/ & examples/ — Pre-commit security report, emergency secret-rotation checklist, and worked Next.js SaaS audit
    • tests/ — Risky & clean web-app fixtures + unit tests including a spy test proving .env is never opened

    Security & Privacy Guarantee

    • Spy-tested zero-.env-read guarantee — never opens .env* secret files and masks every suspected token as [REDACTED].

    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 pre-commit analysis of working-tree source, package manifests, Dockerfiles, and CI YAML; does not scan historical git commit blobs or query external CVE databases.

    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
    Python 3.9+ (stdlib only)Git

    Permissions

    Terminal / Shell
    Read Files
    Write Files

    Bundled scanner is 100% offline, read-only, and spy-tested never to open .env files; all suspected tokens are masked as [REDACTED]. Write Files is only used after explicit user approval.

    Listed2 days ago

    What's inside

    Frequently Asked Questions

    This skill acts as a deterministic security gate that identifies hardcoded API keys and framework-specific leaks (like NEXT_PUBLIC_ prefixes) in your code, preventing credentials from being accidentally exposed to the browser or committed to public repositories.

    The skill is framework-agnostic but includes specialized rules for Next.js, React, Vite, Nuxt, and Expo, as well as general support for Node.js and Python projects.

    Unlike generic AI prompts, this skill uses a deterministic Python analyzer to ensure zero false negatives on common prefix leaks and strictly redacts sensitive data so your actual secrets never enter the LLM chat history.

    No, the tool operates in a read-only mode for your environment files to protect your privacy; it verifies that .env files are correctly listed in your .gitignore without ever accessing their internal contents.

    You will receive the core Python-based static analyzer, the comprehensive security rule catalog, and the remediation mapping logic used to generate rotation checklists and hardening patches.

    The skill identifies supply-chain risks such as unpinned dependencies, missing lockfiles, and suspicious npm lifecycle hooks (like postinstall) that could be used to execute malicious code during your build process.

    New in Security