/hardening:secrets-leak-auditfrom hardening
Use when checking whether API keys, tokens, passwords, or personal data can escape through git history, the client bundle, log lines, error reports, or API response payloads. Triggers: pre-launch review, a key found in a commit, a .env file that may have been tracked, a new public-prefixed environment variable (NEXT_PUBLIC_, VITE_, EXPO_PUBLIC_), a new logger or error-reporting integration, or a 'what does the client actually receive' question.
Ships in hardening. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Secrets leave through four doors, and most teams guard one. This audit checks all four against the code and the built artifacts, not against the team's memory of what is safe: git history, the client bundle, logs and error reports, and API responses. A finding in any door is treated as a live leak until proven otherwise, and a secret that ever touched git is rotated, not deleted.
Repository-level static analysis and secret scanning belong to defect-scan (semgrep, gitleaks, bandit, brakeman) when that plugin is installed; this skill covers what those tools cannot see, the built output and the runtime channels, and tells you what to do with a hit. Check for a repo-local secrets policy first (AGENTS.md, SECURITY.md, a repo-local secrets-leak-audit skill); it is authoritative when present.
Status words: LEAK (a secret or personal data is exposed, confirmed from source, history, or a capture), CLEAN (checked with evidence and nothing found), UNVERIFIED (the check could not be run). "Confirmed from source, not captured live" is a LEAK with a note; it does not need a capture to count. A door with nothing found and no way to run the check is UNVERIFIED, never CLEAN.
Prove each search can match before trusting an empty result. A grep that prints nothing is identical whether the code is clean or the command is broken (bad glob, wrong directory, wrong flag). Before relying on an empty result, run the same command with a known-positive pattern (for example the word import) and confirm it prints matches; if it does not, fix the command first.
.env* with an exception for .env.example) and that none is tracked. A .gitignore containing only .env is incomplete. No output from the second command is the clean result:
grep -nE '^\.env' .gitignore
git ls-files | grep -iE '(^|/)\.env(\.|$)|credentials|secrets?\.(json|ya?ml)$|\.mcp\.json$'
gitleaks result does not clear the door, because detectors miss placeholder-looking or unusual keys and connection strings. Write reports to a private temporary directory, not a shared one:
REPORT_DIR=$(mktemp -d)
command -v gitleaks >/dev/null && gitleaks detect --source . --redact --report-format json --report-path "$REPORT_DIR/gitleaks.json"
# always: key shapes and credentialed URLs across every revision
git log -p --all | grep -noE 'AKIA[0-9A-Z]{16}|sk-[A-Za-z0-9_-]{20,}|sk-ant-[A-Za-z0-9_-]{20,}|sk_live_[0-9a-zA-Z]{24,}|ghp_[0-9a-zA-Z]{36}|whsec_[0-9a-zA-Z]{32,}|re_[0-9a-zA-Z]{20,}|xox[baprs]-[0-9A-Za-z-]{10,}|-----BEGIN (RSA|EC|OPENSSH) PRIVATE KEY|[a-z][a-z0-9+.-]*://[^:/[:space:]]+:[^@[:space:]]+@' | sed -E 's/^([0-9]+:)(.{8}).*/\1\2...<redacted>/' | head -40
-o with the mask keeps the key itself out of the transcript: only the line number and the first eight characters print.
Also read git log -p -- .env and any .env* or config file that ever appeared in git ls-files output, since a deleted file's contents are in history.git filter-repo) only if the repo is or may become public. Removal without rotation is theater.npm run build 2>/dev/null
grep -rnoE 'NEXT_PUBLIC_[A-Z0-9_]+|VITE_[A-Z0-9_]+|EXPO_PUBLIC_[A-Z0-9_]+|REACT_APP_[A-Z0-9_]+' .next/static dist build 2>/dev/null | sort -u
grep -rnoE 'sk-[A-Za-z0-9_-]{20,}|sk_live_|AKIA[0-9A-Z]{16}|whsec_|-----BEGIN' .next/static dist build 2>/dev/null | head
pk_, PostHog project key, Sentry DSN) are fine by design. Anything that authenticates the server to a paid or privileged API is not, and moves behind a server route.git ls-files | cut -d/ -f1 | sort -u) rather than assuming src, because grep returns the same nonzero exit for "no matches" and "directory missing":
grep -rnE '(console|logger|log)\.\w+\(.*\b(req|request|headers|body|ctx|user|session|token|password|authorization|cookie)\b' --include='*.js' --include='*.mjs' --include='*.ts' --include='*.tsx' --include='*.py' --include='*.rb' --include='*.go' --exclude-dir=node_modules --exclude-dir=.next --exclude-dir=.git .
grep -rnE 'JSON\.stringify\((req|headers|body|user|session)' --include='*.js' --include='*.mjs' --include='*.ts' --include='*.tsx' --exclude-dir=node_modules --exclude-dir=.next --exclude-dir=.git .
Headers carry Authorization and cookies; bodies carry passwords and OTPs; user objects carry email and hashes. Replace whole-object dumps with named, allowlisted fields.Authorization, Cookie, Set-Cookie, password and token fields, and that sendDefaultPii or its equivalent is off unless the privacy policy says otherwise.select, and whole-object serialization, are the signals:
grep -rnE '(Next)?Response\.json\(|res\.(json|send)\(|return json\(' --include='*.js' --include='*.mjs' --include='*.ts' --include='*.tsx' --exclude-dir=node_modules --exclude-dir=.next --exclude-dir=.git .
grep -rnE '\.(findMany|findFirst|findUnique)\(' --include='*.js' --include='*.mjs' --include='*.ts' --include='*.tsx' --exclude-dir=node_modules --exclude-dir=.next --exclude-dir=.git . | grep -v 'select'
A route returning a database row without an allowlisted field list, or without an authorization check in front of it, is a finding even when no secret field name is visible in the grep.
Fields that never belong in a response: password hashes, reset or verification tokens, API keys, internal foreign keys the client has no use for, other users' email addresses, Stripe customer IDs on public endpoints..env* ignored and no env or credential file trackedOne table, four doors as rows: what was scanned, the command, hits, action taken or required (rotated / removed / justified / scrubbed), status (LEAK / CLEAN / UNVERIFIED). Attach the raw command output, redacted, and the captured error event and API responses where captures were possible. List anything noticed outside the four doors (a credentialed MCP config, a secret in a prompt, a workflow token) under "Noticed" with the sibling skill that owns it; do not drop it. The checklist items map onto the doors: items 1 and 2 to Door 1, 3 to Door 2, 4 and 5 to Door 3, 6 and 7 to Door 4.
git log -p.NEXT_PUBLIC_ANTHROPIC_KEY compiles and works. That is the problem.beforeSend that returns the event unchanged looks identical in a code review. Without a capture, an error reporter with default PII enabled and no scrub hook is still a LEAK from config; the captured event upgrades it from "configured to leak" to "observed leaking".Stop means: record the finding, finish the remaining doors read-only, and put the required rotation at the top of the report. The reviewer does not rotate keys unless the owner asked.
Authorization or Cookie headers: stop and fix the scrub before the next deploy.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub stylusnexus/agent-plugins --plugin hardening12 skills in this plugin
/agent-tooling-reviewUse when connecting, auditing, or widening the permissions of tooling an AI agent can call: MCP servers, plugins, skills, database or GitHub connections, API tokens issued to an agent, or an agent that will run unattended (scheduled, looped, event-triggered, background, CI). Triggers: a new MCP or plugin is about to be added, an agent needs write access it did not have, a connection points at production, an unattended job is being set up, or a tool's description changed after approval./auth-hardeningNextAuth v5 security audit and hardening checklist — session/cookie config, CSRF, OAuth scopes, per-route role checks, password-reset/OTP rate limits, secret rotation, session invalidation on privilege change. Use when adding auth to a new product, auditing an existing NextAuth v5 app, or reviewing any PR that touches session/role/permission code./exposure-scanScan installed packages against bumblebee threat-intelligence exposure catalogs to detect known-compromised dependency releases from supply-chain campaigns. Use when checking for compromised packages, running a supply-chain or dependency security scan, auditing the machine after a reported npm/PyPI/Go/gem/extension compromise, or refreshing threat-intel catalogs./legal-docsDraft or review the customer-facing legal documents of a small SaaS - Terms of Service, Privacy Policy, refund policy, and acceptable use policy - in plain English, with placeholders instead of invented facts, a check that every claim matches what the product actually does, and a not-legal-advice notice on every draft. Use when asked to "write terms", "draft a privacy policy", "update our ToS", "write a refund policy", or before launching a product or feature that changes what data is collected or how billing works./llm-app-securityUse when a product feature sends untrusted content to a language model or lets a model call tools, write data, send messages, or render output to other users. Triggers: a new chat, RAG, summarization, agent, or tool-calling feature; a model that reads web pages, documents, emails, tickets, or other users' text; a 'can prompt injection reach this' question; a pre-launch review of anything with an LLM in the request path; or an incident where a model did something nobody asked for./privacy-auditData inventory and privacy audit for a product — enumerate exactly what user data is collected and where it lands (Neon/Supabase tables, logs, PostHog, Stripe, email provider, Better Stack/Sentry), check alignment with the privacy policy, verify GDPR export/delete paths exist, and grep for PII leaking into logs or API responses. Use when asked to "audit privacy," "check what data we collect," before a launch, or after adding a new data-collecting feature (signup field, analytics event, webhook).Other plugins' skills for the same job