secrets-scan

secrets-scan is a skill for Claude Code, Codex from Phaedra-Solutions/cursor-rules. It costs 73 tokens per session (1,377 once invoked), scanned A, original, MIT.

A scan for accidentally exposed passwords, API keys and other credentials in changed files, the working tree or Git history. Git is the version-control system used to record a project's file changes.

In plain words
What is it for?
Use it on staged changes before a commit, on selected commits, or across the full repository history, with secret values hidden in the results.
Why use it?
It can find secrets before they are committed or after they have been exposed. It also guides the response, including revoking and replacing credentials and, when needed, removing them from history.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is git filter-repo --sensitive-data-removal --replace-text ../expressions.txt.

Good fit Use it on staged changes before a commit, on selected commits, or across the full repository history, with secret values hidden in the results.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/Phaedra-Solutions/cursor-rules
agentmods
npx agentmods add skills/phaedra-solutions/cursor-rules/secrets-scan

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 secrets-scan

README.md
[![agentmods](https://agentmods.dev/badge/skills/phaedra-solutions/cursor-rules/secrets-scan/github.svg)](https://agentmods.dev/skills/phaedra-solutions/cursor-rules/secrets-scan)
Your own site
<a href="https://agentmods.dev/skills/phaedra-solutions/cursor-rules/secrets-scan"><img src="https://agentmods.dev/badge/skills/phaedra-solutions/cursor-rules/secrets-scan/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for secrets-scan

Your own site · 80×15
<a href="https://agentmods.dev/skills/phaedra-solutions/cursor-rules/secrets-scan"><img src="https://agentmods.dev/badge/skills/phaedra-solutions/cursor-rules/secrets-scan.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 73 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,377 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00073 $0.01377
Opus 5.5 $0.00029 $0.00551
Sonnet 5.5 $0.00015 $0.00275
Haiku 4.5 $0.00007 $0.00138

Measured 3d ago against content hash 32c899c57f75, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

secrets-scan 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 3d ago.

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/secrets-scan/SKILL.md · 78 lines

How it starts

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

Secrets scan

When to use

  • Before a commit (the git-commit skill calls this on staged files).
  • When the user asks to check for secrets, keys or credentials.
  • After a secret was pasted into code, a log, an issue or chat, or committed by mistake.
  • As part of security-audit, which only scans the working tree; this skill also covers history.

Before you start

  • Check that gitleaks is installed: gitleaks version. If it isn't, ask before installing it, and install only from the official source (package manager or the GitHub releases page).
  • Agree the scope with the user: staged changes (default), the working tree, a commit range, or the full history. A full-history scan can be slow on large repos.
  • Never print, echo or paste a secret value, even partly. Always pass --redact so gitleaks hides values in its output.
  • Don't write a report file into the repo. If the user wants one, write it outside the working tree with --redact and delete it when done.

Steps

  1. Run the scan for the agreed scope (from the repo root):

    Scope Command
    Staged changes gitleaks git --staged --redact --no-banner -v
    Unstaged changes gitleaks git --pre-commit --redact --no-banner -v
    Working tree (all files, tracked or not) gitleaks dir . --redact --no-banner -v
    A commit range gitleaks git --log-opts="origin/main..HEAD" --redact --no-banner -v
    Full history gitleaks git . --redact --no-banner -v

    Exit code 1 means leaks were found; 0 means none. Respect an existing .gitleaks.toml and .gitleaksignore.

  2. Triage each finding. For each one, note the rule ID, file, line, commit (for history scans) and author. Decide:

    • Real secret: go to step 3.
    • Test fixture or example value: confirm it grants no access, then suggest a gitleaks:allow comment on that line, or a fingerprint in .gitleaksignore. Ask the user first; never add an ignore on your own.
    • False positive: same as above, with the reason.
  3. Contain a real secret. Explain to the user, in this order:

    1. Revoke or rotate it first, at the provider (cloud console, GitHub token settings, npm token revoke, the API vendor's dashboard). A secret that reached a remote, a CI log, a package or chat is compromised even after it's deleted. Removing it from history doesn't make it safe.
    2. Check for misuse: review the provider's access logs for the period since the leak.
    3. Replace it with a reference to an env var or secret manager (process.env.STRIPE_SECRET_KEY, a CI secret, a vault). Add the file to .gitignore if it's a local config file.
    4. Remove it from the code in a normal commit.
  4. Only if the user asks, rewrite history. Explain the cost first:

    • every commit hash after the first affected commit changes;
    • a force-push is required, and every collaborator must re-clone or rebase; forks, open PRs, caches and existing clones keep the old data;
    • on GitHub, cached views and PR refs may need GitHub Support to purge.

Read the full file on GitHub · 78 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. 3d ago First seen · 78 lines · 73 tokens per session scan A 32c899c57f75

Subscribe to this mod's changes

secrets-scan is a skill published in the GitHub repository Phaedra-Solutions/cursor-rules (4 stars, last pushed 2d ago), licensed MIT. It adds 73 tokens to every session and 1,377 once invoked, about $0.0003 per session on Opus 5.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-11-01.