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.
npx skills add tmj-90/gaffer --skill security-secret-handlinggit clone --depth 1 https://github.com/tmj-90/gafferWrote 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.
[](https://agentmods.dev/skills/tmj-90/gaffer/security-secret-handling)<a href="https://agentmods.dev/skills/tmj-90/gaffer/security-secret-handling"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/security-secret-handling/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.
<a href="https://agentmods.dev/skills/tmj-90/gaffer/security-secret-handling"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/security-secret-handling.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00068 | $0.01804 |
| Opus 5.5 | $0.00027 | $0.00722 |
| Sonnet 5.5 | $0.00014 | $0.00361 |
| Haiku 4.5 | $0.00007 | $0.00180 |
Grade A, and why
security-secret-handling 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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 121 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Handle secrets safely
A secret leaks through source, git history, logs, error pages, URLs, client bundles, image layers, CI output, and your own context window. The job is to reference secrets by name only, inject them at runtime from the environment or a secret manager, keep them out of every output channel, and make rotation possible without downtime (OWASP Secrets Management Cheat Sheet; ASVS 5.0 V13.3 and 14.2.1).
Procedure
- Find the mechanism. Call
search_lorefor the config loader, env-var naming, the secret manager (Vault, AWS Secrets Manager, GCP Secret Manager, Azure Key Vault, Kubernetes Secrets, CI secrets), and how local development gets values. Follow it. Never read.env*, key or credential files: the safety hook blocks them, and their values must never enter your context. The hook also blocks any Bash command that names a secret FILE (.env,.env.local,*.pem,*.key,credentials,secrets.json, asecrets/dir, …). Searching code forprocess.envor for the wordcredentialsis fine — a search pattern is not a file — but never point a search at a secret file. - Reference by name only. Read the value from the env var or secret manager
through the existing config module. Document the name with a placeholder such as
STRIPE_API_KEY=changemein the repo's config schema, README or non-.envexample file, and add it to the deployment manifest or IaC as a secret reference (never as a literal). A COMMITTED.env.example/.env.sample/.env.templateis ordinary content: add the placeholder line there. An untracked one counts as a secret (it could be a renamed.env), so do not create a new template; if the repo has none, say in evidence that a human must add it. - Validate at startup. Missing or malformed required secrets make the process fail fast, and the message names the missing variable, never a value. Add a test that boots the config with the variable unset and asserts that clear failure.
- Keep it server-side. Nothing secret goes into a client bundle. Build-time
variables prefixed
NEXT_PUBLIC_,VITE_,REACT_APP_orEXPO_PUBLIC_are public by design. Nothing secret goes in a URL or query string, which is written to access logs and Referer headers (ASVS 14.2.1). Send it in a header or body over TLS. - Keep it out of every output.
- Add the field to the logger's redaction list, or wrap it in a type whose
toString/repr/toJSONprints***. - Never log a whole config object, request headers (
Authorization,Cookie), or a connection string with a password in it. - Scrub secrets from error messages and exceptions returned to clients.
- In CI and shell scripts, do not
set -xaround secret use. - In Dockerfiles, do not put secrets in
ARG/ENV, which persist in image layers. Use build secret mounts.
- Add the field to the logger's redaction list, or wrap it in a type whose
- Least privilege and short life. Request the narrowest scope the integration
needs, separate credentials per environment, and prefer short-lived or workload
identity (OIDC federation, IAM roles, managed identity) over long-lived static
keys. When comparing a presented secret, such as a webhook HMAC or an API key hash,
use a constant-time compare (
crypto.timingSafeEqual,hmac.compare_digest,MessageDigest.isEqual). - Make rotation possible. If the ticket introduces or changes a signing or
verification key, accept current and previous during an overlap window, pick
the key by
kidor version, sign only with current, and document the rotation steps in the runbook or README. Stored API keys issued to users are hashed and only ever shown once (see theauth-session-and-oauthskill). - Scan before you finish. Find the branch base: run
git merge-base HEAD origin/HEAD(orgit merge-base HEAD <default_branch>) and use the printed SHA as$BASE. The safety hook blocks$(…)substitution, so paste the SHA.- If
gitleaksis on PATH, rungitleaks git --log-opts="$BASE..HEAD" --redact --no-banner .. Otherwise rungit diff "$BASE"...HEAD | grep -nE 'AKIA[0-9A-Z]{16}|-----BEGIN [A-Z ]*PRIVATE KEY|gh[pousr]_[A-Za-z0-9]{36}|xox[abprs]-|sk_live_|://[^/ ]+:[^@ ]+@'. - Do not install a scanner. If none exists, the grep check is the evidence.
- Test fixtures use obvious fakes such as
test-key-not-real, never a real-looking token.
- If
- Test that redaction works. Set a sentinel value (
sk_test_CANARY_1234) in the test environment, drive the code path that logs or errors, capture the log output and the response body, and assert the sentinel is absent. - Evidence. Record the scan command and result plus the tests through the
record-evidenceskill, without quoting any secret value, then stop.
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.
- 1mo ago Changed · +3 lines 1b5cf6170022
- 2mo ago Changed · +68 lines 9a445c1c543b
- 3mo ago First seen · 50 lines · 68 tokens per session scan A 4363617eff32
security-secret-handling is a skill published in the GitHub repository tmj-90/gaffer (1 stars, last pushed 4d ago), licensed Apache-2.0. It adds 68 tokens to every session and 1,804 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-09-03.
security-secret-handling compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| security-secret-handlingtmj-90/gaffer | Skill | 1 | 4d ago | Apache-2.0 | A | 68 | Claude Code, Codex |
| bulwark-brainstormQBall-Inc/the-bulwark | Skill | 9 | yesterday | MIT | A | 50 | Claude Code |
| plan-creationQBall-Inc/the-bulwark | Skill | 9 | yesterday | MIT | A | 38 | Claude Code |
| anthropic-validatorQBall-Inc/the-bulwark | Skill | 9 | yesterday | MIT | A | 40 | Claude Code |
| create-subagentQBall-Inc/the-bulwark | Skill | 9 | yesterday | MIT | A | 42 | Claude Code |
| test-auditQBall-Inc/the-bulwark | Skill | 9 | yesterday | MIT | A | 0 | Claude Code |
| code-reviewQBall-Inc/the-bulwark | Skill | 9 | yesterday | MIT | A | 61 | Claude Code |