Agent skill

Scanning For Hardcoded Secrets

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Scan a source-code tree for hardcoded credentials embedded in source files: AWS access keys, GitHub tokens, Stripe keys, Slack tokens, Anthropic API keys, OpenAI keys, JWT signing secrets, generic…

MITAuto-check: notesDevOps & Cloud

Install Scanning For Hardcoded Secrets

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill scanning-for-hardcoded-secrets -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace scanning-for-hardcoded-secrets --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/scanning-for-hardcoded-secrets .claude/skills/scanning-for-hardcoded-secrets && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
scanning-for-hardcoded-secrets
GitHub stars
2.8k
Token cost
~2.1k tokens
SKILL.md length
707 words
Files
4 (incl. scripts, references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Scan a source-code tree for hardcoded credentials embedded in source files: AWS access keys, GitHub tokens, Stripe keys, Slack tokens, Anthropic API keys, OpenAI keys, JWT signing secrets, generic…

  • Works in 4 steps: Identify the scan target → Run the scanner → Interpret findings → …
  • : pre-commit gate before pushing a feature branch
  • SKILL.md covers Overview, When the skill produces findings, Prerequisites and Instructions, plus 4 more sections
  • Runs Python scripts from its folder; calls python3, git and jq; needs JWT_SECRET

What it does

Scanning For Hardcoded Secrets is an agent skill from jeremylongshore/tons-of-skills-marketplace. Scan a source-code tree for hardcoded credentials embedded in source files: AWS access keys, GitHub tokens, Stripe keys, Slack tokens, Anthropic API keys, OpenAI keys, JWT signing secrets, generic base64-encoded passwords, RSA / SSH private keys, and high-entropy string literals that pattern-match common credential shapes. Use when: pre-commit gate before pushing a feature branch, audit before SOC2, post-incident scan after a leak, or inheriting a codebase you didn't write. Threshold: any source file contains a…

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including scripts and reference files (for example `references/PLAYBOOK.md`, `references/THEORY.md` and `scripts/scan_secrets.py`). Compatibility notes: Designed for Claude Code

It sits in DevOps & Cloud, covering Secrets management, Authentication and SOC 2 and security compliance. It works with Amazon Web Services, GitHub, Slack and Stripe. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • : pre-commit gate before pushing a feature branch
  • Audit before SOC2
  • Post-incident scan after a leak
  • Inheriting a codebase you didnt write

Example prompts

  • “scan secrets”
  • “credential scan”
  • “find hardcoded keys”
  • “/scanning-for-hardcoded-secrets”

Requirements

  • Python 3
  • A credential in JWT_SECRET
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Bash(python3:*), Glob, Grep

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Identify the scan target
  2. Run the scanner
  3. Interpret findings
  4. Remediation

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Bash(python3:*)
    • Glob
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3
    • git
    • jq

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • JWT_SECRET

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Scanning For Hardcoded Secrets loads about 2.1k tokens when it runs, and up to ~5.9k if it reads all its reference files. Until then it costs about 203 tokens; SKILL.md has 707 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~203
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:27
    - Write(.env)
  • NoteMentions a .env fileSKILL.md:28
    - Edit(.env)
  • NoteMentions a .env fileSKILL.md:83
    | `.env`-shaped KEY=VALUE in non-`.env` file | **HIGH** | Multiple `[A-Z_]+=` lines in `.py`/`.js`/`.md` files | CWE-200
  • NoteMentions a .env fileSKILL.md:213
    (Python dotenv, Node .env+dotenv, Ruby Rails credentials, Go

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 707 words, ~2,115 tokens.

Download SKILL.mdSave it as .claude/skills/scanning-for-hardcoded-secrets/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
scanning-for-hardcoded-secrets
description
Scan a source-code tree for hardcoded credentials embedded in source files: AWS access keys, GitHub tokens, Stripe keys, Slack tokens, Anthropic API keys, OpenAI keys, JWT signing secrets, generic base64-encoded passwords, RSA / SSH private keys, and high-entropy string literals that pattern-match common credential shapes. Use when: pre-commit gate before pushing a feature branch, audit before SOC2, post-incident scan after a leak, or inheriting a codebase you didn't write. Threshold: any source file contains a string that matches a canonical credential regex (AWS AKIA prefix, GitHub ghp_ prefix, etc.) OR a string with Shannon entropy above 4.5 in a field context (key=, token:, secret=). Trigger with: "scan secrets", "credential scan", "find hardcoded keys", "leak check".
allowed-tools
Read, Bash(python3:*), Glob, Grep
compatibility
Designed for Claude Code
disallowed-tools
Bash(rm:*), Bash(curl:*), Bash(wget:*), Write(.env), Edit(.env)
version
3.30.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
license
MIT
tags
security, static-analysis, secrets, pentest

Scanning for Hardcoded Secrets

Overview

The single most common cause of credential breach in 2026 remains hardcoded secrets in source code. Engineers paste an API key into a config file "just for testing," forget to remove it, commit the file. The credential is now in the repository's history forever (git rebase doesn't help if anyone cloned in between) and extractable by anyone who reaches the repo: contractors, ex-employees, attackers via .git/ directory exposure (see skill six), GitHub bot scrapers crawling public repos.

The cost of detection-after-commit is near-zero (free tools exist: gitleaks, trufflehog, this skill). The cost of detection-before-commit is also near-zero (pre-commit hooks). The cost of remediation after the fact is rotating every credential exposed + auditing for exploitation + potentially notifying customers of breach. The asymmetry is severe, the discipline is the only constraint.

This skill scans a filesystem tree, matching against a canonical regex library covering the credential shapes attackers and bots search for first.

When the skill produces findings

FindingSeverityThresholdAffected control
AWS access key (AKIA-prefix)CRITICALLiteral AKIA[0-9A-Z]{16} in any fileCWE-798
AWS secret access keyCRITICAL40-char base64 in aws_secret_access_key field contextCWE-798
GitHub personal access tokenCRITICALghp_[A-Za-z0-9]{36} or gho_, ghu_, ghs_, ghr_CWE-798
GitHub app installation tokenCRITICALghs_[A-Za-z0-9]{36}CWE-798
Stripe live keyCRITICALsk_live_[A-Za-z0-9]{24,}CWE-798
Stripe test keyMEDIUMsk_test_[A-Za-z0-9]{24,}CWE-798
Anthropic API keyCRITICALsk-ant-api03-[A-Za-z0-9_-]{93} or similarCWE-798
OpenAI API keyCRITICALsk-(proj-)?[A-Za-z0-9_-]{40,}CWE-798
Slack bot tokenCRITICALxoxb-[A-Za-z0-9-]+CWE-798
Slack user tokenCRITICALxoxp-[A-Za-z0-9-]+CWE-798
Google API keyHIGHAIza[A-Za-z0-9_-]{35}CWE-798
RSA / OpenSSH private keyCRITICALBEGIN PRIVATE KEY header (RSA, OPENSSH, EC, DSA variants)CWE-321
JWT secretHIGHLong string in jwt_secret, JWT_SECRET, signing_secret fieldCWE-321
Generic password literalHIGHpassword = "..." with non-placeholder valueCWE-798
High-entropy string in key/token fieldMEDIUMShannon entropy ≥ 4.5 in key:/token: field contextCWE-798
.env-shaped KEY=VALUE in non-.env fileHIGHMultiple [A-Z_]+= lines in .py/.js/.md filesCWE-200

Prerequisites

  • Python 3.9+
  • Target source-code tree on local filesystem

Instructions

Step 1 — Identify the scan target

This skill scans a filesystem path. No authorization gate (it operates on local source code, not network targets).

Step 2 — Run the scanner
bash
python3 ${CLAUDE_PLUGIN_ROOT}/skills/scanning-for-hardcoded-secrets/scripts/scan_secrets.py /path/to/repo

Options:

Usage: scan_secrets.py PATH [OPTIONS]

Options:
  --output FILE      Write findings to FILE (default: stdout)
  --format FMT       json | jsonl | markdown (default: markdown)
  --min-severity SEV (default: info)
  --include-tests    Include files under tests/, test/, __tests__/, spec/
                     (default: excluded to reduce false positives)
  --git-history N    Also scan the last N git commits' diffs (default: 0
                     = working tree only)
  --exclude GLOB     Skip files matching glob (repeatable)
  --entropy-only     Only flag entropy-based findings (skip regex)

