Works with the AI Agents you already use
Client Secret-Leak & Supply-Chain Pre-Commit Guard
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
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
| Rule | Severity | Location | Finding | Remediation |
|---|---|---|---|---|
CSC-001 | Critical | src/client.ts:4 | NEXT_PUBLIC_SUPABASE_SERVICE_ROLE_KEY inlined into browser JS | Move to server-only SUPABASE_SERVICE_ROLE_KEY in API route; rotate key |
CSC-003 | Critical | package.json:11 | postinstall script executes curl ... | sh | Remove lifecycle shell hook; run npm ci --ignore-scripts |
CSC-005 | High | .env | .env present without matching .gitignore ignore rule | Add .env* + !.env.example to .gitignore |
CSC-004 | High | package.json:18 | Dependency pinned to "latest" / "*" | Pin exact semver + commit lockfile |
CSC-008 | Medium | src/client.ts:19 | localStorage.setItem('auth_token', ...) exposed to XSS | Move session token to HttpOnly; Secure; SameSite=Lax cookie |
Immediate Actions (Approval Required)
- Rotate
SUPABASE_SERVICE_ROLE_KEYimmediately if previously built or deployed. - 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 withNEXT_PUBLIC_*,VITE_*,REACT_APP_*,NUXT_PUBLIC_*, orEXPO_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): Suspiciouspackage.jsonlifecycle scripts (preinstall/install/postinstall) runningcurl,wget,bash,sh -c,eval, ornode -e.CSC-004(High): Floating/unpinned dependency versions (*,latest, unpinned git branches) inpackage.json,requirements.txt, orpyproject.toml.CSC-005(High):.env/.env.local/.env.productionpresent without a matching.gitignorerule (checks path &.gitignoretext only—never opens.env*).CSC-006(High): Secret-like variables baked intoDockerfileARGor echoed in CI workflowrun:steps.CSC-007&CSC-008(Medium): Missing lockfiles /npm installin CI and storing auth tokens/JWTs inlocalStorageinstead ofHttpOnlycookies.
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_orVITE_and verify ourpackage.jsonlifecycle 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 rulesscripts/scan_client_supply_chain.py— Pure Python 3 stdlib scanner (0–100score,--fail-onCI gate, JSON/Markdown output)references/— Client-bundle leak guide (Next.js/Vite/Supabase), npm/Python supply-chain defense, and rule catalogtemplates/&examples/— Pre-commit security report, emergency secret-rotation checklist, and worked Next.js SaaS audittests/— Risky & clean web-app fixtures + unit tests including a spy test proving.envis 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
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
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 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
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.