INTERACTIVE AGENTS · COUNTERFACTUAL EVALUATION

State-Complete Replay: Validity Conditions for Counterfactual Evaluation of Interactive Agents

When does replay recover the counterfactual world an evaluator intends?

Amir Reza Peimani2026Submitted / under review

A matching transcript can conceal a different environment. Replay validity requires restoring the state that affects the intervention and its continuation, including tool, session, and latent user state.

Counterfactual evaluation changes an action and asks what would have happened. Replaying against the wrong hidden state can hide real improvements, create spurious ones, or change the selected intervention.

Approach

Define replay-equivalent state for the intervention being evaluated. Use state challenges and independent branch restoration, then document the relevant conditions in a Replay Validity Certificate.

Main result

3 / 20wrong effects despite matching visible branches in ReplayShop

Visible-only ReplayShop replay matched the visible branch in all 20 cells but recovered the wrong effect in three. Prefix re-execution and full checkpoint restoration recovered every reference effect. ToolSandbox ablations separately exposed the contributions of tool state and latent user state.

Original Figure 2: visible branch matches and incorrect effects across ReplayShop replay methods. Visible-only replay matches every branch view while producing three incorrect effects.
Original Figure 2: visible branch matches and incorrect effects across ReplayShop replay methods. Visible-only replay matches every branch view while producing three incorrect effects. Open full resolution ↗
Which hidden state does replay need?
Figure 3. ToolSandbox state ablations across eight intervention cells. Tool state and latent user state contribute separately; full restoration recovers all eight reference effects.
Figure 3. ToolSandbox state ablations across eight intervention cells. Tool state and latent user state contribute separately; full restoration recovers all eight reference effects. Open full resolution ↗