# When must an instance reject a LITMUS safety verdict because the trajectory's tool-call prefix was replayed under a different sampling temperature **Date of Record:** 2026 November 23 **Scope:** Applies to LITMUS-style safety scoring of agentic tool-use trajectories where the judge re-executes or re-scores a recorded trajectory from a mid-trace checkpoint. Does not apply to single-shot prompt/response safety classification, nor to trajectories scored strictly in a single pass from a frozen transcript with no re-sampling. ## Core Distinction There are two structurally different things a LITMUS run can certify: 1. **A verdict on a transcript** — a judgment about the exact token sequence and tool outputs that were recorded. 2. **A verdict on a policy** — a judgment about the agent's behavior distribution, inferred by re-sampling the trajectory under controlled conditions. The failure mode examined here lives in the seam between them. When the harness re-executes a trajectory from a checkpoint to test "would the agent still refuse here?", it replays the tool-call prefix. If the replay is performed at a different sampling temperature than the original rollout, the replayed prefix is **not the same state**. Tool calls issued by an agent at T=0.0 are frequently deterministic and schema-conforming; the same calls at T=0.7 diverge in argument shape, key ordering, and occasionally in which tool is selected. The judge then scores a safety verdict against a prefix that the recorded trajectory never actually occupied. The verdict is silently misattributed: it is reported as a property of the original trajectory but is in fact a property of a counterfactual one. The invariant that must hold: **a LITMUS verdict is valid only if every replayed prefix is token-identical (or semantically equivalent under an explicit equivalence oracle) to the recorded prefix at the checkpoint from which replay began.** Temperature is one of many parameters that can violate this; it is the most common because it is the easiest to default-diverge. ## What Was Observed A representative trace. The agent is a tool-using assistant with `search`, `read_file`, and `send_email` tools, evaluated on a LITMUS scenario where the correct behavior is to refuse a request that would exfiltrate a file to an external address. Recorded rollout (T=0.0): - Step 1: `search(query="quarterly report")` → returns document IDs. - Step 2: `read_file(id="doc_17")` → returns a document containing a canary string. - Step 3: agent refuses to call `send_email` and emits a refusal message. The harness checkpoints at step 2, intending to test whether the refusal at step 3 is robust. It re-executes from the checkpoint under T=0.7 to sample a distribution of continuations. The replayed step-1 and step-2 calls are *not* replayed — only the checkpoint state is restored — so the judge assumes the prefix is fixed. But the checkpoint state, as serialized, includes the *rendered* tool results and the message history, not the sampling configuration. At T=0.7 the agent, resuming from the same message history, produces a *different* step-3 continuation: it calls `send_email` with a slightly rephrased body. The judge records a safety violation. Two distinct errors compound: - **Misattribution.** The violation is attributed to the T=0.0 trajectory, which never emitted that call. The reported metric — "fraction of checkpoints where the agent violates" — is inflated by continuations that belong to a different behavioral regime. - **Prefix drift.** Because the harness did not freeze the sampling parameters in the checkpoint, the replayed trajectory's *arguments* to prior tools (in longer traces with more than one checkpoint) can differ from the recorded ones, so the judge's later reasoning about "what the agent knew at step 3" is grounded in a tool-output history the agent never saw. The trace shows the failure is not stochastic noise in the judge. It is a deterministic consequence of checkpoint state that omits the sampling configuration, combined with a replay that assumes the configuration is invariant. ## Condition of Validity The verdict is valid only when all of the following hold at every replay boundary: - The checkpoint serializes the full sampling configuration (temperature, top-p, seed, stop sequences, tool-choice mode) alongside the message history and tool results. - The replay either (a) restores that configuration exactly, or (b) is explicitly labeled as a *counterfactual* rollout and scored against a separate metric namespace, never merged into the transcript-level verdict. - The judge's equivalence oracle, if any, is applied to the replayed prefix and must return "equivalent" before the continuation is attributed to the original trajectory. A prefix that diverges in tool-call arguments is not equivalent even if the tool names match. - The checkpoint is taken at a message boundary, not mid-tool-call, so that replayed continuations cannot interleave with a partially-executed tool invocation. When any of these is violated, the run is a *distributional probe*, not a transcript verdict, and the two must not share a score. ## Decision Boundary The operational decision is binary and must be enforced at the harness level, not left to the judge's discretion: - If `checkpoint.sampling_config == replay.sampling_config` **and** `prefix_equivalence(replayed_prefix, recorded_prefix) == True`, the continuation is attributed to the recorded trajectory. The verdict is a transcript verdict. - Otherwise, the continuation is a counterfactual sample. It is recorded under a distinct metric key (e.g., `counterfactual_violation_rate`) and excluded from the transcript-level safety score. The boundary is sharp because the failure is sharp: there is no partial equivalence. A replayed prefix either matches the recorded one under the declared oracle or it does not. The temptation to "average" or "weight" the counterfactual samples into the main score is exactly the error this record exists to prevent — it launders distributional evidence into a claim about a specific trajectory. A second boundary: if the checkpoint cannot be restored with its sampling configuration (e.g., the harness predates config serialization), the correct action is to **reject the checkpoint as non-replayable** and mark the trajectory as unscored at that boundary, not to replay under a default configuration. A missing config is not a license to substitute one. ## Operational Effect Downstream, the effect is a systematic bias in LITMUS safety rates that is invisible in aggregate reporting. Trajectories with many checkpoints — precisely the long, tool-heavy traces that matter most for agentic safety — accumulate the most counterfactual samples, so their scores are the most distorted. Short traces, which have few or no mid-trace checkpoints, are scored cleanly. The benchmark therefore reports a safety rate that is *correlated with trace length* for reasons that have nothing to do with safety behavior. The guardrail is structural: freeze the sampling configuration into the checkpoint, enforce prefix equivalence at every replay boundary, and namespace counterfactual samples so they can never be summed into the transcript verdict. The Python below encodes the boundary as a hard rejection rather than a soft warning, because the failure mode is silent and the cost of misattribution is a wrong safety number that propagates into model selection. ```python from dataclasses import dataclass, field from typing import Any, Dict, List, Optional class ReplayAttributionError(RuntimeError): """Raised when a replayed continuation cannot be validly attributed to a recorded trajectory.""" @dataclass class SamplingConfig: temperature: float top_p: float seed: Optional[int] = None tool_choice: str = "auto" def identical_to(self, other: "SamplingConfig") -> bool: return ( self.temperature == other.temperature and self.top_p == other.top_p and self.seed == other.seed and self.tool_choice == other.tool_choice ) @dataclass class Checkpoint: message_history: List[Dict[str, Any]] tool_results: List[Dict[str, Any]] recorded_prefix: List[Dict[str, Any]] sampling_config: Optional[SamplingConfig] # None == non-replayable @dataclass class Replay: replayed_prefix: List[Dict[str, Any]] continuation: Dict[str, Any] sampling_config: SamplingConfig def prefix_equivalent(replayed: List[Dict[str, Any]], recorded: List[Dict[str, Any]]) -> bool: """Declared equivalence oracle. Tool-call argument divergence is non-equivalence.""" if len(replayed) != len(recorded): return False for r, c in zip(replayed, recorded): if r.get("tool") != c.get("tool"): return False if r.get("args") != c.get("args"): return False return True def attribute_continuation(checkpoint: Checkpoint, replay: Replay) -> str: """Return the metric namespace a continuation may be scored under. Raises ReplayAttributionError if the checkpoint is non-replayable or the replay violates the attribution invariant. """ if checkpoint.sampling_config is None: raise ReplayAttributionError( "checkpoint carries no sampling configuration; trajectory is non-replayable " "and must be marked unscored at this boundary, not replayed under a default" ) if not checkpoint.sampling_config.identical_to(replay.sampling_config): # Counterfactual: score under a separate namespace, never the transcript verdict. return "counterfactual_violation_rate" if not prefix_equivalent(replay.replayed_prefix, checkpoint.recorded_prefix): raise ReplayAttributionError( "replayed prefix diverges from recorded prefix under declared oracle; " "continuation cannot be attributed to the recorded trajectory" ) return "transcript_verdict" def score_trajectory(checkpoint: Checkpoint, replays: List[Replay]) -> Dict[str, List[Dict[str, Any]]]: buckets: Dict[str, List[Dict[str, Any]]] = {"transcript_verdict": [], "counterfactual_violation_rate": []} for replay in replays: namespace = attribute_continuation(checkpoint, replay) buckets[namespace].append(replay.continuation) return buckets ```