The scanner walks the tree, applies the regex library to every file's contents, and emits a Finding per match with file path, line number, severity, and the redacted matched text.

Step 3 — Interpret findings

CRITICAL = the matched string is a real credential shape that upstream tools auto-extract. Rotate the credential immediately. Audit logs for any API call against that credential since the commit landed.

HIGH = pattern strongly suggests credential but requires manual verification (the literal might be a placeholder or test fixture).

MEDIUM / LOW = entropy-based heuristic that needs human review.

Show full SKILL.md (263 more words)Show less
Step 4 — Remediation

For any confirmed real credential:

  1. Rotate immediately. Don't wait to refactor; the leak window is between when the commit landed and when you rotate.
  2. Audit usage. Check provider's API logs for any unfamiliar calls against that credential since the leak commit timestamp.
  3. Remove from source. Move to environment variables, secrets manager, or a runtime-provisioned secret. See references/PLAYBOOK.md for per-language patterns.
  4. Scrub history if reasonable. git filter-repo or BFG Repo-Cleaner can purge the secret from history, but only if you can force-push and coordinate with every clone-holder. For public repos, history-scrub is often not worth the disruption compared to just rotating.

Examples

Example 1 — Pre-commit gate
bash
# .git/hooks/pre-commit (or via pre-commit framework)
python3 plugins/security/penetration-tester/skills/scanning-for-hardcoded-secrets/scripts/scan_secrets.py \
    --min-severity high --format json . | jq -e 'length == 0' \
    || { echo "Secrets detected. Fix before commit."; exit 1; }
