rotate-secrets

rotate-secrets is a skill for Claude Code, Codex from OnlyTerp/hermes-optimization-guide. It costs 22 tokens per session (1,305 once invoked), scanned B, original, MIT.

A procedure for replacing webhook signatures, API keys, OAuth tokens, and related secrets in a gateway configuration. It backs up the environment file and updates affected services after rotation.

In plain words
What is it for?
Use it to rotate matching secrets in the gateway environment, generate new HMAC or webhook values, request replacements for external credentials, and restart only affected gateways.
Why use it?
It reduces the risk of leaving exposed or expired credentials active and avoids corrupting values that contain special characters.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/onlyterp/hermes-optimization-guide/rotate-secrets
Any agent
npx skills add OnlyTerp/hermes-optimization-guide --skill rotate-secrets
Clone the repo
git clone --depth 1 https://github.com/OnlyTerp/hermes-optimization-guide

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 rotate-secrets

README.md
[![agentmods](https://agentmods.dev/badge/skills/onlyterp/hermes-optimization-guide/rotate-secrets.svg)](https://agentmods.dev/skills/onlyterp/hermes-optimization-guide/rotate-secrets)
Your own site
<a href="https://agentmods.dev/skills/onlyterp/hermes-optimization-guide/rotate-secrets"><img src="https://agentmods.dev/badge/skills/onlyterp/hermes-optimization-guide/rotate-secrets.svg" alt="Measured on agentmods" height="20"></a>
Per session 22 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,305 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
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.00022 $0.01305
Opus 5 $0.00011 $0.00652
Sonnet 5 $0.00004 $0.00261
Haiku 4.5 $0.00002 $0.00130

Measured 6d ago against content hash f74936a242f5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade B, and why

rotate-secrets scanned grade B with 1 finding 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 6d 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

' ~/.hermes/.env > "$tmp" && chmod 600 "$tmp" && mv "$tmp" ~/.hermes/.env
skills/security/rotate-secrets/SKILL.md · 105 lines

How it starts

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

rotate-secrets — Atomic Secret Rotation

Rotate secrets in ~/.hermes/.env, propagate the new values to every service that consumes them, and restart only the affected gateways.

Procedure

  1. Parse the pattern. Match against every key in ~/.hermes/.env. Support glob syntax (*, ?, [abc]) and the literal all.

  2. For each matched key: a. Determine the secret kind from the key name:

    • *_HMAC_* or *_WEBHOOK_SECRET → generate openssl rand -hex 32
    • *_API_KEY → prompt the user to provide the new value (can't auto-rotate external APIs)
    • GITHUB_*_TOKEN → open https://github.com/settings/tokens and prompt for new PAT
    • TWILIO_AUTH_TOKEN → direct user to rotate in Twilio console and prompt for new value
    • Unknown pattern → prompt user for the kind

    b. Back up the current .env as ~/.hermes/.env.bak.YYYYMMDDHHMMSS before any write.

    c. Update the .env atomically. Don't build a sed s/// expression from the key or value — secret values routinely contain /, &, and \, which corrupt the substitution (and switching the delimiter to | just moves the problem). Use exact-match rewrite instead:

    tmp=$(mktemp ~/.hermes/.env.XXXXXX)
    KEY="$KEY" NEW_VALUE="$NEW_VALUE" awk -F= '
      $1 == ENVIRON["KEY"] { print ENVIRON["KEY"] "=" ENVIRON["NEW_VALUE"]; found=1; next }
      { print }
      END { if (!found) print ENVIRON["KEY"] "=" ENVIRON["NEW_VALUE"] }
    ' ~/.hermes/.env > "$tmp" && chmod 600 "$tmp" && mv "$tmp" ~/.hermes/.env
    

    This appends the key if it was missing, keeps 0600 perms, and never interprets a secret as a regex.

  3. Propagate to external services. For HMAC / webhook secrets, update the remote side:

    • GitHub webhooks: use github MCP to PATCH /repos/{owner}/{repo}/hooks/{hook_id} with config.secret
    • Twilio: user-guided — we don't touch Twilio SMS webhook config automatically
    • Slack: user-guided — rotate signing secret in App Manifest
    • Discord: user-guided — rotate public key in Developer Portal
    • Generic webhook: ask the user where the producer-side config lives

Read the full file on GitHub · 105 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. 6d ago First seen · 105 lines · 22 tokens per session scan B f74936a242f5

Subscribe to this mod's changes

rotate-secrets is a skill published in the GitHub repository OnlyTerp/hermes-optimization-guide (629 stars, last pushed 8d ago), licensed MIT. It adds 22 tokens to every session and 1,305 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens

chronicle

Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting…

microsoft/vscode · 72 tokens