cwinvestments/memstack/secrets-scanner
Claude Code and agent skill by cwinvestments/memstack
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Use this skill when the user says 'scan for secrets', 'check for leaked keys', 'secrets scanner', 'hardcoded credentials', 'API key leak', or needs to detect exposed secrets in source code. Do NOT use for dependency vulnerabilities or RLS auditing.
Install
npx vskill@latest install cwinvestments/memstack/secrets-scannerSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as cwinvestments/memstack/secrets-scanner.
🔑 Secrets Scanner: Scanning for Exposed Credentials...
Scan a codebase for hardcoded secrets, leaked API keys, and credential exposure across files and git history.
Activation
When this skill activates, output:
🔑 Secrets Scanner: Scanning for Exposed Credentials...
Then execute the protocol below.
Context Guard
| Context | Status | |
|---|---|---|
| User asks to scan for secrets/keys | ACTIVE: full scan | |
| User mentions credential exposure | ACTIVE: full scan | |
| User asks about .env security | ACTIVE: targeted .env audit | |
| Pre-deployment security review | ACTIVE: full scan | |
| User is creating .env files | DORMANT: let them work |
⚠️ Enforcement lives in CLAUDE.md, not here
This skill cannot be the control that prevents secret leaks. Skill matching is semantic and probabilistic: it misses. In a real session that leaked a live SendGrid production key, the query "rotate object storage credentials S3 bucket key move secrets rotation" scored this skill at 0.24 and it never loaded. The task was credential handling end to end.
Therefore the hard rule ("never print a secret value") belongs in always-loaded context, a project CLAUDE.md block, which loads unconditionally regardless of matching, MCP reachability, or hooks. This skill carries the operational how-to below; `CLAUDE.md` carries the prohibition. If you are reading this skill and the project has no secrets block in CLAUDE.md, adding one is the highest-value fix available, ahead of any scan.
Safe Inspection Patterns (use these any time you touch a secrets file)
Rule: allowlist names, never denylist values
Redaction by denylist is the single most common way secrets leak during "safe" inspection. A pattern that redacts KEY=, SECRET=, PASSWORD= looks thorough and silently fails on SENDGRID_API_KEY_PROD=, STRIPE_SECRET_KEY_TEST=, DB_PASSWORD_2=: any suffixed variant. Never enumerate what to hide. Emit only what is provably safe: names.
Verifying a value without revealing it
Most real questions ("is it the right key?", "did the paste get mangled?", "do prod and dev match?") are answerable without the value:
Atomic .env editing
Never edit .env in place, and never leave a plaintext backup. A .env.bak recreates exactly the exposure that rotation exists to remove.
Read and write in byte mode. Python text mode applies universal-newline translation and silently rewrites every line ending in a CRLF file, turning a one-line edit into a whole-file diff.
Secrets that do not look like secrets
- Capability URLs. An unguessable object key, presigned URL, or invite link is a
credential, its security is precisely that nobody has seen it. Printing one to a transcript, a commit message, or a log destroys it. Treat like a password.
- Endpoints containing account IDs.
https://<account-id>.r2.cloudflarestorage.comis not
a credential but is an infrastructure identifier; prefer not to broadcast it.
- Parsed env dicts in tracebacks. A script that loads
.envinto a dict can print that dict
from an exception handler. Ensure no parsed-env variable can reach an error path.
If a secret prints anyway
- Stop. Do not finish the task first.
- Flag it immediately and explicitly: name the variable, say where it went.
- Rotation is mandatory, not a judgement call. A value in a transcript is compromised
regardless of who you think can read the transcript.
- Audit the same output for co-leaked values before rotating, so rotation happens once.
Protocol
Step 1: Scan for Hardcoded Secrets (Check 1)
Search all tracked files for strings matching known secret patterns:
API Key Patterns:
Authentication Patterns:
Private Keys:
Flag as CRITICAL if found in any tracked file. Private keys should never be committed, use environment variables or secret managers.
Base64-Encoded Secrets:
Flag as WARNING if a base64 string is assigned to a variable with secret, key, token, or password in its name. Developers sometimes base64-encode secrets thinking it hides them: it doesn't.
Connection Strings:
Exclude false positives:
- Files in
node_modules/,.git/,dist/,.next/ - Test fixtures with obviously fake values (e.g.,
sk_test_fake123) - Environment variable references (
process.env.STRIPE_SECRET_KEYis safe, the variable itself, not a value) - Documentation showing example formats
Step 2: Audit .env File Security (Check 2)
Check if .env files are gitignored:
Flag as CRITICAL if:
.envor.env.localis currently tracked by git.envwas previously committed (secrets in git history even if now removed).gitignoredoes not contain.envpatterns
Check .env.example exists:
- Should contain all required env var names with placeholder values
- Should NOT contain real secrets (scan for patterns from Check 1)
Step 3: Scan Config and Documentation Files (Check 3)
Secrets often leak into files developers don't think about:
Flag as CRITICAL if real secrets found in any committed documentation or config.
Step 3b: Scan Deployment Platform Configs (Check 3b)
Secrets can leak into platform-specific deployment configurations:
Flag as CRITICAL if:
- Real secret values are hardcoded in any deployment config file
netlify.toml[build.environment]section contains secret values (these are committed to git, use Netlify UI environment variables instead)vercel.jsoncontains environment variable values (usevercel envCLI or Dashboard instead)
Flag as WARNING if:
- Deployment configs reference environment variable names without values (usually OK, but verify the names match what's configured in the platform)
Step 4: Check Environment Variable Usage (Check 4)
Verify env vars are validated at application startup:
Search for unvalidated env var usage:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/security/secrets-scanner/SKILL.md
Popularity
- Repository stars
- 412
- Repository forks
- 45
- 7-day trend score
- 30
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/cwinvestments/memstack/secrets-scanner)