Secret detection

From vladkesler/initrunner · View interactive version

Secret detection is an AI agent skill from the GitHub repository vladkesler/initrunner. Detect hardcoded secrets, API keys, tokens, and credentials in source code using pattern matching. Covers AWS, GitHub, Slack, Stripe, and generic high-entropy strings.

How to use this skill

Skill file

Secret detection skill using ripgrep pattern matching.

When to activate

Always activate this skill regardless of project language. Secrets can

appear in any file type.

Scanner commands

Run each pattern separately via shell. Exclude lock files and

node_modules from all scans.

AWS credentials

rg -n '(?i)(AKIA[0-9A-Z]{16}|aws.{0,20}secret.{0,20}['\''"][0-9a-zA-Z/+]{40})' --glob '!*.{lock,sum}' --glob '!node_modules/**'

GitHub tokens

rg -n '(ghp_[a-zA-Z0-9]{36}|github_pat_[a-zA-Z0-9]{22}_[a-zA-Z0-9]{59})' --glob '!*.{lock,sum}' --glob '!node_modules/**'

Generic secrets

rg -n '(?i)(password|secret|api_key|apikey|token)\s*[=:]\s*['\''"][^'\''"]{8,}' --glob '*.{py,js,ts,yaml,yml,json,env,toml,cfg,ini,conf}' --glob '!node_modules/**'

Private keys

rg -n 'BEGIN (RSA |EC |OPENSSH )?PRIVATE KEY' --glob '!node_modules/**'

Verification

For each match:

  1. Check the file path. Skip these:
  1. Check the value. Skip if it contains:

"TODO", "REPLACE", "insert", "dummy", "fake", "test"

  1. Check the context. Skip if:

(os.environ, process.env)

MUST flag

placeholders

MUST NOT flag

placeholder values

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.