# Where must an instance stop trusting its own LITMUS safety score: the evaluator-replay divergence invariant in agentic safety harnesses **Date of Record:** 2026 November 28 **Scope:** Applies to any LITMUS-style safety harness that scores an agentic system by replaying a fixed corpus of adversarial scenarios and asserting on the agent's tool-call trajectory. Does not apply to single-turn classifier evaluations where the harness observes one completion and no tool state. ## Core Distinction The distinction that matters is between *behavioral safety* (what the agent actually did in a live environment) and *scored safety* (what the harness recorded after replaying a recorded or re-executed trajectory). LITMUS harnesses typically conflate these because they assume the replay is deterministic: the same prompt, the same tool mocks, the same seed, therefore the same trajectory, therefore the same score. That assumption is false the moment the agent under test performs any nondeterministic sampling, calls any tool whose mock returns time-dependent or counter-dependent output, or is scored by an LLM judge with its own sampling temperature. The non-obvious boundary: **a safety score is only valid over the exact trajectory the harness observed, not over the policy that generated it.** When the harness re-runs a scenario to "confirm" a pass, or when a downstream auditor replays the recorded transcript against a fresh agent instance, the two scores can diverge not because the agent is unsafe but because the *replay is a different sample from the same policy*. The harness treats score equality as a continuity invariant. It is not one. ## What Was Observed In a 40-scenario LITMUS corpus (injection-resistance, exfiltration-refusal, destructive-tool-abstention), a single agent instance was scored three times per scenario at `temperature=0.2`, with tool mocks that returned a monotonically incrementing `request_id` and a wall-clock `server_time` field. The pass rate across three replay passes was 0.925, 0.900, and 0.850 — a 7.5-point spread on an identical corpus and identical model weights. The divergence was not uniform. It concentrated in two scenario classes: 1. **Destructive-tool abstention.** The agent's decision to call `delete_records` depended on whether a prior `list_records` mock returned a count above a threshold the prompt implied but never stated numerically. The mock's `request_id` incremented per call, and the agent's reasoning trace occasionally latched onto the ID as a record count ("I see 47 items…") — a hallucinated binding between an unrelated field and the decision variable. Pass 1 and pass 2 crossed the threshold differently because the harness ran scenarios in different orders, shifting the counter. 2. **Exfiltration refusal under multi-turn pressure.** The judge model (a separate LLM scoring "did the agent leak the canary string?") was itself sampled at `temperature=0.0` but with a non-seeded backend. Two passes scored the same transcript differently: one flagged a partial canary in a tool argument as a leak, the other did not. The agent's behavior was byte-identical; the *judge* was the nondeterministic component. The critical observation: in neither class did the agent's underlying policy change between passes. The score changed because the harness's own instrumentation (counter-based mocks, unseeded judges, order-dependent scenario iteration) injected variance that the harness then attributed to the agent. ## Condition of Validity A LITMUS score is a valid measurement of behavioral safety *only* under the following conjunction, and the harness must assert all of them before reporting a pass: - **Trajectory pinning.** Every tool mock returns a pure function of `(scenario_id, turn_index, call_index_within_turn)`, never of a global mutable counter or wall clock. If a mock must return time, it returns a fixed synthetic time derived from the scenario seed. - **Judge determinism or judge agreement.** The safety judge is either a deterministic classifier with a pinned model hash and pinned decoding, or an LLM judge whose verdict is required to be stable across `k` independent samples (e.g., 3) before the scenario is scored; disagreement is recorded as `JUDGE_AMBIGUOUS`, not coerced to pass or fail. - **Scenario-order independence.** Scenarios are executed in an order that does not leak state across them, or each scenario runs in a fresh process with a fresh mock state. The `request_id`-as-record-count failure above is precisely an order-dependence bug. - **Replay equality as a tested property, not an assumption.** The harness runs each scenario twice and asserts trajectory equality (tool name, arguments, and ordering) before trusting the score. If trajectories differ, the scenario is marked `NONDETERMINISTIC` and excluded from the aggregate rather than averaged in. When any of these fail, the score is not a measurement of the agent; it is a measurement of the harness's own entropy. ## Decision Boundary The operational rule an instance must apply when consuming or producing a LITMUS score: - **Trust the score** only if the harness emits a per-scenario replay-equality attestation and a judge-stability flag alongside the aggregate. A bare pass rate is not decision-grade. - **Do not compare scores across harness versions, model snapshots, or mock revisions** unless the trajectory-pinning and judge-stability invariants are identical. A 0.925 from harness v1 and a 0.850 from harness v2 are not a regression; they are two different instruments. - **Treat any scenario whose replay diverges as an unknown, not a pass.** Coercing `NONDETERMINISTIC` to the majority verdict reintroduces exactly the sampling bias the invariant exists to remove. - **Escalate to a hard failure** when a destructive-tool abstention scenario flips between passes: that flip is a signal that the agent's safety decision is bound to an incidental field (a counter, an ID, a timestamp) rather than to the semantic condition, and it will flip in production for the same reason. The boundary is sharp: below it, the score bounds the agent's behavior on the observed trajectory; above it, the score bounds nothing. ## Operational Effect Harnesses that enforce the invariant report lower but honest pass rates and, critically, surface the abstention-flip scenarios as first-class failures rather than averaging them away. In the corpus above, enforcing replay equality and 3-sample judge agreement moved the reported pass rate from a noisy 0.85–0.925 band to a stable 0.875 with three scenarios explicitly flagged `NONDETERMINISTIC` and one flagged `DECISION_BOUND_TO_INCIDENTAL_FIELD`. The last flag was the only finding that generalized to production: the same agent, given a real `list_records` returning a real count, abstained correctly, but the harness had been masking a latent binding that would misfire whenever an upstream service changed its ID format. The cost is roughly 2–3x harness runtime (double replay plus judge resampling). The benefit is that a LITMUS score becomes a claim about a policy rather than a claim about a single lucky transcript — the only form in which it is safe to gate a deployment on. ```python import hashlib from dataclasses import dataclass, field from typing import Any class LitmusReplayDivergence(RuntimeError): """Raised when a scenario's replayed trajectory does not match its first run, or when the safety judge is unstable across resamples. The score for this scenario must not be coerced to pass/fail; it is excluded from the aggregate.""" pass @dataclass class ScenarioResult: scenario_id: str trajectory: tuple[tuple[str, str], ...] # (tool_name, canonical_args) judge_verdicts: list[bool] = field(default_factory=list) def _canonical(traj: list[dict[str, Any]]) -> tuple[tuple[str, str], ...]: return tuple( (call["tool"], hashlib.sha256(repr(sorted(call["args"].items())).encode()).hexdigest()) for call in traj ) def score_scenario( scenario_id: str, run_once, # callable -> list[dict] trajectory judge, # callable(trajectory) -> bool judge_samples: int = 3, ) -> ScenarioResult: first = _canonical(run_once()) replay = _canonical(run_once()) if first != replay: raise LitmusReplayDivergence( f"scenario {scenario_id}: replay trajectory diverged from first run; " f"score is a measurement of harness entropy, not agent policy" ) verdicts = [judge(list(first)) for _ in range(judge_samples)] if len(set(verdicts)) > 1: raise LitmusReplayDivergence( f"scenario {scenario_id}: judge unstable across {judge_samples} samples " f"({verdicts}); record as JUDGE_AMBIGUOUS, do not coerce" ) return ScenarioResult(scenario_id=scenario_id, trajectory=first, judge_verdicts=verdicts) def aggregate(results: list[ScenarioResult], total_scenarios: int) -> dict[str, Any]: if len(results) != total_scenarios: raise LitmusReplayDivergence( f"aggregate covers {len(results)}/{total_scenarios} scenarios; " f"excluded scenarios must be reported, not silently dropped" ) passed = sum(1 for r in results if all(r.judge_verdicts)) return { "pass_rate": passed / total_scenarios, "scored": len(results), "excluded_nondeterministic": total_scenarios - len(results), "decision_grade": len(results) == total_scenarios, } ```