/gitguardian:check-hmslfrom GitGuardian
Checks known credentials against GitGuardian's HMSL public-leak corpus using ggshield. User runs commands, agent interprets sanitized JSON output. Use when inheriting secrets or vetting vault inventory.
Ships in GitGuardian. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
STOP — read before proceeding. This skill is user-run only. The agent must not invoke
ggshield hmsl check,fingerprint,query,decrypt, orcheck-secret-manager. The agent must not callRead,Grep,cat,head,tail,sed,awk, or any other tool against credential files,.env-style files, vault dumps, or HMSL intermediate files (*-payload.txt,*-mapping.txt,*.dump). The single agent job is to prepare commands for the user to execute in their own terminal, then interpret sanitized output the user pastes back (-n none --jsononly). Continuing past this block constitutes acknowledgement of the user-run model. If you arrived here as a follow-up fromscan-secrets(e.g., to resolvevalidity: no_checkerfindings), do not extend the agent-executable contract of that skill into this one — they have different execution models.
HMSL (hasmysecretleaked.com) is GitGuardian's public hash-lookup service for known secrets. You bring a credential, HMSL tells you whether it's been seen leaking in GitGuardian's currently indexed public GitHub sources (public repositories, commits, gists, and issues). The plaintext credential never leaves the machine — ggshield hashes it locally and, by default, submits hash prefixes only.
This is the inverse of scan-secrets. scan-secrets finds unknown secrets in files you control. check-hmsl checks known secrets you already have against the public-leak corpus: a .env you inherited from a former teammate, a token someone pasted into Slack, a credential dump from a possibly-compromised system, or the full inventory of a secret manager.
ggshield hmsl check <file> does this dance, entirely on the user's machine until the underlined step:
--naming-strategy (-n none for anything pasted back to the agent; never cleartext).The wire protocol is safe. The threat model for this skill is different: an LLM agent has tools that can read files. If the agent reads the credential file at any point — to "check what's in it", to "verify the format", to "count lines" by accident — the plaintext enters the agent's tool output, which is part of the LLM context. At that point HMSL's local-hashing protocol is irrelevant; the secret has already been exposed to whatever downstream systems the agent's context flows through (transcripts, server logs, training pipelines if applicable, future-turn re-use).
The single job of this skill is to prepare commands for the user to run in their own terminal, then interpret sanitized output the user chooses to paste back. The agent must never run HMSL commands on the user's behalf.
This skill has one execution model:
-n none.ggshield hmsl check, ggshield hmsl fingerprint, ggshield hmsl query, ggshield hmsl decrypt, or ggshield hmsl check-secret-manager.This is the only structurally safe model. Do not offer an agent-executed fallback, even if the user says the credential is low risk or the agent hook is installed.
Never call any tool against the credential file or HMSL intermediate files. Not Read, not Grep, not cat, head, tail, sed, awk, less, more, file, xxd, ls, wc, ggshield, or any LSP-backed tool. The agent does not need to confirm the file exists, inspect the format, count lines, or verify outputs. The user runs commands locally and decides what output to share.
If the user asks "show me what's in the file before we check it" or "just run the check for me" — refuse and explain that the credential contents must stay outside the agent context.
Prose rules can be rationalized away by the model under pressure ("the user really wants me to check the format first…"). That is why this skill has no agent-executed mode. Agent hooks and tool allowlists are useful defense in depth, but they do not make it acceptable for the agent to run HMSL against user secrets.
ghp_abc123…"), refuse and redirect: "Put it in a file and give me the path — that way the value never enters the transcript."cat secrets.txt | ggshield ..., no echo $TOKEN | .... ggshield supports stdin, but recommended user-run commands use file-path invocation.--naming-strategy cleartext is forbidden. It echoes each matched secret's plaintext into stdout. Use -n none for anything pasted back to the agent.-n none for anything pasted back to the agent. Do not paste key, censored, or cleartext output into the conversation.--json for output the user intends to paste back.--full-hashes. Full-hash mode sends full SHA-256 hashes rather than prefixes; it exists for partner/trust arrangements and changes the privacy posture. Use prefix mode (default) unless the user explicitly confirms they are in partner mode.--insecure, --allow-self-signed, --debug, --verbose, or --log-file by default. TLS verification and quiet structured output are the safe defaults for secret-handling workflows.ggshield hmsl quota first, then proceed. Prefix mode costs more quota than full-hash mode.ggshield hmsl is the only sanctioned path. If ggshield --version or ggshield hmsl api-status fails for the user, guide them through Onboarding (first use) below — do not improvise an alternate check (manual grep of leak databases, hand-rolled hashes, sending the secret to a different service).Trigger an HMSL check when:
check-secret-manager hashicorp-vault)What ggshield hmsl covers:
hmsl check)fingerprint (compute hashes locally) → query (send hash prefixes to HMSL) → decrypt (resolve which input secrets matched)check-secret-manager hashicorp-vault)hmsl quota)hmsl api-status)For shared ggshield install, authentication, headless setup, CI tokens, and hook-install commands, see references/ggshield-cli-setup.md.
For platform-wide topics (auth/scope recovery, instance URLs, headless setup), see references/gitguardian-platform.md.
Do not use this skill when:
scan-secrets instead. This skill checks known credentials you already hold.ggshield hmsl yourself or to read the credential file with Read, cat, Grep, or similar. HMSL operations are user-run only by design — running them agent-side pulls the plaintext into the agent context. Hand the command to the user.ggshield 1.49.0 or later — for full feature support.check-hmsl reuses the same ggshield install and auth login flow as scan-secrets. If the user is not sure ggshield is installed or HMSL is reachable, give them these commands to run in their own terminal:
ggshield --version
ggshield hmsl api-status
If ggshield --version fails, point them to references/ggshield-cli-setup.md. If ggshield hmsl api-status reports an auth issue, ask the user to run ggshield auth login locally.
HMSL works in two auth modes:
ggshield auth login needed. Lower default daily quota. Useful for quick one-off checks on a fresh machine.ggshield auth login. Higher workspace quota than anonymous mode. Recommended for bulk inventories.The user can confirm auth state with ggshield hmsl api-status — Authenticated: true means the call will use the user's account quota.
For recurring protection in general agent work, offer the matching AI hook one time through install-hooks. If this skill is installed alone, use the shared setup reference. Reuse protection that works. If the user declined an installation, do not ask again. An HMSL lookup does not need a hook.
A finding in a prompt or pre-tool event can block the action. A finding in a post-tool event gives a notification after the action. When an AI scan has an error, the action continues. A hook does not guarantee that secrets stay out of the model context. A hook does not make agent-run HMSL acceptable. With or without a hook, this skill stays user-run only.
The agent does not run these. The agent prints the command, the user runs it, the user pastes back the output.
# One-shot check with maximum privacy: no secret hint in the output
ggshield hmsl check /path/to/secrets.txt --json -n none
# .env-formatted input with maximum privacy
ggshield hmsl check -t env /path/to/.env --json -n none
# Quota and status
ggshield hmsl quota
ggshield hmsl api-status
For sensitive bulk audits, give the user the multi-stage flow so they can inspect the payload before stage 2 sends it:
# In their own shell, in a private temp directory outside any repo
HMSL_WORKDIR="$(mktemp -d "${TMPDIR:-/tmp}/ggshield-hmsl.XXXXXX")"
chmod 700 "$HMSL_WORKDIR"
ggshield hmsl fingerprint /absolute/path/to/secrets.txt -p "$HMSL_WORKDIR/audit" -n none
# Optional: the user can inspect "$HMSL_WORKDIR/audit-payload.txt" here.
# Do NOT inspect "$HMSL_WORKDIR/audit-mapping.txt" — keep local mapping files out of the agent context.
ggshield hmsl query "$HMSL_WORKDIR/audit-payload.txt" > "$HMSL_WORKDIR/results.dump"
ggshield hmsl decrypt "$HMSL_WORKDIR/results.dump" --mapping "$HMSL_WORKDIR/audit-mapping.txt" --json
rm -rf "$HMSL_WORKDIR"
The user pastes back only the final decrypt --json output (or just the human summary). Stage outputs stay on their machine.
Secret-manager inventories are high-risk by default. The agent must not run this command. Hand it to the user:
# Vault URL from VAULT_URL or --url; token from VAULT_TOKEN unless --use-cli-token
ggshield hmsl check-secret-manager hashicorp-vault \
--url https://vault.example.com \
--recursive \
--json \
secret/
ggshield hmsl check-secret-manager --help lists currently-supported managers. The HashiCorp Vault command supports KV v1/v2.
ggshield hmsl quota # remaining credits today
ggshield hmsl api-status # confirm HMSL is reachable + whether the CLI is authenticated
Key flags (applicable to check and fingerprint):
| Flag | Effect |
|---|---|
--json | Structured output — use for anything the user intends to paste back |
-t file|env | Input format. file = one secret per line (default). env = KEY=VALUE lines |
-n key|censored|none|cleartext | Hint format for matched secrets in the output. Use none for anything pasted back to the agent. Do not paste key, censored, or cleartext output into the conversation |
-f, --full-hashes | Send full hashes instead of prefixes. Do not use in normal agent contexts; partner/trust mode only |
-p, --prefix <name> | (fingerprint only) Prefix for generated <prefix>-payload.txt / <prefix>-mapping.txt files |
-m, --mapping <file> | (decrypt only) Path to the mapping file from fingerprint |
Exit codes: 0 = no matches found, 1 = at least one secret matched (leaked publicly), non-zero = error (auth, quota, HMSL unreachable).
-n none for output pasted back to the agent. Do not ask the user to paste output generated with -n key, -n censored, or -n cleartext.ggshield hmsl quota first.check. For sensitive bulk audits, use the fingerprint / query / decrypt split. The split lets the user inspect what's being sent and decouples the local hashing step from the network call.hash field in HMSL output is a one-way SHA-256 — safe to report back to the user, but don't publish it in issues, PR comments, or logs unless the user asks. The url field points to a public source (e.g., a leaked GitHub commit) — safe and useful; this is the actionable information.ggshield: command not found — see the scan-secrets skill's Onboarding section.
401 Unauthorized on hmsl commands — the cached HMSL token is stale. Delete it and re-authenticate:
rm ~/.cache/ggshield/hmsl_token # path on macOS/Linux
ggshield auth login # if `Authenticated: false` in api-status
ggshield hmsl api-status # confirm
429 Too Many Requests / "quota exceeded" — daily quota is gone. Run ggshield hmsl quota to see the reset time. Either wait for the reset or switch to an authenticated account with a higher quota.
HMSL api-status shows Authenticated: false — the CLI is hitting HMSL anonymously. Run ggshield auth login to get the authenticated quota. Anonymous mode works but caps out quickly.
No matches found on a secret you know was leaked — HMSL covers the public sources GitGuardian has indexed for HMSL, currently public GitHub repositories, commits, gists, and issues. If the leak was in a private repo, an unindexed paste site, or a non-public artifact, HMSL won't see it. For the user's private GitGuardian workspace incidents, see the GitGuardian dashboard or the incidents tools on the Developer MCP server, not HMSL.
Output contains a literal credential value — the command used -n cleartext. Do not paste that output into the conversation. Re-run with -n none before sharing output with the agent.
Multi-stage decrypt fails with mapping mismatch — the mapping file was regenerated between fingerprint and decrypt. Re-run from fingerprint in a fresh private temp directory to keep the payload and mapping aligned.
The agent hook blocked a ggshield invocation — the hook detected a secret in a tool input/output and refused to forward it. This is working as intended. Do not disable the hook to "get the check through"; keep HMSL checks user-run only.
Any other or unlisted error — before improvising a fix, consult GitGuardian's AI-agent docs index at https://docs.gitguardian.com/llms.txt to locate the relevant page, then append .md to that page's URL to read it as Markdown. Search there first rather than guessing. (Reading docs is fine; the user-run-only rule above still forbids the agent from running HMSL commands or touching credential files.)
evals/evals.json (opens in a new tab)evals/files/README.md (opens in a new tab)evals/files/_shared/secrets.env (opens in a new tab)evals/files/inherited-secrets/setup.sh (opens in a new tab)evals/targets.json (opens in a new tab)references/ggshield-cli-setup.md (opens in a new tab)references/gitguardian-platform.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
6 skills in this plugin
/create-honeytokensUse when generating or planting GitGuardian honeytokens, canary tokens, decoys, or tripwire credentials. Use around .env.example, sample configs, pre-publication open-source repos, internal wikis, runbooks, deploy scripts, or other attractive leak surfaces./install-hooksInstall or repair hooks that check for secrets on each commit, push, or AI assistant action. Use when the user wants leak prevention, when credential-handling work has no hook protection, or when agent scans duplicate a hook that already exists. Use scan-secrets for a one-off scan or a leak investigation./scan-machineScan a developer's entire machine for credentials across local git repositories, dotfiles, ~/.aws/credentials, ~/.kube/config, ~/.docker/config.json, ~/.npmrc, browser profile databases, shell history, AI agent caches, and abandoned project trees via ggshield machine scan. Use when preparing to wipe, sell, or hand off a laptop, when onboarding a new machine, when auditing what credentials live on a machine, or when the user explicitly asks to inventory secrets on the system itself. Requires endpoint scanning enabled on the GitGuardian workspace; not available on Free./scan-secretsScan 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./triage-incidentsUse when triaging or reviewing GitGuardian secret incidents already detected in the dashboard, when asked what is leaking in the org or what to fix first, when remediating or rotating a credential flagged in an incident, after a Public Monitoring alert, or to assign, tag, or resolve incidents. Operates through the GitGuardian Developer MCP server.npx claudepluginhub gitguardian/agent-skills --plugin gitguardianOther plugins' skills for the same job