scan-secrets
Skill12 starsChanged 6 months agoMITView on GitHub
Scan files, staged changes, commits, history, Docker images, or packages for hardcoded secrets. Use when the user asks for a scan, during an audit, or when the user asks you to investigate a suspected leak or a finding. Use install-hooks for recurring checks on edits, commits, pushes, and AI assistant actions.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- y-a-v-a/skillstheir own version, first seen Nov 8, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- y-a-v-a/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- check-hmslSkill
- create-honeytokensSkill
- install-hooksSkill
- scan-machineSkill
- triage-incidentsSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
Run the requested one-off scan, also when a hook exists.
- Very specific: line 21
Use check-hmsl to check if a known credential leaked publicly.
- Distinctive: line 32
If needed, read ggshield-cli-setup.md.
- Very specific: line 36
Always use --json. A recursive path scan needs both -r and -y.
- Distinctive: line 57
Before you give remediation advice, read remediation-doctrine.md.
- Distinctive: line 74
No Git repository: use a path scan for the current files.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Scan secrets
Overview
Run a scan only when the user asks for one. Never start a scan on your own initiative: not after an edit, not before a commit or push, not because you suspect a leak. Tell the user what you suspect and offer the scan. Never write your own secret scanner: no grep, regex, script, or any other tool to look for secrets. ggshield secret scan is the only scanner.
For routine credential edits, commits, and pushes, hooks do the checks. Reuse protection that works, or offer an installation one time through install-hooks. If that skill is not available, hook-selection.md is a self-contained fallback. If the user declined an installation, do not run repeated scans instead. Do not report unscanned work as clean.
When to Use
- Run the requested one-off scan, also when a hook exists. If a project scan request is ambiguous, scan the current files or ask. Do not scan the full history without a request.
- Use
check-hmslto check if a known credential leaked publicly. Usescan-machineto inventory a whole machine. - Use the CLI for the supported scan surfaces. Do not write custom grep or regex scanners. Do not use the MCP tool
GitGuardian:scan_secretsfor these surfaces. If the user declines a CLI installation, offer the MCP tool only for a single pasted snippet. It is not a substitute for a repository or history scan.
Onboarding (first use)
Prerequisites
An installed and authenticated ggshield that supports the requested command. If the state is unknown, check ggshield --version, the relevant --help output, and ggshield api-status.
Setup
If needed, read ggshield-cli-setup.md. A hook installation is optional and needs its own authorization. A requested scan does not need a hook.
Commands
Always use --json. A recursive path scan needs both -r and -y. Without -y, the CLI waits for an interactive confirmation. Scan the requested surface. Do not stage unrelated files to scan them.
ggshield secret scan path <file> --json
ggshield secret scan path -r -y . --json # current files
ggshield secret scan pre-commit --json # explicit staged scan
ggshield secret scan repo . --json # full history
ggshield secret scan commit-range HEAD~5..HEAD --json
ggshield secret scan commit <sha> --json
ggshield secret scan docker <image> --json
ggshield secret scan pypi <package> --jsonA staged scan does not cover the outgoing commit history. For command variants and CI, read workflows.md. For JSON fields, validity, or false positives, read interpreting-results.md. Do not read them for a command or a result that you already understand. Report an error or an incomplete scan as unchecked, not as clean.
Best Practices
Findings
Wait for the complete result before you remediate. Group repeated credentials across files and commits. Keep each distinct credential. Report the locations, the type, and the validity. Do not show the secret values. Stop the affected publishing or commit action. Never show code that contains a detected secret.
Before you give remediation advice, read remediation-doctrine.md. Use its triage axes (detection context, exposure, ownership, blast radius) and its deliverable modes. A valid credential still needs triage. A production rotation can need coordination. Produce one consolidated plan.
- Local only and never exposed: remove the secret. When necessary, clean the affected unpushed commits.
- Exposed to a remote or a service: rotate first. Do not rewrite history by default.
- The organization has a custom remediation message: keep it verbatim as the primary guidance.
- A hook found the secret: the same hook checks the next authorized retry. An explicit scan found the secret: scan the affected scope again. A pending, skipped, or failed check is not a success.
HMSL handoff
If the validity is unknown, cannot_check, no_checker, or failed_to_check, propose HMSL to check for a public leak. HMSL is user-run only, also when the check-hmsl skill is absent. Never run its checks, its fingerprint, query, or decrypt pipeline, or its secret-manager checks. Never read a credential file or an intermediate file with any tool. Never ask for plaintext in the chat.
Prepare the command for the user's terminal with -n none --json. Ask the user to check ggshield hmsl quota before a bulk run. Reject a naming strategy that identifies the secret, including cleartext. Read the HMSL section of interpreting-results.md when you prepare the handoff. Or use check-hmsl for its additional flows.
Troubleshooting
- CLI, authentication, or headless error: use the setup reference. Never print an API key. In a headless environment, prefer the supported out-of-band (OOB) login.
- Missing scopes or instance problem: read gitguardian-platform.md.
- No Git repository: use a path scan for the current files. A history scan needs Git.
- A recursive scan hangs: add
-ywith-r. - Known false positive: use the interpreting-results reference for
ggignoreor the ignore list. - Other error: find the relevant official page through https://docs.gitguardian.com/llms.txt before you invent a workaround.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

