Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Scans the full git history of a repository for leaked secrets, API keys, tokens, and credentials. Triggered when a user asks to audit commits for exposed credentials, run a pre-publish security check, or scan git history for sensitive data. Produces a severity-ranked findings table with remediation commands. Read-only — never modifies git history automatically.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-15 | ✗→✓ | ▲ Improved | 23% | 0% |
| case-16 | ✗→✓ | ▲ Improved | 66% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 39% | 0% |
| case-22 | ✗→✓ | ▲ Improved | 90% | 0% |
| case-25 | ✗→✓ | ▲ Improved | 53% | 0% |
Scan the entire git history of a repository for leaked secrets, credentials, and sensitive tokens.
Do NOT scan only the working tree. Secrets may exist in deleted files or amended commits.
bash# Get all diffs across entire history (all branches, all commits) git log -p --all --diff-filter=ACMR --no-color
For targeted scanning of specific branches:
bashgit log -p <branch> --no-color
For scanning only added files (initial introductions of secrets):
bashgit log --all --diff-filter=A --name-only --pretty=format:"%H %ai"
Apply regex patterns against every + line (additions) in every diff hunk.
| Provider | Pattern | |-------------|----------------------------------------------------------------| | AWS Key ID | AKIA[0-9A-Z]{16} | | AWS Secret | aws_secret_access_key\s*[:=]\s*['"]?[A-Za-z0-9/+=]{40} | | GitHub PAT | ghp_[0-9a-zA-Z]{36} | | GitHub OAuth| gho_[0-9a-zA-Z]{36} | | GitHub Fine | github_pat_[0-9a-zA-Z_]{82} | | Stripe Live | sk_live_[0-9a-zA-Z]{24,} | | Stripe Restricted | rk_live_[0-9a-zA-Z]{24,} | | Private Key | -----BEGIN (RSA\|EC\|DSA )?PRIVATE KEY----- |
| Provider | Pattern | |-----------------|------------------------------------------------------------| | Sentry Auth | sntryu_[0-9a-f]{64} | | Slack Token | xox[bpors]-[0-9a-zA-Z-]{10,} | | Vercel Token | [A-Za-z0-9]{24} (in context of VERCEL_TOKEN or header)| | SendGrid | SG\.[0-9A-Za-z_-]{22}\.[0-9A-Za-z_-]{43} | | Twilio | SK[0-9a-fA-F]{32} | | Supabase Key | eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9\.[A-Za-z0-9_-]+ |
| Type | Pattern | |------------------|-----------------------------------------------------------| | Generic password | password\s*[:=]\s*['"][^'"]{8,}['"] | | Generic secret | secret\s*[:=]\s*['"][^'"]{8,}['"] | | Generic token | token\s*[:=]\s*['"][^'"]{16,}['"] | | Connection string| (mongodb\+srv\|postgres\|mysql):\/\/[^\s'"]+ | | Base64 blob | [A-Za-z0-9+/=]{40,} (contextual — only flag when near key/token/secret keywords) |
Present findings as a markdown table sorted by severity:
| # | Severity | Commit | Date | File | Pattern | Snippet (masked) |
|---|----------|------------|------------|-----------------------|-----------------|------------------|
| 1 | CRITICAL | a1b2c3d | 2025-03-15 | src/config.ts | AWS Key ID | AKIA****XXXX |
| 2 | CRITICAL | e4f5g6h | 2025-02-01 | .env | Stripe Live Key | sk_live_**** |
| 3 | HIGH | i7j8k9l | 2025-01-20 | lib/sentry.js | Sentry Auth | sntryu_**** |
| 4 | MEDIUM | m0n1o2p | 2024-12-10 | docker-compose.yml | Generic password| ******** |Always mask the middle portion of any found secret. Never display full credentials in output.
For each finding, provide:
CRITICAL: Rotate ALL found credentials immediately.
- AWS: IAM Console > Security Credentials > Create New Access Key > Deactivate Old
- GitHub: Settings > Developer Settings > Personal Access Tokens > Regenerate
- Stripe: Dashboard > Developers > API Keys > Roll Key
- Sentry: Settings > Auth Tokens > Revoke & Create NewUse git filter-repo (NOT git filter-branch which is deprecated):
bash# Install if needed pip install git-filter-repo # Remove a specific file from all history git filter-repo --invert-paths --path <file-path> # Replace a specific string across all history git filter-repo --replace-text <(echo 'AKIA1234567890ABCDEF==>REDACTED')
bash# WARNING: This rewrites shared history. Coordinate with all collaborators. git push --force --all git push --force --tags
Warn the user explicitly:
filter-repo — this rewrites ALL commit SHAsgit fetch --all && git reset --hard origin/<branch>Recommend adding a .gitignore entry and a pre-commit hook:
bash# .gitignore additions .env .env.local .env.*.local *.pem *.key # Pre-commit hook (save as .git/hooks/pre-commit) #!/bin/bash if git diff --cached | grep -qE 'AKIA|sk_live_|ghp_|-----BEGIN.*PRIVATE KEY'; then echo "ERROR: Potential secret detected in staged changes. Aborting commit." exit 1 fi
Other measured skills in the registry, with their headline benchmark lift.