AGENT SKILL

secret-scan

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.

License 许可
MIT
所属仓库
bg-szy/TOP-SKILLS
最近更新
2026-11-15
Stars
★ 6
Forks
0

01 前言 Front Matter

name
secret-scan
license
MIT
metadata
{ "author": "Nex AI", "version": "1.1", "agensi-slug": "secret-scan" }
description
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.
compatibility
Works with any agent that can run Python 3.8+: Claude Code, Codex, Cursor, Windsurf, Cowork. git is needed for staged, diff and history scans. The agent hook is for Claude Code.

02 资源文件 1

03 SKILL.md 正文

Secret Scan

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.

What it does

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

Rules that fit real projects

  • 39 provider-specific rules: Anthropic, OpenAI, AWS, GitHub, GitLab, Stripe, Slack, Google, Groq, Supabase, Databricks, Telegram, Discord, Twilio, SendGrid, npm, PyPI, Hugging Face, Shopify, DigitalOcean, Azure and more
  • Tuned heuristics for passwords, connection strings, config values, bearer tokens and committed .env files
  • Low noise: placeholders, ${VAR}, os.environ[...], lockfiles and fixtures handled. Zero failing findings on two real open-source repositories of about 3,000 files
  • Output is always redacted, with where to rotate each key. JSON and SARIF for GitHub code scanning. Baseline for existing repos

Guard rails

  • A git pre-commit hook that keeps your existing hook
  • A Claude Code hook that blocks the agent from writing a key into a tracked file, or committing or pushing one (including git 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 itself

Includes 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

When to use

  • 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
  • Scan a package, skill or zip before publishing it
  • Check text for keys before pasting it into a chat, ticket or document

Known limitations

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.

Example

Request

I'm about to make this repo public. Check it for leaked keys first, including old commits.

Result

Not ready to go public yet: 3 secrets found

$ 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 medium

The Anthropic key is no longer in the code, but it is still in commit 777f163. Anyone who clones the public repo gets it.

Do this, in this order

  1. Rotate the Anthropic key in the Claude Console and the Slack webhook in your Slack app settings. Removing them from git does not make them safe.
  2. Move the values to the environment: I replaced them with 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.
  3. Rewrite history before publishing, since the repo is going public: git filter-repo --replace-text on a mirror clone (exact commands are in references/remediation.md), then push the mirror.
  4. Re-scan: secret_scan.py --history must come back clean.
  5. Guard: secret_scan.py install-hook blocks this at commit time from now on.

Questions

Does it check whether a key is live?

No. That would mean sending your keys to the provider. Treat high and critical findings as live and rotate them.

Gitleaks and TruffleHog already exist. Why this?

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.

What if it flags something that is not a secret?

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

04 同仓库更多 Skills

bg-szy
bg-szy/TOP-SKILLS

serpmaven

Scrape Google search results (SERP) to JSON with SERP Maven (serpmaven) - a real Chrome browser on a residential proxy with sticky sessions. Run it as a CLI, a Python library, a local HTTP search API (`serve`), an MCP server or a Docker image; set the proxy login, workers, pages and cost tracking. Use when the user wants Google results, rank tracking, a self-hosted SERP API, or live Google search for an AI agent.

★ 6
bg-szy
bg-szy/TOP-SKILLS

revnu-landing-page-audit

Find out why a landing page isn't turning visitors into signups, demos or sales. Audits one page against what the ad, post or search that sends people there promised, then checks the first screen, proof, call to action, friction and mobile. Returns at most 7 prioritized fixes, plus what is fine and what could not be checked; rewrites specific lines and fixes the page in the repo when asked. Never promises a conversion lift. Works without a Revnu account. Use when the user says or asks: "audit my landing page", "why isn't this page converting", "review my homepage", "my ads get clicks but no signups", "people bounce from the pricing page", "CRO review", "improve conversion rate", "is my hero section clear", "roast my landing page", "rewrite my headline", "what's wrong with this page", "landing page feedback", "make the signup page convert better". Not for SEO or AI-search audits, page speed engineering on its own, or building a new page from scratch.

★ 6
bg-szy
bg-szy/TOP-SKILLS

revnu-growth-context

Write down once who buys, what they're stuck on, what it costs, what proof you have and what you've already tried, so every growth task starts from facts instead of a questionnaire. Creates or updates .agents/revnu-growth.md from the repo, the live site and the user, and imports an existing product-marketing.md. Use when the user says "set up our marketing context", "who is our ideal customer", "write our ICP", "describe the product for marketing", "positioning doc", "what's our brand voice", "remember this about our customers", "log what we tried", "what have we learned from marketing", "we changed pricing, update the context", "update our growth notes", "summarize the business for the agent", "import my product-marketing.md", "start a growth doc", or before a first marketing, SEO, outreach or launch task when no context file exists. Works without a Revnu account.

★ 6
bg-szy
bg-szy/TOP-SKILLS

revnu-get-listed

Get onto the third-party pages AI answers and search cite when buyers ask for the best tool in your category: "best X" roundups, directories, review sites, GitHub awesome lists, community threads and comparison pages. Finds which ones are cited, ranks them by fit and effort, and drafts each submission, PR or pitch by the target's own rules. Use when the user says "get us listed", "which directories should we submit to", "how do we get into best-of lists", "why does ChatGPT recommend competitors and not us", "get mentioned in AI answers", "submit to awesome lists", "get on G2", "where are our competitors listed", "pitch listicle authors", "find backlink opportunities", "launch directories", "get into roundups", "Product Hunt alternatives", "where should we be listed", "get cited by Perplexity". Never submits, pays or posts without a yes. Works without a Revnu account.

★ 6
bg-szy
bg-szy/TOP-SKILLS

revnu-ai-readiness-audit

Audit whether your website gives ChatGPT, Perplexity, Claude, Gemini and Google's AI Overviews something worth quoting, and fix the pages that don't. Use when the user says or asks "is my site ready for AI search", "audit my site for AI answers", "AEO audit", "GEO audit", "why doesn't ChatGPT quote our pricing", "make our pages citable by AI", "do I need llms.txt", "does schema help with ChatGPT", "check our structured data", "is our content visible without JavaScript", "AI SEO audit", "optimize our homepage for AI answers", "LLM SEO check", "why does AI get our product wrong", "fix our site for AI Overviews". Checks fetchability and indexability, answers in the raw HTML, entity facts, schema (including JS-injected markup), headings, dates and llms.txt, then gives at most 10 prioritised fixes and edits the repo when asked. Works without a Revnu account.

★ 6
bg-szy
bg-szy/TOP-SKILLS

proxy-troubleshooting

Diagnose residential proxy failures, with NodeMaven's gateway as the reference - 407 with correct credentials, 406, 410, 500, a connection that hangs, ERR_TUNNEL_CONNECTION_FAILED in a browser, Playwright or Puppeteer ignoring proxy credentials, a sticky session that changes IP, geo-targeting that is silently ignored, passwords with special characters, and unexpected traffic from headless Chrome. Use when a proxy connection fails, returns the wrong location, or costs more traffic than expected.

★ 6