secrets-management

secrets-management is a skill for Claude Code, Codex from d-o-hub/github-template-ai-agents. It costs 94 tokens per session (1,051 once invoked), scanned A, original, MIT.

A process for finding, revoking, replacing, and safely storing API keys, tokens, and other credentials. It treats a credential found in code or history as exposed until checked and resolved.

In plain words
What is it for?
Scanning repositories and history, rotating exposed keys, choosing environment variables or secret managers, and setting up prevention checks.
Why use it?
Hardcoded or leaked credentials can let others access systems, even after the visible code is cleaned up. This process puts revocation first and adds checks to prevent repeat leaks.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit Scanning repositories and history, rotating exposed keys, choosing environment variables or secret managers, and setting up prevention checks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/d-o-hub/github-template-ai-agents/secrets-management
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 d-o-hub/github-template-ai-agents --skill secrets-management
Clone the repo
git clone --depth 1 https://github.com/d-o-hub/github-template-ai-agents

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-management

README.md
[![agentmods](https://agentmods.dev/badge/skills/d-o-hub/github-template-ai-agents/secrets-management/github.svg)](https://agentmods.dev/skills/d-o-hub/github-template-ai-agents/secrets-management)
Your own site
<a href="https://agentmods.dev/skills/d-o-hub/github-template-ai-agents/secrets-management"><img src="https://agentmods.dev/badge/skills/d-o-hub/github-template-ai-agents/secrets-management/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-management

Your own site · 80×15
<a href="https://agentmods.dev/skills/d-o-hub/github-template-ai-agents/secrets-management"><img src="https://agentmods.dev/badge/skills/d-o-hub/github-template-ai-agents/secrets-management.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 94 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,051 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.00094 $0.01051
Opus 5.5 $0.00038 $0.00420
Sonnet 5.5 $0.00019 $0.00210
Haiku 4.5 $0.00009 $0.00105

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

Security

Grade A, and why

secrets-management 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 4d 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.

.agents/skills/secrets-management/SKILL.md · 101 lines

How it starts

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

Secrets Management

Detect, rotate, and store secrets. A leaked secret is an incident: revoke first, clean history second, prevent third.

When to Use

  • Suspected or confirmed leaked API key, token, or credential
  • Choosing where a secret lives (env, manager, vault, CI secrets)
  • Rotating keys on schedule or offboarding
  • Reviewing code that handles secrets

Steps

  1. Detect — scan with gitleaks; treat any hit as live until proven otherwise. Check history too (git log -S), not just HEAD.
  2. Revoke first — rotate at the provider before cleaning the repo. A cleaned repo with a live leaked key is still an incident.
  3. Clean — purge from history if needed; confirm with a rescan.
  4. Store correctly — env vars or a secret manager; CI secrets for pipelines; never hardcoded, never in docs or chat logs.
  5. Prevent — pre-commit hooks (gitleaks), least-privilege scopes, short TTLs, and rotation reminders.

Rules

  • Never print a secret, even redacted-partially, into logs or PR comments.
  • Never echo a secret value back, even if the user pasted it into the conversation or asks for a copy "for debugging". Offer the reference name (STRIPE_SECRET_KEY) or the command to fetch it instead.
  • Never commit a "test" secret that resembles a real one.
  • Separate secret values from secret references in every example.

Filenames Are Not the Boundary

A tool that reads or writes paths supplied by an agent needs one real control: containment. Resolve the path, then assert it is still inside the allowed base.

base = base.resolve()
candidate = (base / raw).resolve()
candidate.relative_to(base)   # raises => escapes the base => reject

That is default-deny and holds for every file format that exists tomorrow.

A credential-filename denylist (.pem, .tfvars, .sops.yml, .age, …) is a name policy layered on top of it. It only ever decides "which in-base names to also refuse", so it cannot be complete: each new keystore, VPN bundle, or secret-manager file format is another bypass nobody listed. Track such a list's history before trusting it — this template grew one over 36 separate commits and it is still appending.

Read the full file on GitHub · 101 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 4d ago Changed · +32 lines b923b58e7f31
  2. 24d ago Changed · +5 lines · +94 tokens per session 569b9c7c997f
  3. 25d ago First seen · 64 lines · 0 tokens per session scan A 3e9cecd9cdab

Subscribe to this mod's changes

secrets-management is a skill published in the GitHub repository d-o-hub/github-template-ai-agents (2 stars, last pushed yesterday), licensed MIT. It adds 94 tokens to every session and 1,051 once invoked, about $0.0004 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-28.