secret-scanner

v1.1.1
io.github.GuardBee/secret-scanner Checked 1 day ago Published 1 month ago

Scans files for leaked secrets and API keys

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

scan_text

Scan a text string or code snippet for exposed secrets and API keys

ParameterTypeDescription
content *stringThe text content to scan
entropybooleanAlso flag random-looking values assigned to secret-like names (default true)
labelstringOptional label shown in findings (e.g. filename)

scan_file

Scan a single file for exposed secrets and API keys

ParameterTypeDescription
path *stringAbsolute or relative path to the file to scan
entropybooleanAlso flag random-looking values assigned to secret-like names (default true)

scan_directory

Recursively scan a directory for exposed secrets and API keys. Automatically skips node_modules, .git, dist, and binary files.

ParameterTypeDescription
path *stringAbsolute or relative path to the directory to scan
baselinestringPath to a baseline file: only findings not in it are reported
entropybooleanAlso flag random-looking values assigned to secret-like names (default true)
excludearraySkip files/dirs whose path contains one of these strings
includearrayOnly scan files whose path contains one of these strings (e.g. [".env", ".ts"])
maxFilesintegerMaximum number of files to scan (default: 5000)

scan_git

Scan a git repository for secrets in what git says was added: the staged changes (before a commit) or every commit's added lines (history). History finds secrets that were deleted from the files but are still in the repository.

ParameterTypeDescription
mode *stringstaged: lines added in the index; history: lines added by each commit
path *stringA directory inside the git repository
baselinestringPath to a baseline file: only findings not in it are reported
entropybooleanAlso flag random-looking values assigned to secret-like names (default true)
maxCommitsintegerHistory only: stop after this many commits
rangestringHistory only: a revision range such as main..HEAD (default: all refs)

scan_agent_history

Scan the transcripts coding agents keep on this machine (Claude Code, Codex, Gemini CLI, Continue) for secrets that were pasted into a chat or printed by a command. Such a secret was already sent to the model provider and should be rotated. Each secret is reported once with how often it appears.

ParameterTypeDescription
entropybooleanAlso flag random-looking values assigned to secret-like names (default false here: transcripts hold a lot of code)

list_patterns

List all secret patterns that the scanner can detect