Scan files for leaked secrets (cloud, GitHub, Slack, Stripe, Google, AI keys, private keys, high-entropy assignments) with output that never prints the secret. Use when the user asks to check staged files or a repo for secrets before committing.
95%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Medium
Suggest reviewing before use
Each line of a file is tested against every rule. Token rules only match when the token is not touching another letter, digit or underscore. After a match, the search continues after the secret.
| Rule id | Detects | Pattern (secret part) |
|---|---|---|
aws-access-key-id | AWS access key ID | (A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z2-7]{16} |
github-token | GitHub personal, OAuth, user, server, refresh token | gh[pousr]_[A-Za-z0-9]{36} |
github-fine-grained-pat | GitHub fine-grained token | github_pat_[A-Za-z0-9_]{82} |
slack-token | Slack token | xox[baprs]-[A-Za-z0-9-]{10,200} |
stripe-live-key | Stripe live secret or restricted key | (sk|rk)_live_[A-Za-z0-9]{24,99} |
google-api-key | Google API key | AIza[A-Za-z0-9_-]{35} |
anthropic-api-key | Anthropic API key | sk-ant-api03-[A-Za-z0-9_-]{93}AA |
openai-api-key | OpenAI API key | sk-[A-Za-z0-9_-]{20,}T3BlbkFJ[A-Za-z0-9_-]{20,} |
private-key-block | Private key header | -----BEGIN[ A-Z]*PRIVATE KEY----- |
generic-assignment | Quoted value of 12+ characters assigned to a name containing key, secret, token, password, passwd or api_key | see below |
generic-assignment (case-insensitive): name, then : or =, then a quoted value of 12 or more
characters without spaces or quotes. The value must have Shannon entropy of at least 3.5 bits per byte,
so repeated or dictionary-like placeholders are not reported.
The output shows the first characters of the secret, at most half of them and never more than four,
then ****. Length is not revealed. Control characters become ?.
Symlinks, directories, special files, files over 1 MiB, files with a NUL byte in the first 8 KiB, and paths matching the allowlist. Windows line endings give the same columns as Unix ones. Columns count characters.
A line containing secrets-precommit:allow is ignored for all rules.