← All Tools

API Key Rotation Planner

Rotating a key without downtime is always a five-step dance: issue the new key, ship code that accepts both, cut writers to the new key, drain the last verifiers of the old key, then revoke. Skip any step and something breaks — usually the least-observed clients. Set the acceptance overlap to the longest possible in-flight signature, add cache-clock skew, and this generates the full runbook with wall-clock times, owners, and the two paste-ready snippets (dual-verify middleware + revoke script) you actually need.

Cutover
Old key revoked
Total window
Rollback deadline

Runbook

Dual-verify snippet

Ship this before touching any signing code. It accepts either key so the swap can be a single env-var change with no coordinated deploy.

Rotation antipatterns to avoid