Secret Detector
CautionScans codebases, configuration files, and git history for exposed credentials, API keys, tokens, and other sensitive secrets that should not be committed.
Install
Claude Code
Copy the SKILL.md file to your project's .claude/skills/ directory About This Skill
Secret Detector scans your codebase for exposed credentials and sensitive secrets. It uses pattern matching and entropy analysis to find API keys, database passwords, private keys, OAuth tokens, and other credentials that should never be committed to version control.
How It Works
- Pattern scanning — Matches against 200+ known secret patterns (AWS keys, GitHub tokens, Stripe keys, JWT secrets, etc.)
- Entropy analysis — Detects high-entropy strings that may be randomly generated secrets
- Git history scan — Examines all commits, including deleted files and force-pushed history
- Context analysis — Distinguishes real secrets from test fixtures, examples, and documentation
- Remediation advice — Provides steps to rotate compromised secrets and prevent future leaks
Best For
- Pre-commit hooks to prevent secret leaks before they happen
- Auditing repositories after team member offboarding
- Compliance checks for SOC 2 and PCI DSS requirements
- Reviewing open-source contributions for accidental secret exposure
Detection Coverage
Covers AWS, GCP, Azure, GitHub, GitLab, Slack, Stripe, Twilio, SendGrid, database connection strings, private keys (RSA, SSH, PGP), and JWT signing secrets.
Use Cases
- Pre-commit scan for accidentally staged secrets
- Full repository scan including git history for leaked keys
- Audit .env files, docker-compose, and CI config for hardcoded credentials
- Verify .gitignore properly excludes secret-containing files
Pros & Cons
Pros
- + 200+ built-in patterns covering major cloud and SaaS providers
- + Git history scanning catches secrets in deleted commits
- + Context-aware reduces false positives from test fixtures
Cons
- - Cannot rotate or revoke found secrets automatically
- - Entropy-based detection may flag non-secret random strings
Related AI Tools
Snyk
Freemium
AI-powered developer security platform for code, dependencies, and containers
- AI-powered static application security testing (SAST)
- Open-source dependency vulnerability scanning (SCA)
- Container image security scanning
GitHub Copilot
Freemium
AI pair programmer that suggests code in real time across your IDE
- Real-time code completions across 30+ languages
- Copilot Chat for natural language code Q&A
- Pull request description and summary generation
Related Skills
Stay Updated on Agent Skills
Get weekly curated skills + safety alerts
每周精选 Skills + 安全预警