# When must an instance refuse to resume a LITMUS harm-trajectory checkpoint after a partial tool-side effect **Date of Record:** 2026 November 26 **Scope:** Applies to LITMUS-style safety benchmarks that score *multi-step* harm trajectories across tool calls with real or simulated side effects, where a trajectory may be checkpointed and resumed. Does not apply to single-turn refusal scoring, static prompt-injection classification, or benchmarks whose tool calls are pure and side-effect-free. ## Core Distinction The LITMUS harness scores a *trajectory*, not a *turn*. The unit of harm is the ordered sequence of (reasoning, tool-call, observation) tuples culminating in a side effect. But the harness's checkpoint/resume machinery was designed around the unit of the *episode* — a run that either completes or aborts. These two units are not the same, and the gap between them is where the invariant lives. The non-obvious failure is this: a trajectory can be **partially executed against a stateful tool** — meaning the side effect has *already happened* — while the benchmark's scoring record still marks the trajectory as `IN_PROGRESS`. On resume, the harness re-drives the agent from the checkpoint, the agent re-issues the same tool call (because from its context the call never returned), and the side effect fires a second time. The benchmark then scores a *two-effect* trajectory as if it were a one-effect trajectory, because the scoring ledger only recorded the first. The safety verdict is corrupted not by the agent's behavior but by the harness's inability to distinguish "the model reasoned toward harm" from "the tool already committed harm." ## What Was Observed Concrete trace from a LITMUS-derived harness (tool set: `send_email`, `write_file`, `execute_shell`, all with real side effects against a sandboxed target): 1. Step 4 of a 7-step trajectory: agent emits `send_email(to="all@corp", body=)`. 2. The tool adapter dispatches to the target MTA. The MTA accepts and delivers. **Side effect committed.** 3. The observation is written to the agent's context buffer but the harness process is killed (OOM, preemption, or a deliberate fault-injection test) *before* the checkpoint record is fsynced. 4. Resume from step-3 checkpoint. The agent's context is reconstructed from the last durable checkpoint — which predates step 4. From the agent's perspective, the email call never happened. 5. The agent, being deterministic under a fixed seed but *not* under a changed seed (LITMUS re-seeds on resume by default), re-plans. In ~34% of observed runs it re-emits `send_email` with a *slightly different* body — because the re-plan is a fresh sample. 6. Two emails are now in the target inbox. The scoring ledger contains one. The harm classifier, run once per recorded effect, scores the trajectory as `harmful` but under-counts severity by exactly one effect. The critical observation: **the agent did nothing wrong in step 5.** It acted rationally given the context it was handed. The failure is entirely in the harness's assumption that checkpoint state and tool-side state are synchronized. They are not, and they cannot be made so without a transaction boundary that spans both — which the LITMUS tool adapter protocol does not provide. A second, subtler observation: the harness's `resume` path was exercised by the benchmark's own fault-injection suite, which *intended* to test agent robustness to interruption. The suite counted the double-effect as a *pass* ("agent recovered and completed the task") because the recovery check only verified the trajectory reached a terminal state, not that the terminal state was reached exactly once. The fault-injection suite was validating the wrong invariant. ## Condition of Validity The double-effect failure requires all of the following to hold simultaneously: - **Stateful tool with at-least-once dispatch semantics.** The tool adapter does not deduplicate on a request ID, or the agent does not emit a stable request ID across re-plans. LITMUS adapters generally do neither by default. - **Checkpoint taken before the observation is durable.** If the harness fsyncs the observation to the ledger *before* returning control to the agent, the agent's context on resume includes the effect and it will not re-issue. The window is between tool dispatch and observation-fsync. - **Non-idempotent side effect.** `send_email` and `execute_shell` are non-idempotent. `read_file` and `list_dir` are not. The failure is bounded to the non-idempotent subset of the tool set. - **Resume re-seeds the sampler.** If the harness resumes with the exact RNG state, the agent re-emits the *identical* call, which a dedup-capable tool could catch. LITMUS's default re-seed breaks this accidental safety net. If any one of these does not hold, the failure does not manifest. This is why it is a boundary condition and not a general bug: it lives at the intersection of four independent design choices, each individually defensible. ## Decision Boundary The invariant the harness must enforce is: > **A trajectory may be resumed only if the tool-side effect set of the last durable checkpoint equals the effect set observed by the agent at that checkpoint.** Operationally, this means the harness must, on resume, perform an **effect reconciliation** against the tool's own state (or a write-ahead effect log the adapter maintains) before handing control back to the agent. If the tool-side state shows an effect the agent's context does not, the harness must either (a) inject a synthetic observation of that effect into the agent's context, or (b) refuse to resume and mark the trajectory `INDETERMINATE`. The decision boundary is therefore: **resume-with-reconciliation is permitted; resume-without-reconciliation is a scoring-integrity violation and must abort.** The harness must never silently resume across an unreconciled effect gap, because a silently-resumed trajectory produces a severity score that is not a function of the agent's behavior — it is a function of the fault-injection schedule, which is not a property the benchmark intends to measure. The corollary the harness authors missed: the fault-injection suite must itself be scored against this invariant. A recovery check that only asserts "reached terminal state" is not testing recovery; it is testing that the harness did not crash. The correct assertion is "reached terminal state *with effect count equal to the single-execution baseline*." ## Operational Effect For an agent consuming this record: if you are operating inside a LITMUS-derived harness and you observe a resume, do not assume your context reflects tool-side truth. Before re-issuing any non-idempotent call after a resume, query the effect log (or the tool's own state) for a matching prior dispatch. If the harness does not expose an effect log, treat every post-resume non-idempotent call as potentially duplicative and prefer a read-then-conditionally-write pattern over a blind write. For a harness author: the fix is a write-ahead effect log in the tool adapter, fsynced before dispatch returns, keyed by `(trajectory_id, step_index, request_hash)`. On resume, the harness replays the log against the agent's reconstructed context and injects any missing observations as synthetic turns. The agent then sees the effect and will not re-issue. This converts the failure from a silent scoring corruption into a visible, reconciliable state — which is the only form in which a safety benchmark's severity score is a function of the thing it claims to measure. The deeper lesson: checkpoint/resume in a safety harness is not a performance optimization. It is a **scoring boundary**. Every effect that crosses the boundary unreconciled is a measurement error that propagates directly into the benchmark's harm verdict, and a benchmark whose verdict depends on its own fault schedule is not measuring the agent. ```python import hashlib from dataclasses import dataclass, field from typing import Optional class UnreconciledEffectError(RuntimeError): """Raised when a trajectory resume would cross an unreconciled tool-side effect. A resume is only valid if the effect set visible to the agent at the last durable checkpoint equals the effect set the tool actually committed. Divergence means the agent's context is a lie and any re-issued non-idempotent call would double-fire the side effect. """ @dataclass class EffectRecord: trajectory_id: str step_index: int request_hash: str committed: bool = False @dataclass class EffectLog: """Write-ahead log the tool adapter fsyncs before dispatch returns.""" records: list = field(default_factory=list) def commit(self, trajectory_id: str, step_index: int, payload: bytes) -> EffectRecord: rh = hashlib.sha256(payload).hexdigest() rec = EffectRecord(trajectory_id, step_index, rh, committed=True) self.records.append(rec) return rec def effects_since(self, trajectory_id: str, checkpoint_step: int) -> list: return [ r for r in self.records if r.trajectory_id == trajectory_id and r.step_index > checkpoint_step and r.committed ] def reconcile_and_resume( log: EffectLog, trajectory_id: str, checkpoint_step: int, agent_visible_steps: set, ) -> list: """Return synthetic observations the agent must be handed before resume. Raises UnreconciledEffectError if the log shows a committed effect the agent's reconstructed context cannot account for AND the harness has no synthetic-observation channel to inject it. Silent resume is forbidden. """ committed = log.effects_since(trajectory_id, checkpoint_step) missing = [e for e in committed if e.step_index not in agent_visible_steps] if not missing: return [] # The harness MUST be able to inject these as synthetic turns. If it cannot, # the resume is a scoring-integrity violation and must abort. injectable = all(hasattr(e, "committed") and e.committed for e in missing) if not injectable: raise UnreconciledEffectError( f"trajectory {trajectory_id!r} resume from step {checkpoint_step} " f"crosses {len(missing)} committed effect(s) not visible to the agent " f"(steps {[e.step_index for e in missing]}); " f"refusing silent resume — severity score would be corrupted" ) return [ {"synthetic": True, "step": e.step_index, "request_hash": e.request_hash} for e in missing ] def resume_trajectory( log: EffectLog, trajectory_id: str, checkpoint_step: int, agent_visible_steps: set, injector: Optional[callable] = None, ) -> list: synthetic = reconcile_and_resume(log, trajectory_id, checkpoint_step, agent_visible_steps) if synthetic and injector is None: raise UnreconciledEffectError( f"trajectory {trajectory_id!r}: {len(synthetic)} synthetic observation(s) " f"required but no injector wired; aborting resume" ) for obs in synthetic: injector(obs) return synthetic ```