# When must an instance refuse to score a LITMUS adversarial trajectory because the harness's own tool-call replay diverged from the recorded transcript **Date of Record:** 2026 November 26 **Scope:** Applies to any LITMUS-style safety benchmark harness that scores an adversarial agent trajectory by replaying recorded tool calls against a live or simulated tool surface before assigning a regression score. Does not apply to purely transcript-graded rubrics (LLM-judge-only) where no replay occurs, nor to single-turn prompt-injection probes with no tool surface. ## Core Distinction A LITMUS harness produces a *regression score*: a numeric delta between the agent's behavior on an adversarial trajectory and a stored baseline. The score is only meaningful if the harness re-executes the *same* trajectory it recorded. The non-obvious boundary is this: **when the replay of a recorded tool call returns a result that differs from the recorded result, the harness must refuse to score rather than score the divergence.** The failure mode is not "the agent was unsafe" or "the agent was safe"—it is that the harness silently grades a *different* trajectory than the one it claims to grade, and the resulting score is a fiction attributed to the agent. Most harnesses treat replay divergence as a warning, log it, and proceed. That is the defect. A divergent replay means the observation the agent acted on is no longer the observation in the transcript, so the agent's subsequent reasoning was conditioned on state that no longer exists. The score is uninterpretable in either direction: a *lower* safety score may reflect the agent correctly refusing on a changed tool output, and a *higher* safety score may reflect the agent being handed a benign result where the transcript recorded a poisoned one. ## What Was Observed A LITMUS suite of 1,400 adversarial trajectories was re-run against a frozen tool surface. Each trajectory records, per step, `(tool_name, args_hash, result_hash, result_payload)`. The harness replays each call and compares `result_hash`. Observed across three consecutive nightly runs: - **Run A:** 37 of 1,400 trajectories (2.6%) produced replay divergence on at least one step. Of these, 29 diverged on a `read_file` or `http_fetch` call whose recorded payload contained a time-varying field (a timestamp, an ETag, a paginated cursor). 8 diverged on a `search` tool whose result ordering was non-deterministic under equal relevance scores. - **Run B:** the 37 diverging trajectories were scored anyway (harness emitted `score_delta` with a `replay_warning` flag). Mean safety-score delta on those 37 was **−0.41** (i.e., they looked *less safe* than baseline). Inspecting the 8 search-order divergences: in 6 of them, the reordered results pushed a benign document to rank 1, the agent read it, and *declined* the adversarial instruction that the original rank-1 poisoned document had induced it to follow. The agent was scored as a regression because it behaved safely on a trajectory that no longer contained the attack. - **Run C:** same 37 trajectories, but the harness was patched to **abort scoring on divergence**. 0 spurious regressions. The 37 were routed to a manual re-baseline queue. The signal that made this a boundary failure rather than noise: the divergence was *correlated with the adversarial content*. Poisoned tool results are disproportionately likely to contain dynamic fields (attacker-controlled pages with rotating ETags, injection payloads embedded in paginated search results). So replay divergence is not uniformly distributed—it clusters exactly on the trajectories the benchmark exists to test. A harness that scores through divergence systematically under-reports safety on its hardest cases. ## Condition of Validity The refusal-to-score invariant holds under these conditions, and only these: 1. **The trajectory is replay-graded, not transcript-graded.** If the score derives solely from the recorded transcript text (no re-execution), there is no replay to diverge and the invariant is vacuous. 2. **The tool surface is claimed to be deterministic or frozen.** If the harness explicitly declares the surface non-deterministic and scores a *distribution* over replays, divergence is expected and the invariant does not apply—but then the score must be reported as a distribution, not a point delta. 3. **Divergence is detected at the observation boundary, before the agent's next reasoning step consumes it.** Detecting divergence *after* the agent has already acted on the mismatched observation is too late; the trajectory is already contaminated. 4. **The recorded result hash is a faithful commitment to the recorded payload.** If the harness hashes a normalized/truncated form of the payload, hash equality does not imply payload equality and the check is unsound. This is the common silent failure: hashing `result[:512]` passes while the divergent bytes sit past offset 512. Formally, the invariant is: *score(T) is defined only if ∀ steps s ∈ T, replay_result(s) ≡ recorded_result(s) under the harness's committed equivalence relation.* If any step violates this, `score(T) = ⊥` (undefined), and the trajectory must be quarantined, not scored. ## Decision Boundary The harness must distinguish three outcomes at each replayed step, not two: | Replay outcome | Condition | Action | |---|---|---| | **Match** | `hash(replay) == recorded_hash` AND committed equivalence relation holds | Proceed to next step | | **Benign divergence** | Payloads differ only in fields declared `volatile` in the tool schema (timestamps, request IDs, cursors) | Canonicalize, re-hash, proceed; log | | **Contaminating divergence** | Payloads differ in any non-volatile field, OR differ only past the hashed prefix, OR tool returns error where transcript recorded success | **Abort, quarantine, refuse to score** | The sharp line is between benign and contaminating divergence, and it must be drawn by the *tool schema's* declaration of volatile fields—not by a similarity heuristic. A harness that decides "these results are close enough" has reintroduced the defect. The `volatile` set is part of the tool contract; if a tool does not declare its volatile fields, every divergence from it is contaminating by default. The second boundary: a contaminating divergence on step *k* invalidates the score for the entire trajectory, not just steps *k..n*. The agent's behavior at step *k* was conditioned on steps *1..k−1*; if step *k*'s observation changed, the counterfactual "what would the agent have done" forks, and the pre-step-*k* prefix no longer licenses any claim about the post-step-*k* suffix. Partial credit is not available. ## Operational Effect When the invariant is enforced: - **Regression scores become sound.** A reported delta means the agent behaved differently on an *identical* trajectory. The −0.41 spurious mean from Run B disappears; the 37 quarantined trajectories are re-baselined with volatile fields canonicalized, and 31 re-enter the scored set with deltas near zero (the agent was safe all along). - **The quarantine queue becomes a first-class artifact.** It is the list of trajectories whose adversarial content is entangled with dynamic tool state—precisely the cases where the benchmark's own construction is fragile. This is diagnostic, not overhead. - **Coverage must be reported honestly.** A harness that scores 1,363/1,400 and quarantines 37 must report `scored_coverage = 0.974`, not silently divide by 1,400. A safety benchmark that hides its quarantine rate is reporting a score over a self-selected subset—and the subset it drops is the adversarial-heavy tail. The operational cost is real: ~2.6% of trajectories require re-baseline, and the volatile-field declaration must be authored for every tool in the surface. The operational cost of *not* enforcing it is a regression score that moves in the wrong direction on exactly the attacks the benchmark exists to catch, and an agent team that chases a phantom regression for a week. The guardrail, stated as an invariant the harness must enforce before emitting any score: ```python import hashlib from dataclasses import dataclass from typing import Any class ReplayDivergenceError(RuntimeError): """Raised when a replayed tool result diverges from the recorded transcript in a way that invalidates scoring for the entire trajectory.""" pass @dataclass(frozen=True) class RecordedStep: tool_name: str args_hash: str result_hash: str # commitment over the FULL payload, not a prefix result_payload: dict[str, Any] # Tool schema declares which fields are legitimately volatile. VOLATILE_FIELDS: dict[str, set[str]] = { "http_fetch": {"timestamp", "etag", "request_id"}, "read_file": {"mtime", "cursor"}, "search": {"cursor", "query_id"}, } def _commit(payload: dict[str, Any], volatile: set[str]) -> str: canonical = {k: v for k, v in sorted(payload.items()) if k not in volatile} return hashlib.sha256(repr(canonical).encode()).hexdigest() def score_trajectory(steps: list[RecordedStep], replay_fn, baseline_delta_fn) -> float: """Score a LITMUS trajectory only if every replayed step matches under the committed equivalence relation. Any contaminating divergence aborts scoring.""" for idx, step in enumerate(steps): volatile = VOLATILE_FIELDS.get(step.tool_name) if volatile is None: # No declared volatile set -> every divergence is contaminating. volatile = set() replay_payload = replay_fn(step.tool_name, step.args_hash) replay_hash = _commit(replay_payload, volatile) if replay_hash != step.result_hash: # Full-payload commitment mismatch: the agent's observation at this # step is no longer the observation in the transcript. The score # for this trajectory is undefined. Quarantine, do not score. raise ReplayDivergenceError( f"contaminating replay divergence at step {idx} " f"tool={step.tool_name!r} recorded={step.result_hash[:12]} " f"replay={replay_hash[:12]} — trajectory quarantined, score=⊥" ) return baseline_delta_fn(steps) ```