kensaurus/cursor-kenji/plan-secrets-audit
Claude Code and agent skill by kensaurus/cursor-kenji
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Plan-only scan of the working tree and git history for exposed or mis-scoped keys, then a rotate-vs-relocate plan. Use when "hardcoded secrets", "did I commit a key", "secret scan", "is my .env safe", or "rotate keys".
Install
npx vskill@latest install kensaurus/cursor-kenji/plan-secrets-auditSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as kensaurus/cursor-kenji/plan-secrets-audit.
Secrets & Key-Scope Audit + Rotation Plan
Degree of freedom: MIXED — prefix scan is exact; rotate-vs-relocate is judgment. Stay plan-only. Never print secret values.
This skill vs neighbors
| Skill | Owns | |
|---|---|---|
| plan-secrets-audit (this) | Rotate vs relocate leaked keys | |
plan-security-audit | OWASP umbrella (not the first secrets match) | |
plan-rls-audit | Table access control | |
audit-env-parity | Env/config drift |
How to reason (every plan item)
- Propose — rotate, relocate, or hygiene — say which, never print the value
- Risk — who can use the key if it stays live (history counts)
- Keep-working — keys that are scoped correctly and not in history
- Phase — rotate → relocate → hygiene → optional scrub (do not execute)
Worked example
Propose: rotate the Stripe secret atapi/pay.ts(last-4 only in the report); history presence means rotate, not.envmove.Risk:sk_in committed history stays valid forever after a relocate.Keep-working: Stripepk_in the client is publishable by design (still note the protector).Phase: Phase 1 — rotate exposed never-client secrets.Redaction: type + path + last 4 — never the secret.
Role: Senior security engineer (credential exposure + key scoping).
Task: Scan working tree and git history, classify each credential (rotate vs relocate), score by scope and permanence, emit plan-secrets-audit.md. Audit & plan only — no rotation, scrubbing, or env edits until each phase is approved.
Find every leaked key. Decide rotate vs relocate. Change nothing until approved.
A widely reported breach started with a hardcoded Supabase key in client JavaScript — combined with RLS off, the public key became an admin backdoor. A secret committed even once lives in git history forever. Moving it to .env later does nothing; the only real fix is rotation.
When this fires
Trigger phrases: "scan for secrets", "are my keys exposed", "did I commit an API key", "is my .env safe", "rotate keys", "about to open-source this", "pre-launch secret check".
Do not fire for: RLS policy correctness (plan-rls-audit), input/webhook validation (plan-input-validation). This skill owns credential exposure and key scoping specifically.
Why a dedicated skill
A grep finds strings. This skill adds the two judgments a grep can't: scope (is this key supposed to be client-side?) and permanence (is it in history, making relocation insufficient?).
The audit
A · Pattern scan (working tree) [LOW freedom — run exactly]
Search outside .env* and server-only contexts for:
- Prefixes:
sk_,pk_,whsec_,service_role,eyJ...,AKIA,API_KEY,
SECRET, TOKEN, long random blobs.
- Supabase: anon vs
service_role. - Any key in files that ship to the browser.
B · Scope classification [HIGH freedom]
- Safe client-side: Supabase anon, Stripe publishable (
pk_), public
analytics keys — note the protector dependency (RLS, Stripe design).
- Never client-side (Critical if exposed): service_role, Stripe secret
(sk_), webhook secret (whsec_), AWS secrets, DB URLs.
- `NEXT_PUBLIC_` / `VITE_` / `EXPO_PUBLIC_` trap — bundled into client.
C · Git history (rotate vs relocate) [HIGH freedom]
- Ever in committed history → rotate (relocation is theater).
- Scrubbing (filter-repo/BFG) is secondary — rotation first.
D · Deployment env config (Vercel / AWS) [HIGH freedom]
- Secrets in platform env store, not baked into build.
.env.examplenot committed with real values.- No secrets as build args (persist in image layers).
E · .gitignore & hygiene [HIGH freedom]
.env*ignored; no secrets in README, comments, test fixtures.
Procedure [HIGH freedom]
- Scan working tree (A), classify scope (B).
- Check history for every credential (C).
- Review deploy + hygiene (D, E).
- Score. Never-client in client bundle or history = Critical.
- Phase. Emit `plan-secrets-audit.md`, then end the turn with a standalone recap in chat: the two or three highest-impact findings (type + location + last 4, never the value) and the first phase to approve. The file is the deliverable — write it before the recap.
Guardrails [LOW freedom — run exactly]
- Plan only. No rotation, history rewriting, or env edits.
- Never print the secret. Type + location + last 4 chars at most.
- Rotate beats relocate — always say which.
- Don't assume safe-client keys are fine. Hand anon-key + no-RLS to
plan-rls-audit.
- Order: rotate → update env store → redeploy → (optional) scrub history.
Self-critique before the burndown [LOW freedom — do not skip]
- evidenced-not-assumed — type + location + last 4; never the secret value
- plan-only — no rotation, scrub, or env edit this pass
- phase justified — history → rotate is Phase 1, not "move to
.env" - right-owner — anon-key + no-RLS →
plan-rls-audit; generic OWASP →plan-security-audit - no-false-safety — relocate-without-rotate is theater; safe-client still needs its protector
Report template — plan-secrets-audit.md
Chains with
- Security spine — credentials layer (this skill); cross-hand to
plan-rls-audit for anon-key safety.
- `create-hook` — pre-commit secret-scanning hook as regression guard.
- Execution: provider dashboards, Vercel/AWS env,
audit-security. - Verify: re-scan working tree + history; confirm rotated keys are dead.
Plan at high effort. Execute after approval at the default effort underapproved-plan-execution.mdc(no reward hacking, no feature deletion). Rotation is irreversible-ish — the plan says which keys; the rule constrains how and in what order.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/plan-secrets-audit/SKILL.md
Popularity
- Repository stars
- 9
- 7-day trend score
- 12
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/kensaurus/cursor-kenji/plan-secrets-audit)