Scan files or staged changes for secrets
scan_secretsDetect hardcoded secrets in files, directories, or staged Git changes before commit. Reports file, line, secret type, and a masked value preview without exposing originals.
Instructions
Pre-commit check. Scans files or directories (paths) and/or the lines added in the staged git diff (staged: true) for known secret patterns. Lists only file:line, the secret type and a masked preview (at most the first 4 characters of values of 20+ characters; short values are shown as an ellipsis), never the original value. Provide paths, staged, or both. Heuristic: a clean result is not proof that nothing sensitive is present.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| paths | No | Files or directories to scan. Directories are walked recursively (skipping .git, node_modules, build output and symlinks; at most 2000 files). | |
| staged | No | When true, scan only the lines added in `git diff --cached` (the staged changes) in the server working directory. |