agent-supply-chain-aud…
Audit the extensions AI coding agents load and trust (skills, plugins, marketplaces, hooks, settings, MCP servers, and…
Find leaked secrets in source code, Git history, build artifacts, and infrastructure — and audit the secrets-management posture preventing future leaks. Use when the user mentions 'secrets audit,' 'secret scanning,' 'leaked credentials,' 'API key in code,' 'gitleaks,'
Claude Code
$ npx -y skills add briiirussell/cybersecurity-skills --skill secrets-audit --agent claude-code
Codex
$ npx skills add briiirussell/cybersecurity-skills --skill secrets-audit -a codex -y
Cursor
$ npx skills add briiirussell/cybersecurity-skills --skill secrets-audit -a cursor -y
Gemini CLI
$ npx skills add briiirussell/cybersecurity-skills --skill secrets-audit -a gemini-cli -y
GitHub Copilot
$ npx skills add briiirussell/cybersecurity-skills --skill secrets-audit -a github-copilot -y
OpenCode
$ npx skills add briiirussell/cybersecurity-skills --skill secrets-audit -a opencode -y
Windsurf
$ npx skills add briiirussell/cybersecurity-skills --skill secrets-audit -a windsurf -y
name: secrets-audit description: "Find leaked secrets in source code, Git history, build artifacts, and infrastructure — and audit the secrets-management posture preventing future leaks. Use when the user mentions 'secrets audit,' 'secret scanning,' 'leaked credentials,' 'API key in code,' 'gitleaks,' 'trufflehog,' 'betterleaks,' 'git history scan,' 'secrets management,' 'vault audit,' 'rotation policy,' 'AWS Secrets Manager,' 'HashiCorp Vault,' 'Doppler,' '1Password Secrets Automation,' 'sealed-secrets,' 'External Secrets Operator,' 'secrets in MCP config,' 'API key in Claude transcript,' 'is this key public,' 'hard spend cap,' 'OpenRouter key limit,' 'vendor-held secrets,' 'secrets a vendor stores,' 'which secrets did we give that vendor,' 'allow rule,' 'settings.local.json,' 'AI subprocessor,' 'agent traces,' 'credentials sent to support,' 'what zero-data-retention does not cover,' or needs to find or prevent credential exposure." allowed-tools: Read, Grep, Glob, WebSearch, Bash(betterleaks version), Bash(betterleaks git . --validate=false --analyze=false --redact --silent -o .security/out/betterleaks.json), Bash(betterleaks config show ids --validation), Bash(betterleaks config show ids --analysis)
Two halves: (1) find secrets that have already leaked into source, history, or artifacts, and (2) audit the secrets-management posture that determines whether future leaks happen.
Most secret leaks aren't "we forgot to redact" — they're "we never had a system, so every developer made up their own approach." This skill covers both the cleanup and the prevention.
Cross-references: `dependency-audit` (CI-related secrets risk in build-time exposure), `iam-audit` (workload identity federation as the alternative to long-lived keys), `owasp-audit` A04:2025 Cryptographic Failures (hard-coded secrets found during an app review), `agent-supply-chain-audit` (the skills, hooks, and MCP servers that sit next to these agent configs and can read them), `incident-triage` (its vendor-breach playbook, and the exfiltration-collector domains below as egress indicators) and `threat-hunting` (sweep for those domains), `scanner-pipeline` (gitleaks / trufflehog across full history and a whole fleet of repos, on a schedule), `personal-opsec` (the operator's own machine, where agent tokens and pasted secrets actually live), `cicd-security` (which workflows and forks can reach CI secrets).
Scan only repositories, CI systems and machines the user owns or is authorized to audit. Remote sources (a GitHub or GitLab org, Hugging Face, a bucket) only for accounts the user owns and names here, with their own token. Never print a full secret: give the type, location, and prefix plus last four. Checking that a key is live ("Verify it's live" below) uses the key, so ask first. That includes scanners that verify: trufflehog checks every candidate with its provider unless you pass `--no-verification`, so no secret scanner is pre-approved. Ask, use the provider's read-only identity call, and never use a found credential to read data. Rotation and history rewrites are the owner's call and always prompt.
The most useful first sweep is grep against known provider key prefixes. False positives are low and matches are almost always real.
These list matching files (`-l`) or counts (`-c`) rather than printing the match, so the secret isn't copied into your terminal scrollback or an agent transcript. Use the masked `rg` below when you need to tell keys apart.
# Stripe
grep -rlE "(sk_live_|sk_test_|rk_live_|whsec_)[A-Za-z0-9]{20,}" . \
--include="*.{js,ts,jsx,tsx,py,rb,go,java,php,sh,env,yml,yaml,json}"
# AWS access keys
grep -rlE "(AKIA|ASIA)[A-Z0-9]{16}" .
# AWS secret keys (40 chars, base64-y). High FP rate: lockfile integrity hashes match too. Counts per file first
grep -rcE "[A-Za-z0-9/+=]{40}" . --include="*.env*" --include="*.json" | grep -v ':0$'
# GitHub
grep -rlE "gh[pousr]_[A-Za-z0-9]{36}" .
# Google Cloud API key + service-account JSON
grep -rlE "AIza[A-Za-z0-9_-]{35}" .
grep -rln '"type": "service_account"' . --include="*.json"
# Slack
grep -rlE "xox[baprs]-[A-Za-z0-9-]+" .
# OpenAI / Anthropic
grep -rlE "sk-[A-Za-z0-9]{32,}" .
grep -rlE "sk-ant-[A-Za-z0-9_-]{90,}" .
# Generic high-entropy values in env files: variable names and line numbers, value masked to first/last 4
grep -rnE "^[A-Z_]+=[A-Za-z0-9/+=]{32,}$" . --include="*.env*" | sed -E 's/=(.{4}).*(.{4})$/=\1…\2/'For full repo coverage, use `git ls-files` to scope to tracked files and avoid `node_modules`:
git ls-files | xargs grep -lE 'sk_live_|ghp_|AKIA[A-Z0-9]{16}|sk-ant-|AIza[A-Za-z0-9_-]{35}' 2>/dev/null**Running these inside an AI agent session?** Every match the agent prints is written into that session's transcript (see the agent section below), which creates a new copy of the secret. List files (`-l`) or counts (`-c`), or mask the value to prefix + last 4 when you need to tell keys apart:
rg -o -r '$1…$2' '(sk_live_|rk_live_|sk-ant-|ghp_|github_pat_|AKIA|xox[baprs]-|AIza)[A-Za-z0-9_-]{8,}([A-Za-z0-9]{4})' .A prefix match tells you the provider, not the authority. Several providers issue keys that are public by design, and the same prefix can cover both. Before rating, establish what kind of key it is and what it can do — the severity follows the authority, not the match ([references/severity-calibration.md](references/severity-calibration.md)).
| Provider | Publishable (meant for clients) | Restricted / scoped | Secret (full authority) | |---|---|---|---| | Google | `AIza…` browser / Maps / Firebase keys — fine when application restrictions (referrer, app, IP) and API restrictions are set | Same `AIza…` prefix with API restrictions; check which APIs it can call in Cloud Console →
A collection of cybersecurity skills for AI coding agents. The AI does the heavy lifting; you bring the context about your stack and your priorities.
Audit the extensions AI coding agents load and trust (skills, plugins, marketplaces, hooks, settings, MCP servers, and…
Apply the NIST AI Risk Management Framework (AI RMF 1.0) and adjacent guidance to AI / ML systems — model lifecycle governance,…
Audit REST, GraphQL, and RPC APIs against the OWASP API Security Top 10 (2023). Use when the user mentions 'API security,' 'API…
Learn from public breach disclosures — extract the audit question each one implies and check your own stack. Capital One IMDS…
Test an authorized web application for business-logic flaws and race conditions — the classes scanners cannot find. Model…
Audit CI/CD pipelines, GitHub Actions first and GitLab CI and CircleCI briefly, for the paths that give an outsider code…
Use for authorized security assessment of REST, GraphQL, WebSocket, or SOAP APIs, including discovery, authentication,…
Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys)…
Clean and finalize authorized natural-language text intended for readers by auditing suspicious invisible Unicode and rewriting…