cryptographic-agility-and-secret-lifecycle-gate
Skill4 starsChanged 31 days agoMITView on GitHub
Review authenticated encryption, key-version migrations, encryption key retirement, and service-secret rotation. Use when a change affects cryptographic libraries, key storage, KMS permissions, or credential handling.
In this repository47 other files it gives its agents.
- AGENTS.mdAGENTS.md
- anti-slop-engineeringSkill
- anti-slop-engineeringSkill
- api-ergonomics-and-contract-governorSkill
- apple-craft-and-frame-budgetSkill
- apple-craft-and-interaction-physicsSkill
- asset-provenance-guardSkill
- backprop-guardSkill
- chaos-and-degradation-choreographerSkill
- chromatic-drift-guardSkill
- cognitive-load-and-attention-governorSkill
- comment-budget-guardSkill
- context-window-and-token-economics-architectSkill
- decision-guardSkill
- demock-guardSkill
- design-system-drift-guardSkill
- deterministic-simulation-and-property-testingSkill
- distributed-consensus-and-concurrency-gateSkill
- finops-and-unit-economics-governorSkill
- future-scale-gateSkill
- grumpy-senior-staff-engineerSkill
- honeypot-trap-guardSkill
- house-tell-guardSkill
- install-anti-slopSkill
- llm-eval-and-prompt-injection-fortressSkill
- mandela-guardSkill
- mechanical-sympathy-and-perf-gateSkill
- mechanical-sympathy-profilerSkill
- motion-runtime-guardSkill
- observability-and-slo-architectSkill
- observability-and-slo-gateSkill
- paranoid-principal-architectSkill
- pr-boundary-guardSkill
- privacy-and-data-lineage-gateSkill
- re0-handoff-guardSkill
- reduction-guardSkill
- repo-memory-and-invariant-stewardSkill
- root-fix-gateSkill
- safe-evolution-and-rollout-choreographerSkill
- scientific-fault-isolationSkill
- styleseed-guardSkill
- supply-chain-and-sbom-sentinelSkill
- tagore-guardSkill
- type-level-and-ast-slop-gateSkill
- ui-and-copy-disciplineSkill
- verification-oracle-architectSkill
- zero-downtime-migration-gateSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are 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.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 31
Keep values out of source, process arguments, logs, traces, test artifacts, and failure responses.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 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
Cryptographic Agility and Secret Lifecycle
Collect review evidence
- Identify the data and secret classes, where plaintext appears, trust boundaries, the party authorized to decrypt, and the effect of compromise or missing keys. Tie each claim to concrete code, deployed policy, or a sanitized trace.
- Record the library and algorithm versions, provider and regulatory constraints, whether ciphertext uses authenticated encryption with associated data (AEAD), and the key or credential owner. Review primitive choices for their exact use and deployment policy. Use a maintained library or provider API for cryptography.
- For nonce-sensitive AEAD such as AES-GCM, check how distinct encryptions avoid a repeated nonce under the same actual data key. Include concurrent writers, restarts, retries and restore from backup. A key alias can change without changing key material. Test with a forced duplicate on the application or library path responsible for detecting or preventing it. Check that plaintext is released only after authentication succeeds.
- For envelope encryption, review data-key generation, wrapping under a KMS-managed key, and separate permissions for data access and unwrap. Persist ciphertext, authentication metadata, the wrapped data key and the key reference needed for recovery. Bind record context such as tenant and purpose as authenticated data when relevant. Keep plaintext keys out of durable storage.
Change encryption versions
| Stage | Required evidence |
| Prepare | Inventory stored ciphertext and backups by envelope and key version. Deploy readers that recognize both formats before emitting the new format. Accept only supported format and algorithm combinations. Check the old and new read paths on isolated copies. |
| Change writers | Use one active write version. Preserve authorized reads of older ciphertext using its recorded version. Verify old and new readers during the rollout, including KMS timeouts and access denial. An unavailable key stops the dependent operation with a bounded, observable failure. |
| Migrate existing data | Rewrap data keys when only the KEK changes and provider support permits it. Re-encrypt data when replacing its data key or algorithm. Backfill idempotently, check concurrency, and compare object inventories and read success before retiring compatibility. |
| Roll back or retire | A rollback before retirement must retain a reader for ciphertext already written with the new version. Keep key access according to the approved recovery and retention policy. Test backup recovery, then revoke retired access and verify rejection. Escalate suspected compromise immediately and follow the approved incident plan. |
Rotate application secrets
- Inventory each consumer of the credential, its issuance scope, expiration, and rollback owner. Prefer short-lived credentials when supported. Issue and deliver the successor through the approved secret store, validate it with a canary consumer, roll it out, and verify that the prior credential is revoked at its issuer.
- Keep values out of source, process arguments, logs, traces, test artifacts, and failure responses. Review what the exception handler receives and what the logger emits. Test with a synthetic marker and inspect output from failed operations. Use safe event codes and version labels for correlation.
- Return a review decision with source evidence, known-answer results, rollout and restore results, and gaps. An exception must name the affected objects and callers, owner, reason, containment, expiry date, and removal test. Record a missing live KMS rehearsal as an evidence gap.
Verify
Run node --test rotation.test.mjs from the installed skill's examples directory, or bun test rotation.test.mjs. The test exercises Node's built-in AES-GCM against a public known answer and checks an offline lifecycle model. Run the same cases against your production library and an isolated test KMS to verify actual rotation, revocation, and recovery behavior. Scenario and expected results
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.

