secret-detection

secret-detection is a skill for Claude Code, Codex from drvoss/everything-copilot-cli. It costs 37 tokens per session (1,267 once invoked), scanned A, original, MIT.

A scan for API keys, access tokens, passwords, private keys, and other credentials accidentally stored in source code or Git history. It also guides safe removal and credential replacement.

In plain words
What is it for?
It is for scanning code and commit history, checking for secret files, preventing future leaks, and planning credential rotation.
Why use it?
It helps you find leaked credentials before publishing a repository or after a possible secret exposure, while reducing the chance of breaking existing integrations.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/drvoss/everything-copilot-cli/secret-detection
Any agent
npx skills add drvoss/everything-copilot-cli --skill secret-detection
Clone the repo
git clone --depth 1 https://github.com/drvoss/everything-copilot-cli

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for secret-detection

README.md
[![agentmods](https://agentmods.dev/badge/skills/drvoss/everything-copilot-cli/secret-detection.svg)](https://agentmods.dev/skills/drvoss/everything-copilot-cli/secret-detection)
Your own site
<a href="https://agentmods.dev/skills/drvoss/everything-copilot-cli/secret-detection"><img src="https://agentmods.dev/badge/skills/drvoss/everything-copilot-cli/secret-detection.svg" alt="Measured on agentmods" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,267 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00037 $0.01267
Opus 5 $0.00018 $0.00633
Sonnet 5 $0.00007 $0.00253
Haiku 4.5 $0.00004 $0.00127

Measured today against content hash 123f5b297c38, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

secret-detection scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/security/secret-detection/SKILL.md · 159 lines

How it starts

The opening of the file, as written. The whole thing — 159 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Secret Detection

When to Use

  • Auditing a codebase for accidentally committed credentials
  • Before open-sourcing a private repository
  • After a developer reports a potential secret leak
  • As part of a regular security review cadence
  • Setting up pre-commit hooks for secret prevention

Prerequisites

  • Access to the repository source code and git history
  • Ability to rotate compromised credentials
  • Access to a secrets manager or environment variable configuration

Workflow

1. Scan Source Code for Secret Patterns

# AWS Access Keys
grep -rn "AKIA[0-9A-Z]{16}" . --include="*.ts" --include="*.js" --include="*.py" --include="*.json"

# GitHub tokens
grep -rn "ghp_[a-zA-Z0-9]{36}\|github_pat_[a-zA-Z0-9_]{82}" .

# Generic API keys and secrets
grep -rni "api[_-]?key\s*[:=]\s*['\"][a-zA-Z0-9]" src/ --include="*.ts" --include="*.js"

# Private keys
grep -rn "BEGIN.*PRIVATE KEY" .

# Connection strings with credentials
grep -rni "mongodb\+srv://\|postgres://\|mysql://" . | grep -v "localhost\|example\|template"

# JWT secrets and signing keys
grep -rni "jwt[_]?secret\|signing[_]?key" src/ --include="*.ts" | grep -v "process\.env\|config\."

2. Check for Secret Files

# Find committed secret files
git --no-pager ls-files | Select-String "\.pem$|\.key$|\.p12$|\.pfx$|id_rsa|\.env$"

# Check .gitignore covers sensitive patterns
Get-Content .gitignore 2>$null | Select-String "\.env|\.pem|\.key|secret"

3. Scan Git History

Secrets removed from code may still exist in git history:

# Search recent commits for secret patterns
git --no-pager log --all -p --since="6 months ago" -S "AKIA" --oneline | Select-Object -First 20

# Search for common secret keywords in diffs
git --no-pager log --all -p -S "api_key" --oneline | Select-Object -First 20

4. Remediate Found Secrets

Step 1: Rotate the credential immediately Any secret found in source code should be considered compromised.

Step 2: Replace with environment variables

Read the full file on GitHub · 159 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today First seen · 159 lines · 37 tokens per session scan A 123f5b297c38

Subscribe to this mod's changes

secret-detection is a skill published in the GitHub repository drvoss/everything-copilot-cli (45 stars, last pushed 8d ago), licensed MIT. It adds 37 tokens to every session and 1,267 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories