scan_git_history
Scan git history to uncover secrets (API keys, passwords, tokens) committed even if later deleted. Receive each finding with commit hash, severity, and rotation status.
Instructions
Scan the git commit history of a repository for secrets that were ever committed, even if later deleted. Detects hardcoded API keys, tokens, passwords, and other credentials added in diff hunks across recent commits. Returns each finding with its commit hash, file, line, severity, a masked preview, entropy score, whether the secret is still present in the working tree, and whether rotation is required. Respects .gitleaksignore.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo_path | Yes | Absolute path to the git repository root to scan | |
| since_days | No | Only scan commits from the last N days (default: 30) | |
| last_n_commits | No | Maximum number of recent commits to scan (default: 50) |