Find leaked API keys, tokens and passwords in files, commits, history or pasted text, and stop your coding agent from writing or committing them. Use when: Check a repository and its full git history before making it public; Block commits that contain API keys with a pre-commit hook; Stop Claude Code from hardcoding a key or committing one.
79%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./plugins/nex-dev-essentials/skills/secret-scan/SKILL.mdThe canonical home for this skill is secret-scan in NexaiGuy/nex-ai-skills
Free skill by Nex AI. This file is the public guide from Agensi. Scripts, extension source, and templates from the original package are not in this folder.
One Python file that finds API keys, tokens, private keys and passwords before they reach a commit, a pushed branch, a chat message or a published package. Standard library only, no network: your code and secrets never leave the machine.
secret_scan.py # working tree
secret_scan.py --staged # before a commit
secret_scan.py --diff origin/main # a branch or PR
secret_scan.py --history # every commit, every branch
secret_scan.py package.zip # a package before publishing
secret_scan.py --stdin # text before you paste it.env files${VAR}, os.environ[...], lockfiles and fixtures handled. Zero failing findings on two real open-source repositories of about 3,000 filesgit add -A && git commit, git -C, and first pushes), tells it to use an environment variable instead, and cannot be waved through by the agent itselfIncludes a remediation playbook (rotate first, then fix, then decide about history) and CI recipes. 102 automated tests; the fake tokens in them are assembled at runtime, so the package itself scans clean.
Built by Nex AI, nex-ai.be
Pattern and entropy based: it finds the formats it knows and secret-looking assignments, and does not call providers to check whether a key is live. Skips binaries, files over 2 MB, lockfiles and source maps. History scans cover commits reachable from refs, not stashes or the reflog.
Request
I'm about to make this repo public. Check it for leaked keys first, including old commits.
Result
$ secret_scan.py --history
CRITICAL Anthropic API key
src/llm.py:2 @ 777f163563f4 (Dev)
sk-a************************rS fingerprint d0b5e145ef40a366
rotate: Claude Console, API keys: delete the key and create a new one.
HIGH Slack webhook URL
src/notify.py:1 @ 19b35b09f5ed (Dev)
http************************S7 fingerprint d560ac29ab5a8a8b
MEDIUM Secret-looking config value
config/settings.yml:3 @ 19b35b09f5ed (Dev)
3 finding(s) (git history): 1 critical, 1 high, 1 mediumThe Anthropic key is no longer in the code, but it is still in commit 777f163. Anyone who clones the public repo gets it.
os.environ["ANTHROPIC_API_KEY"], os.environ["SLACK_WEBHOOK_URL"] and ${DB_PASSWORD}, added the names to .env.example, and confirmed .env is git-ignored.git filter-repo --replace-text on a mirror clone (exact commands are in references/remediation.md), then push the mirror.secret_scan.py --history must come back clean.secret_scan.py install-hook blocks this at commit time from now on.No. That would mean sending your keys to the provider. Treat high and critical findings as live and rotate them.
They are excellent in CI. This needs nothing installed beyond Python, runs anywhere an agent runs, and comes with the agent hook and the remediation playbook.
Add secret-scan: allow on the line, add the fingerprint to .secretscanignore, or create a baseline for an existing repo. In the Claude Code hook, only you can allow high and critical findings.
Built by Nex AI. More skills, including the paid catalog: https://www.agensi.io/creators/ch1n4-g3nd4x
NexaiGuy/nex-ai-skills
4034c84
Canonical home
since Nov 1, 2026
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.