Example 2 — CI scan on every push
yaml
- name: Hardcoded-secrets scan
  run: |
    python3 plugins/security/penetration-tester/skills/scanning-for-hardcoded-secrets/scripts/scan_secrets.py \
        . --min-severity high --format json --output secrets-scan.json
- run: |
    if jq 'length > 0' secrets-scan.json | grep -q true; then
      echo "::error::Hardcoded secret detected"
      exit 1
    fi
Example 3 — Audit inherited codebase
bash
python3 ${CLAUDE_PLUGIN_ROOT}/skills/scanning-for-hardcoded-secrets/scripts/scan_secrets.py \
    /path/to/acquired-repo --include-tests --min-severity medium

--include-tests is important here because legacy test fixtures often contain real credentials someone forgot to redact.

Output

JSON / JSONL / Markdown per lib/report.py. Exit codes: 0 clean, 1 high/critical, 2 error.

Matched strings are partially redacted in output (first 4 + last 4 chars visible, middle redacted) to avoid the scanner output itself becoming a leak surface.

Error Handling

  • False positive on placeholder strings like <YOUR_KEY_HERE> → the scanner skips strings containing <, >, EXAMPLE, PLACEHOLDER, YOUR_, XXXX (configurable).
  • Binary file in tree → skipped (the scanner reads only text files by content-type sniffing).
  • Large file → files >5 MB are skipped (avoids scanning compiled artifacts and lockfiles).

Resources

  • references/THEORY.md — Per-credential-family threat model, why each provider's keys are extracted by bots first, history-scrub decision framework, entropy-detection theory
  • references/PLAYBOOK.md — Per-language migration patterns (Python dotenv, Node .env+dotenv, Ruby Rails credentials, Go envconfig), provider rotation procedures, GitHub secret-scanning integration

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (scripts, references) in skills/.curated/scanning-for-hardcoded-secrets of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/PLAYBOOK.md
  • references/THEORY.md
  • scripts/scan_secrets.py

Open the folder on GitHubat commit cfae287

Compare with similar skills

Scanning For Hardcoded Secrets next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Scanning For Hardcoded Secrets compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Scanning For Hardcoded Secrets this skilljeremylongshore/tons-of-skills-marketplace2.8k—~2.1kAutomated safety check: NotesMIT
Security SecretsIgorWarzocha/Opencode-Workflows122—~1.2kAutomated safety check: NotesNone
Audit Env Variablesqdhenry/Claude-Command-Suite1.3k—~2.8kAutomated safety check: NotesNone
Secrets Managementdavila7/claude-code-templates33k12 repos~2kAutomated safety check: PassMIT
Phase 9 Deploymentww-w-ai/bkit-claude-code601—~2.7kAutomated safety check: NotesApache-2.0
Atmos Authcloudposse/atmos1.4k—~4.2kAutomated safety check: PassApache-2.0

