Versions and rollback
Every change to a secret creates a new version. Old versions are kept, encrypted like the current one, so you can see who changed what and put a previous value back.
History
Section titled “History”- Dashboard: open a secret’s row menu and choose History. The sheet lists every version with its author, date and comment, and lets you reveal a past value.
- CLI:
anchor secrets history DB_URLlists the versions (no values);anchor secrets get DB_URL --at-version 3 --revealprints one past value (the stored value, not expanded). - API:
GET …/secrets/:key/versionsandGET …/secrets/:key/versions/:version.
Reading a past value is audited (secret.version_read), like reading the current one.
Rollback
Section titled “Rollback”Rollback restores the value and comment of a past version as a new version. Nothing is deleted, so a rollback can itself be rolled back.
- Dashboard: Roll back on a version in the history sheet.
- CLI:
anchor secrets rollback DB_URL --to 2(asks for confirmation;--yesin scripts). - API:
POST …/secrets/:key/rollbackwith{ "version": 2 }.
Rolling back to content equal to the current version is a no-op (“Already at that content”). The new version is encrypted under the project’s current key, so rolling back after a key rotation does not bring the old key back into use.
Deleting a secret deletes its history too.