Key rotation is replacing a cryptographic key or credential with a new one on a schedule or after exposure, and retiring the old one.
Key rotation limits how long a single key can be abused and how much data it protects. For cryptographic keys, NIST SP 800-57 describes a cryptoperiod: the time span in which a key may be used to protect data. After that, a new key takes over and the old one is retired or kept only for decryption. For credentials such as API keys, database passwords and tokens, rotation means issuing a new secret, updating every consumer, verifying it works, and then revoking the old one. The hard part is the overlap: if you revoke too early, something breaks; too late, and a leaked key stays valid. Many providers support two active keys at once or a grace period for this reason. Rotation is mandatory after a suspected leak and good practice otherwise, though short-lived credentials from an identity provider reduce the need to rotate by hand. The OWASP Secrets Management Cheat Sheet recommends automating rotation to avoid human error. Manual rotation across many services is where secret sprawl hurts most, because nobody knows where each key is used. BotPassword is building a rotate intent (partly built) in which a broker performs the change at the provider and updates the stored secret without the agent being handed either value.