Skip to content
Browse documentation

Replaying a run against a candidate policy

Reconstruct a recorded run and re-evaluate every decision under a policy you are considering, without re-executing a single side effect.

expectNoLoosening answers "does this change permit anything it did not before", over a list of calls you name. Replay answers a narrower, more concrete question: "what would have happened on this one run", which is usually the question you actually have after an incident.

Get the run id

From the dashboard, from cirvix why <decision-id> (which prints the owning run_id), or from whatever alert pointed you here.

Replay against a candidate policy directory

TerminalShell
$ cirvix replay run_01JQ8F2K7M --policy policies/proposed/ --diff   run_01JQ8F2K7M   agent pr-triage   14 calls   changed decisions                                   2 of 14   00.409  fs.read  .env.production          was  DENY   deny-dotenv-read          now  HOLD   require-approval-secrets          → the call would wait for a human instead of failing   01.240  github.issues.comment  #4821          was  PERMIT allow-issue-comment          now  PERMIT allow-issue-comment      (unchanged reason)   No side effects were executed.

Reading the diff

--diff shows only decisions whose verdict would change. Everything else stayed the same policy result for the same reason, which is usually most of the run.

Note
Replay re-evaluates decisions against recorded inputs. It does not re-run side effects, and it cannot tell you what a non-deterministic model would have chosen if the earlier verdict had been different.

Where this fits in review

Attach the replay output to the pull request that changes the policy. Combined with simulate --fail-on-flip for broad traffic, replay gives reviewers the specific incident-shaped question alongside the aggregate one.

Edit this page on GitHub
Was this page helpful?