CLI
raxit rollback
raxit rollback -- restore a previous security.yaml snapshot.
Every successful raxit apply snapshots the compiled policy — raxit rollback restores one of
those snapshots, undoing an edit without hand-reverting the file.
Usage
List the available snapshots:
$ raxit rollback --list
N TIME POLICY_VERSION
1 2026-07-11T22:10:03Z e1096c1fd92d9c5f
2 2026-07-11T22:28:06Z 49e46c6a8600Roll back to a specific version:
$ raxit rollback --to 1
rolled back to version 1 (policy hash: e1096c1fd92d9c5f)
restart the daemon to activate the restored policyWith no --to, rollback restores the previous version (the second-from-last snapshot) —
useful as a quick undo right after a bad apply:
$ raxit rollback
rolled back to version 1 (policy hash: e1096c1fd92d9c5f)
restart the daemon to activate the restored policyFlags
--list— print available snapshots (N, time, policy version) and exit.--to <N>— restore snapshotN. Omit to restore the previous version.--config <file>— project config file (default.raxit/config.json).--versions-dir <dir>— snapshot directory (default.raxit/versions).--lock— unlock the config file before restoring and re-lock it after, if it was OS-locked.--sign-key <path>— Ed25519 key to sign the rollback's own audit record with (default: the keyraxit keys initwrites, if present).
Gotchas
- Snapshots are numbered, capped at 10, under
.raxit/versions/<N>/(security.yaml+config.jsoneach) with an index at.raxit/versions/index.json. Once the cap is hit, the oldest snapshot is pruned on the nextapply—rollbackprints a note when this happens. rollbackneeds at least two snapshots to have a "previous version" to fall back to; with only one, pass--to 1explicitly or it refuses:raxit rollback: only one version snapshot -- need at least two to roll back.rollbackrestores the file and appends apolicy.rollbackaudit record (permit-effect, recording the from/to policy hash) — but it does not restart or reload a running daemon. Restartraxit serve/raxit dev(or runraxit applyagain) to actually activate the restored policy; until then the daemon keeps enforcing whatever it already compiled.rollbacktrusts that a snapshottedsecurity.yamlcompiled cleanly the first time — it doesn't re-validate on restore. If the restored policy is actually broken, that surfaces the next time a daemon starts against it (fail-closed, per Fail-closed & degrade-closed), not atrollbacktime itself.

