scan_codebase_for_secrets
Walk a directory tree to flag plausible hardcoded secrets using regex heuristics and entropy scoring. Run this read-only audit before commit or release to catch leaks in a repo.
Instructions
[scan] Walk a directory tree and flag plausible hardcoded secrets using regex heuristics plus Shannon-entropy scoring on string literals. Use as a one-shot 'is anything leaking in this repo?' audit before commit/release; prefer lint_files when you already know the specific files to check (and want optional auto-fix). Read-only — never modifies source files. Honors .gitignore. Returns JSON array of { file, line, key, value, kind } findings, or 'No hardcoded secrets found in the specified directory.' when clean. False positives are possible — review before treating as ground truth.
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": {
"dirPath": "<dirPath>"
},
"name": "scan_codebase_for_secrets"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dirPath | Yes | Directory to scan, absolute or relative to the server cwd. The scan recurses into subdirectories. |