scan_git_history
Scans recent Git commits for exposed secrets, tagging each finding with the commit hash that introduced it. Detects credentials even if later deleted so they can be rotated.
Instructions
Scan the lines added by the most recent commits (git log -p).
Each finding is tagged with the short hash of the commit that introduced it. A secret that was later deleted is still reported — history retains it, so the credential must be rotated regardless.
Args: repo_path: Absolute path to a git repository (or any path inside one). max_commits: How many commits back to inspect (default 50). all_branches: Walk every branch, tag and the stash instead of only the history of HEAD (default false). max_findings: List at most this many findings, most severe first (default 200, 0 = no limit).
Returns: The standard redacted findings report, with a "commit" field on each finding.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"repo_path": "<repo_path>"
},
"name": "scan_git_history"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo_path | Yes | ||
| max_commits | No | ||
| all_branches | No | ||
| max_findings | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clean | Yes | ||
| summary | Yes | ||
| findings | Yes | ||
| baselined | No | ||
| top_files | No | ||
| truncated | No | ||
| suppressed | No | ||
| files_scanned | Yes | ||
| total_findings | No | ||
| counts_by_pattern | No | ||
| counts_by_severity | No |