security-secret-handling

security-secret-handling is a skill for Claude Code, Codex from tmj-90/gaffer. It costs 68 tokens per session (1,804 once invoked), scanned A, original, Apache-2.0.

A guide for handling passwords, API keys, tokens, connection strings, and other credentials safely.

In plain words
What is it for?
Use it when adding integrations, environment configuration, secret-manager access, validation, or credential rotation.
Why use it?
It keeps secrets out of source code, logs, error messages, and the agent's working context.

Skill for Claude CodeCodex

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

Good fit Use it when adding integrations, environment configuration, secret-manager access, validation, or credential rotation.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tmj-90/gaffer/security-secret-handling
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.

Any agent
npx skills add tmj-90/gaffer --skill security-secret-handling
Clone the repo
git clone --depth 1 https://github.com/tmj-90/gaffer

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 security-secret-handling

README.md
[![agentmods](https://agentmods.dev/badge/skills/tmj-90/gaffer/security-secret-handling/github.svg)](https://agentmods.dev/skills/tmj-90/gaffer/security-secret-handling)
Your own site
<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.

agentmods 80×15 button for security-secret-handling

Your own site · 80×15
<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>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,804 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.00068 $0.01804
Opus 5.5 $0.00027 $0.00722
Sonnet 5.5 $0.00014 $0.00361
Haiku 4.5 $0.00007 $0.00180

Measured 1mo ago against content hash 1b5cf6170022, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

runner/skills/security-secret-handling/SKILL.md · 121 lines

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

  1. Find the mechanism. Call search_lore for 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, a secrets/ dir, …). Searching code for process.env or for the word credentials is fine — a search pattern is not a file — but never point a search at a secret file.
  2. 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=changeme in the repo's config schema, README or non-.env example 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.template is 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.
  3. 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.
  4. Keep it server-side. Nothing secret goes into a client bundle. Build-time variables prefixed NEXT_PUBLIC_, VITE_, REACT_APP_ or EXPO_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.
  5. Keep it out of every output.
    • Add the field to the logger's redaction list, or wrap it in a type whose toString/repr/toJSON prints ***.
    • 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 -x around secret use.
    • In Dockerfiles, do not put secrets in ARG/ENV, which persist in image layers. Use build secret mounts.
  6. 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).
  7. 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 kid or 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 the auth-session-and-oauth skill).
  8. Scan before you finish. Find the branch base: run git merge-base HEAD origin/HEAD (or git merge-base HEAD <default_branch>) and use the printed SHA as $BASE. The safety hook blocks $(…) substitution, so paste the SHA.
    • If gitleaks is on PATH, run gitleaks git --log-opts="$BASE..HEAD" --redact --no-banner .. Otherwise run git 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.
  9. 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.
  10. Evidence. Record the scan command and result plus the tests through the record-evidence skill, without quoting any secret value, then stop.

Read the full file on GitHub · 121 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. 1mo ago Changed · +3 lines 1b5cf6170022
  2. 2mo ago Changed · +68 lines 9a445c1c543b
  3. 3mo ago First seen · 50 lines · 68 tokens per session scan A 4363617eff32

Subscribe to this mod's changes

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.

Related

security-secret-handling compared with skills from other repositories

security-secret-handling next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
security-secret-handlingtmj-90/gafferSkill14d agoApache-2.0A68Claude Code, Codex
bulwark-brainstormQBall-Inc/the-bulwarkSkill9yesterdayMITA50Claude Code
plan-creationQBall-Inc/the-bulwarkSkill9yesterdayMITA38Claude Code
anthropic-validatorQBall-Inc/the-bulwarkSkill9yesterdayMITA40Claude Code
create-subagentQBall-Inc/the-bulwarkSkill9yesterdayMITA42Claude Code
test-auditQBall-Inc/the-bulwarkSkill9yesterdayMITA0Claude Code
code-reviewQBall-Inc/the-bulwarkSkill9yesterdayMITA61Claude Code