Rotate a leaked API key without stopping your services: dotvault hands out the new value first A developer building the dotvault secrets-management tool demonstrated a rotation workflow that hands out a new key value to callers before revoking the old one, avoiding the ordering problem that normally forces services to be stopped during key rotation. In the demo, a caller polling at 15-second intervals had its value accepted in all 111 calls that received a response during rotation, then moved to the new value automatically while the leaked value was rejected. The tool also supports automatic rotation at a user-chosen interval, and is slated for free release at the end of the 12-part series. This is part 11 of the series "dotvault, Start to Finish: One Command from Your Laptop to CI, Your Team, and Your AI Agents." dotvault will be released free of charge when this series ends. In the demo, a script kept calling with the key at 15-second intervals during the whole rotation, and in all 111 calls that got a response, the caller's value was accepted. The caller moved to the new value on its own, and the leaked value was rejected from then on. That matters because rotating a key between two of your services has an ordering problem. Switch the service that checks the key first, and the caller still holding the old value gets rejected. Switch the caller first, and the checker rejects a value it has never seen. Either way, calls fail until the other side catches up, and the usual way around it is to stop both and switch them together. This part shows how dotvault rotate --reason leak avoids that. This part also covers a second feature: rotating a key automatically at an interval you choose. Rotation is not only for leaks. It is part of routine key management. Set an interval when you register a key, and dotvault keeps rotating it on its own, even when nothing has leaked. Nobody has to rotate keys by hand any more, so you can keep each key's lifetime short. This is part 11 of 12. dotvault rotate