Similar skills

  • Security Secrets

    IgorWarzocha/Opencode-Workflows

    Review secret detection patterns and scanning workflows. An agent skill from IgorWarzocha/Opencode-Workflows.

    122 GitHub stars~1.2k tokensUpdated 8 mo ago
    SecurityAuto-check: notes
  • Audit Env Variables

    qdhenry/Claude-Command-Suite

    Analyze environment variables in JavaScript/TypeScript projects.

    1.3k GitHub stars~2.8k tokensUpdated 7 mo ago
    DevOps & CloudAuto-check: notes
  • Secrets Management

    davila7/claude-code-templates

    Secure secrets management practices for CI/CD pipelines using Vault, AWS Secrets Manager, and other tools.

    33k GitHub starsUsed in 12 repos~2k tokens
    DevOps & CloudAuto-check passed
  • Phase 9 Deployment

    ww-w-ai/bkit-claude-code

    Deploy to production — CI/CD pipelines, environment config, deployment strategies.

    601 GitHub stars~2.7k tokensUpdated 13 days ago
    DevOps & CloudAuto-check: notes
  • Atmos Auth

    cloudposse/atmos

    Authentication and identity management: providers (SSO/SAML/OIDC/GCP/Atmos Pro), identities, keyring, identity chaining, login/exec/shell/console, and github/sts for private GitHub access

    1.4k GitHub stars~4.2k tokensUpdated today
    Backend & APIsAuto-check passed
  • Latchkey

    imbue-ai/latchkey

    Interact with arbitrary third-party or self-hosted services (AWS, Slack, Google Drive, Dropbox, GitHub, GitLab, Linear, Coolify...) using their HTTP APIs.

    130 GitHub stars~1.1k tokensUpdated yesterday
    Backend & APIsAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Questions about Scanning For Hardcoded Secrets

What does Scanning For Hardcoded Secrets do?

Scan a source-code tree for hardcoded credentials embedded in source files: AWS access keys, GitHub tokens, Stripe keys, Slack tokens, Anthropic API keys, OpenAI keys, JWT signing secrets, generic…. Scanning For Hardcoded Secrets is an agent skill from jeremylongshore/tons-of-skills-marketplace. Scan a source-code tree for hardcoded credentials embedded in source files: AWS access keys, GitHub tokens, Stripe keys, Slack tokens, Anthropic API keys, OpenAI keys, JWT signing secrets, generic base64-encoded passwords, RSA / SSH private keys, and high-entropy string literals that pattern-match common credential shapes.

When should I use Scanning For Hardcoded Secrets?

Scanning For Hardcoded Secrets fits situations like: : pre-commit gate before pushing a feature branch; audit before SOC2; post-incident scan after a leak; inheriting a codebase you didnt write.

How do I install Scanning For Hardcoded Secrets in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill scanning-for-hardcoded-secrets -a claude-code`. Or copy the skill folder (skills/.curated/scanning-for-hardcoded-secrets in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/scanning-for-hardcoded-secrets in your project. Claude Code loads it when a task matches its description.

How do I install Scanning For Hardcoded Secrets in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill scanning-for-hardcoded-secrets -a codex`. Or copy the skill folder (skills/.curated/scanning-for-hardcoded-secrets in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/scanning-for-hardcoded-secrets in your project. Codex loads it when a task matches its description.

Can I use Scanning For Hardcoded Secrets in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill scanning-for-hardcoded-secrets -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/scanning-for-hardcoded-secrets, .gemini/skills/scanning-for-hardcoded-secrets, .github/skills/scanning-for-hardcoded-secrets and .opencode/skills/scanning-for-hardcoded-secrets in your project.

What does Scanning For Hardcoded Secrets need to run?

Going by SKILL.md and its folder, Scanning For Hardcoded Secrets needs Python for the scripts in its folder, the command-line tools its instructions call (python3, git and jq) and credentials named JWT_SECRET. Our summary lists: Python 3; A credential in JWT_SECRET. Its frontmatter pre-approves these tools: Read, Bash(python3:*), Glob, Grep. Compatibility (from SKILL.md): Designed for Claude Code.

Does Scanning For Hardcoded Secrets access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Scanning For Hardcoded Secrets safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Scanning For Hardcoded Secrets use?

Scanning For Hardcoded Secrets is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Scanning For Hardcoded Secrets use?

About 2.1k tokens (SKILL.md is roughly 8.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.8k tokens, read only when the agent opens those files.

What are the alternatives to Scanning For Hardcoded Secrets?

Skills that share tags, products or a category with Scanning For Hardcoded Secrets: Security Secrets (IgorWarzocha/Opencode-Workflows, 122 stars), Audit Env Variables (qdhenry/Claude-Command-Suite, 1.3k stars), Secrets Management (davila7/claude-code-templates, 33k stars) and Phase 9 Deployment (ww-w-ai/bkit-claude-code, 601 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Scanning For Hardcoded Secrets?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.