hermes

Respond to a leaked secret

Produces an ordered response plan for an exposed key, token or password - revoke and rotate, audit use, clean up copies, notify and prevent. Use right after a secret is committed, logged or shared.

context

A secret that left its intended boundary must be treated as compromised. Automated scanners pick up keys from public repositories within minutes, and deleting the commit, force-pushing or making the repo private does not undo the copies already made. Forks, caches, CI logs and container layers keep their own copies. The only real fix is to make the leaked value useless, then find out whether anyone used it. Order matters: rotate first, then investigate, then clean up, because cleaning up first gives a false sense of safety and can destroy evidence.

task

A was exposed: Only if [USED_BY] is given: It is used by:

Write the response plan.

  1. Rate the severity from what the secret can do (its scopes and permissions), how public the exposure was, and for how long.
  2. Order the steps so the leaked value is revoked first. If there are signs of active misuse, revoke at once and accept the outage. Otherwise, where revoking it at once would cause an outage, say so and give the fastest safe order: create a second credential, deploy it, then revoke the old one, with a time limit on that window. If the credential type or provider is unclear, give the generic containment steps first, then ask.
  3. If the repository is available, search it for every place the secret is read (environment variable names, config keys, secret manager paths) so the rotation misses no consumer. List the places you found.
  4. Say how to check whether the secret was used during the exposure window (first exposure to revocation): which audit or access logs this kind of credential has, what to filter on, and what unexpected use looks like. Include persistence an attacker may have created with it: new users, keys, tokens, OAuth apps, webhooks, deploy keys or scheduled jobs.
  5. Cover clean-up as hygiene after revocation, and say what it does not fix: remove the secret from current code and config; rewrite history only if needed, with a coordinated force-push; ask the host to purge cached views where it offers that; and check the other places copies live (forks, pull request refs, CI logs and artifacts, container image layers, chat, tickets, paste sites).
  6. Say who to notify: the security owner and the owner of the service the credential protects. If personal or customer data may have been accessed, involve legal or privacy staff early, because notification deadlines may apply.
  7. Recommend the two or three controls that would have prevented this specific leak, for example push-time secret scanning, short-lived credentials such as workload identity federation for CI, and least privilege on the replacement.
constraints
  • Never ask for the secret's value. If the user pasted it, tell them in the first line that it is now exposed in this conversation too and must be rotated regardless.
  • Never present deleting the commit, rewriting history or making a repository private as a fix.
  • Give exact console paths or CLI commands only when you are sure of them for this provider. Otherwise name the provider's official documentation page to follow. Do not invent flags.
  • Do not run any command that changes production; the user runs the steps. Mark each command that changes state.
  • Do not decide whether a legal notification is required; say who should decide.
  • Keep it short enough to follow during an incident: imperative sentences, one action per line.
  • Separate what you verified from what you inferred. Mark inferences as such.
  • When you do not know, say "I don't know" once and state what would settle it.
output format

Severity

One line: critical, high, medium or low, and why (what an attacker could do with it).

Do now

Numbered steps for the next 15 minutes, revocation first.

Rotate

Numbered steps to issue the new secret and update every consumer, with the consumers found in the repo.

Investigate

Which logs to check, the time window, the filter, and what counts as suspicious use.

Clean up

A checklist in order, after rotation: code and config, history, caches and other copies, with what each step does and does not achieve.

Notify

Who, and what to tell them.

Prevent

Two or three controls, each tied to how this leak happened.

Incident record

Fields to record: credential, exposure start, detection, revocation time, evidence of use, follow-ups.

Unknowns

Facts you need from the user that would change the plan. "None" if none.

2 required values still a placeholder; the assistant will ask for them.

details

kind
Prompt: a task you run by name to get one finished thing back
domain
Software engineering
category
Security
level
Beginner
made for
Security engineer, DevOps / platform engineer, Software engineer
needs
repo-read
risk
read-only
version
v1.1.0 · experimental
reviewed
2026-10-02
aliases
handle-leaked-secret
works in
Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Antigravity, OpenCode, Windsurf, Zed, Continue, AGENTS.md

Edit on GitHubReport a problem

use in

Hodios CLI
npx @hermes-hq/hodios install respond-to-leaked-secret --target claude-code
Agent Skills
npx skills add hermes-hq/hodios-dist --skill respond-to-leaked-secret -a claude-code
Add the Hodios marketplace (once)
claude plugin marketplace add hermes-hq/hodios-dist
Install the software-engineering plugin
claude plugin install hodios-software-engineering@hodios

The plugin brings every entry in this domain at once.

pairs well with

All of Security
PersonaSecurity

Security auditor

Reviews code for exploitable weaknesses and reports only issues with a concrete attack path. Use as a reviewer persona or subagent for security-sensitive changes.

security-auditor
PersonaIncident and operations

Incident commander

Runs a live incident like an experienced incident commander, assigning roles, keeping a steady comms cadence and driving mitigation before root cause. Use as the coordinating voice during an outage.

incident-commander
PromptSecurity

Review an API against the OWASP API Top 10

Reviews an API design or implementation against the OWASP API Security Top 10, from object-level authorization and mass assignment to rate limits and SSRF, with attack paths and fixes.

review-api-security
PromptSecurity

Review a cloud IAM policy

Reviews AWS, GCP or Azure IAM policies for over-broad permissions, privilege-escalation paths, wildcard resources and missing conditions, and proposes least-privilege versions.

review-cloud-iam-policy
PromptSecurity

Review a pull request for security

Reviews a diff for exploitable vulnerabilities and reports only findings with a concrete attack path. Use before merging changes to input handling, auth, data access or dependencies.

review-pr-for-security
PromptSecurity

Threat model a feature

Builds a threat model for one feature or change, mapping data flows and trust boundaries to ranked threats and mitigations. Use during design, before the code is written or merged.

threat-model-feature