Scan codebase for secrets, API keys, credentials, and PII. Detect hardcoded sensitive data. Use when auditing for secrets, checking for exposed keys, reviewing security, or scanning for PII.
Detects hardcoded secrets and sensitive data in the codebase.
| Type | Pattern | Example |
| --------------- | --------------------------------- | ----------------------- |
| API Keys | [a-zA-Z0-9_-]{32,} | OpenAI, Anthropic, etc. |
| AWS Credentials | AKIA[A-Z0-9]{16} | AKIAIOSFODNN7EXAMPLE |
| Private Keys | -----BEGIN.*PRIVATE KEY----- | RSA, SSH keys |
| JWT Secrets | jwt.*=.*['"][a-zA-Z0-9+/=]{20,} | Signing secrets |
| Database URLs | postgres://.*:.*@ | With password |
| Bearer Tokens | Bearer [a-zA-Z0-9._-]+ | Hardcoded tokens |
| Type | Pattern |
| --------------- | ---------------------- |
| Generic secrets | secret.*=.*['"] |
| Passwords | password.*=.*['"] |
| Tokens | token.*=.*['"] |
| API keys | api[_-]?key.*=.*['"] |
| Type | Pattern |
| --------------- | ---------------------------------------------------------- |
| Email addresses | [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,} |
| Phone numbers | \+?1?[-.\s]?\(?[0-9]{3}\)?[-.\s]?[0-9]{3}[-.\s]?[0-9]{4} |
| SSN | \d{3}-\d{2}-\d{4} |
| Credit cards | \d{4}[-\s]?\d{4}[-\s]?\d{4}[-\s]?\d{4} |
These files are expected to have secret-like patterns:
.env.example - Template placeholders only*.test.ts - Test fixturesGrep: (OPENAI_API_KEY|ANTHROPIC_API_KEY|sk-[a-zA-Z0-9]{32,})
Exclude: .env.example, *.md, node_modules
Grep: (password|secret|credential|token)\s*[:=]\s*['"][^'"]+['"]
Exclude: .env.example, node_modules
Grep: -----BEGIN.*PRIVATE KEY-----
Grep: (postgres|mysql|mongodb)://[^:]+:[^@]+@
Exclude: .env.example, docker-compose.yml
Glob: **/.env*
Read: Each file (except .env.example)
Ensure .env is in .gitignore.
## Secrets Scan Report
### 🔴 Critical Findings
{List of actual secrets found with file:line}
### 🟡 Suspicious Patterns
{Patterns that look like secrets but may be false positives}
### ✅ Verified Safe
- .env.example contains only placeholders
- Test files use mock values
- .gitignore excludes .env files
### Recommendations
{Actions to take}
Common false positives:
sk-example-key-123test-token-abcOPENAI_API_KEY=Verify by checking:
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer