Rotate a Vault secret without downtime
Phase 6 slice 3 introduced declaragent secrets rotate, which bumps a secret's version and triggers a graceful re-resolve across every active session.
The flow
- Rotate the underlying secret in Vault (out-of-band).
- Tell Declaragent to pick up the new version:
declaragent secrets rotate secret:slack/bot-token --reason "90-day schedule"
- Verify with
declaragent secrets describe secret:slack/bot-token— theversionfield should bump andlastRotatedAtshould be fresh.
What happens inside
Real rotation is provider-owned — Vault (or AWS SM / GCP SM) rotates the value
itself. declaragent secrets rotate marks the rotation moment on the Declaragent
side; it does not fan anything out to running sessions:
- The CLI re-resolves the ref to prove the provider + new value are reachable — a
failed resolve aborts with
✗ rotate abortedinstead of recording a rotation. - A
secret_accessrecord (requestercli:secrets-rotate) is written to the hash-chained audit log, so the rotation moment is traceable. - Live processes pick up the new value when their resolver cache TTL expires or on
restart — there is no
secret_rotatedbus event or live adapter rebind today; restart long-lived daemons (declaragent down && declaragent up -d) to force it.
Tenant scope
If you run multiple tenants, scope the audit record to the affected tenant:
declaragent secrets rotate secret:slack/bot-token --tenant acme-prod
Without --tenant, the record is written under the default tenant context.
Failure modes
| Symptom | Cause | Fix |
|---|---|---|
EPERM | Vault token lacks update on the path. | Refresh the Declaragent service principal's Vault policy. |
| Session sees stale value after rotate | Resolver cache TTL hasn't elapsed (no live fan-out exists). | declaragent secrets describe — if Declaragent sees the new version, restart the affected daemon (declaragent down && declaragent up -d). |
secret-rotation-overdue alert fires | SLO says rotate every N days; you haven't. | See runbook. |