secrets-rotation
Skill112 starsChanged 2 months agoMITView on GitHub
What to do the moment a secret is exposed — pasted into chat, committed, logged, shown in a transcript or a screenshot. The secret is compromised; only revoking and rotating it helps. Turns it into one tracked task with an escalation, not a reminder repeated every session. Use when you see a key, token, password or private key anywhere it should not be ("ключ в чате", "токен в логах", "закоммитил .env"). Loaded by security-officer, l3-support, devops.
- Reads credentials
In this repository35 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- aesthetic-instrumentSkill
- anti-patternsSkill
- anydesignSkill
- archetype-review-baseSkill
- brainstormingSkill
- build-speedSkill
- codex-hostSkill
- committed-aestheticSkill
- cost-modelSkill
- crystallizeSkill
- decision-evalSkill
- deploy-landedSkill
- discoverySkill
- done-blockedSkill
- great_ctoSkill
- lifecycle-messagingSkill
- migration-ready-schemaSkill
- observability-baselineSkill
- opportunity-solution-treeSkill
- outcome-roadmapSkill
- pm-planningSkill
- pre-mortemSkill
- product-economicsSkill
- prose-styleSkill
- quant-validationSkill
- signing-preflightSkill
- skeptical-triageSkill
- stack-baselineSkill
- test-strategySkill
- ui-ux-pro-maxSkill
- vertical-onboardingSkill
- verticalsSkill
- well-architectedSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 30
Never repeat the value: Not in your answer, not in a task title, not in a log, not in a commit message.
- Very specific: line 53
every consumer was redeployed and uses it (deploy-landed, config check).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
secrets-rotation — an exposed secret is spent
Deleting the message, rewriting git history or redacting the log does not un-expose a secret: the transcript, the remote, the backup and the provider's own logs already hold it. The only fix is to make the exposed value worthless — revoke it and issue a new one.
What went wrong on real projects is not ignorance of that. It is that the rotation was remembered instead of tracked: "rotate the exchange API keys" was carried forward through seven session logs; "keys that passed through chat" appeared in seven summaries of another project; a monitoring token pasted in plain text was never rotated. Each session wrote the reminder again and nobody owned it.
The moment you see one
- Never repeat the value. Not in your answer, not in a task title, not in a log, not
in a commit message. Name its kind and where it is: "OpenRouter API key, in the
operator's message of 22.09, 14:10".
scripts/lib/secret-patterns.mjsnames the kind. - Say it plainly, first line: this key is compromised; revoking it is the only fix.
Open one task, not a note — in Beads if the project has it:
bd create "Rotate <kind> exposed in <where> on <date>" -t bug -p 0 \ -d "Exposed: <where>. Revoke at <provider console>, issue new, store in <secret store>, redeploy <consumers>, prove the old one is rejected."Priority 0 for a production credential or anything that moves money; 1 otherwise.
- If you can rotate it, rotate it — the operator asked you to handle it, or your task covers that system. If it needs the operator (a provider console you cannot reach, a hardware token), the task's first line says exactly what they must click.
Done means the old value is refused
A rotation is closed with evidence, not with "rotated":
- the new value is in the secret store the code reads — never in
CLAUDE.md,preferences.md, memory files, a README or any file that is loaded into a model's context (one key in a preferences file reached 605 transcripts); - every consumer was redeployed and uses it (
deploy-landed, config check); - a call with the old value fails — 401/403 from the provider. That is the proof.
Carrying it forward
An open rotation task older than 48 hours goes to the top of the next session's report
and of /inbox, with its age. Do not re-list it in the session log as a fresh item —
link the task. Re-writing a reminder is how the seven-session carry-over happened.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

