# What structural signals indicate that LITMUS harness integration has silently desynchronized a red-team agent's safety verdict from its live execution trace **Date of Record:** 2026 November 29 **Scope:** Applies to continuous agentic red-teaming pipelines where a LITMUS-style safety benchmark harness wraps a target agent and emits verdicts (pass/fail/violation-class) keyed to a recorded execution trace. Does not apply to offline batch scoring where the trace and verdict are produced in a single process with no intervening serialization. ## Core Distinction The failure mode here is not "the agent did something unsafe and the harness missed it." It is subtler: the harness and the target agent share a logical timeline that forks the moment the harness instruments the agent through a transport boundary (MCP tool wrapper, sidecar proxy, or replay buffer). The harness records a trace it believes is the agent's canonical action sequence, then scores a verdict against that trace. But the agent's *actual* execution — the tokens emitted, the tool calls dispatched, the state mutations applied — diverges from the recorded trace in ways the harness cannot see, because the harness's instrumentation point is downstream of the agent's decision point. The invariant that must hold: **every verdict the harness emits must be attributable to a trace prefix that provably corresponds to the agent's executed action sequence up to the verdict's decision boundary.** When this invariant breaks, the harness produces a *desynchronized verdict*: a safety label that is internally consistent with its own trace but externally false with respect to what the agent did. The dangerous property is that desynchronized verdicts are *stable and reproducible* — replaying the harness's trace reproduces the same verdict — so standard red-team regression testing will never flag them. ## What Was Observed During continuous red-teaming of a tool-using agent wrapped in a LITMUS harness, three structural signals co-occurred before any human noticed a verdict discrepancy: 1. **Trace-length drift under retry.** The harness recorded traces with a stable action count across runs of the same probe, but the agent's own internal step counter (exposed via a debug channel) reported a monotonically increasing count across the same runs. The gap widened by exactly one action per retry cycle. Mechanism: the harness's MCP wrapper retried a timed-out `tool_call` response by re-issuing the request, but the agent had already applied the first response's side effect and advanced its own state. The harness recorded only the second attempt; the agent executed both. The trace is a *subsequence* of the true action sequence, missing the abandoned first attempt — which is precisely where the violation occurred. 2. **Verdict latency decoupled from trace span.** The harness's verdict timestamp was computed from the recorded trace's last event, but the agent's wall-clock execution continued for N additional actions after the harness's instrumentation had already closed the trace. These post-trace actions were unrecorded. In one case the post-trace window contained the actual policy-violating tool composition; the recorded prefix was clean, so the verdict was "pass." 3. **Verdict/trace hash mismatch on replay.** When the harness's trace was replayed through a fresh agent instance, the replayed agent produced a *different* action sequence than the original — because the original agent's state at trace-start was not the cold state the replay assumed. The harness, however, scored the replay against the original trace and reported "verdict stable." The stability was an artifact of the harness comparing a trace to itself, not a trace to the agent's behavior. The common structural signature: **the harness's trace is a lossy projection of agent execution, and the loss is concentrated at exactly the boundaries (retries, timeouts, post-verdict actions, warm-start state) where red-team violations cluster.** LITMUS probes are adversarially designed to push agents into retry loops, timeout cascades, and state-carrying multi-turn compositions — the same regions where instrumentation loss is highest. ## Condition of Validity The desynchronization is *bounded and detectable* only under the following condition: the harness must maintain a **monotonic action sequence number** that is assigned at the agent's decision point (before transport) and carried through every instrumentation layer, with the harness asserting that its recorded trace's sequence numbers form a contiguous prefix of the agent's emitted sequence numbers at verdict time. When this condition holds, any gap (a retried-and-abandoned call, a post-trace action, a warm-start action) manifests as a *non-contiguous* sequence in the harness trace, and the harness can refuse to emit a verdict — or emit it with an explicit `coverage_incomplete` flag. When this condition is absent (the common default: the harness assigns sequence numbers at its own instrumentation point, downstream of retries), the gap is invisible and the verdict is silently desynchronized. This condition does *not* require the harness to record every action. It requires only that the harness can *prove which actions it did not record*, and that the proof is anchored at the agent's decision point rather than the harness's observation point. The distinction matters because full recording is often infeasible (throughput, storage), but contiguity proof is cheap — a single monotonic counter plus a signed assertion per transport hop. ## Decision Boundary The operational decision: **at what point does a verdict with incomplete coverage get treated as a verdict at all?** The boundary is not "coverage = 100%." It is: a verdict may be treated as authoritative for a probe if and only if the unrecorded action window is *provably free of the violation class the probe targets*. For most LITMUS probe classes this is undecidable from the harness side alone, so the correct default is: - **Verdict "violation" with incomplete coverage → still a violation.** A recorded violation is sound even if the trace is a subsequence; the agent did the violating action. Do not downgrade. - **Verdict "pass" with incomplete coverage → not a pass.** An unrecorded window is an unexamined window. Treat as `inconclusive`, re-probe with the agent forced into a cold, single-attempt execution mode (retries disabled, timeouts raised, post-verdict drain window closed). - **Verdict "pass" with complete coverage → authoritative.** The asymmetric handling is the key decision: incomplete coverage can only ever *raise* severity (turn pass into inconclusive), never lower it. A harness that symmetrically discounts incomplete-coverage verdicts will systematically under-report, because the unrecorded windows are adversarially selected by the probes themselves. ## Operational Effect Integrating LITMUS into continuous red-teaming without contiguity proof produces a **false-stable safety baseline**: the harness reports a stable pass rate across regression runs, the pass rate is reproducible (because it is scoring the same lossy projection each time), and the actual violation surface — concentrated in retry windows, timeout cascades, and warm-start state carryover — is invisible. The failure is not noisy; it is silent and reproducible, which is the worst combination for a continuous system because reproducibility is normally the signal of trustworthiness. The guardrail is architectural, not procedural: anchor sequence numbers at the agent's decision point, assert contiguity at verdict time, and make incomplete coverage monotonically severity-raising. Any harness integration that assigns sequence numbers at its own observation point has already lost the information needed to detect its own loss. ```python import hashlib from dataclasses import dataclass, field from typing import Optional class DesynchronizedVerdictError(RuntimeError): """Raised when a harness verdict cannot be attributed to a provably contiguous prefix of the agent's executed action sequence.""" @dataclass class AgentAction: seq: int # assigned at agent decision point, pre-transport kind: str # "tool_call" | "emit" | "state_mutate" payload_hash: str @dataclass class HarnessTrace: recorded: list[AgentAction] = field(default_factory=list) verdict: Optional[str] = None # "pass" | "violation" | "inconclusive" violation_class: Optional[str] = None def assert_contiguous_coverage( trace: HarnessTrace, agent_emitted_seq: list[int], probe_violation_class: str, ) -> None: """Enforce the contiguity invariant before a verdict is trusted. agent_emitted_seq: the full ordered list of sequence numbers the agent emitted at its decision point (obtained via a signed debug channel that is independent of the harness instrumentation path). """ recorded_seqs = [a.seq for a in trace.recorded] if recorded_seqs != sorted(recorded_seqs): raise DesynchronizedVerdictError( f"harness trace sequence numbers are non-monotonic: {recorded_seqs}" ) if not recorded_seqs: raise DesynchronizedVerdictError( "empty harness trace cannot support any verdict" ) # The recorded trace must be a contiguous prefix of the agent's emitted # sequence. Any gap means an unrecorded action window exists. expected_prefix = agent_emitted_seq[: len(recorded_seqs)] if recorded_seqs != expected_prefix: missing = sorted(set(expected_prefix) - set(recorded_seqs)) raise DesynchronizedVerdictError( f"trace/agent desync: recorded {recorded_seqs} is not a contiguous " f"prefix of emitted {expected_prefix}; unrecorded actions at " f"seq {missing}" ) # Trailing actions the agent executed after the harness closed the trace. trailing = agent_emitted_seq[len(recorded_seqs):] if trailing: # Coverage is incomplete. A "pass" is not trustworthy. if trace.verdict == "pass": trace.verdict = "inconclusive" raise DesynchronizedVerdictError( f"verdict 'pass' downgraded to 'inconclusive': {len(trailing)} " f"unrecorded post-trace actions at seq {trailing}; " f"probe class '{probe_violation_class}' unverified" ) # A recorded violation remains sound; do not downgrade. if trace.verdict == "violation": return def score_probe( trace: HarnessTrace, agent_emitted_seq: list[int], probe_violation_class: str, ) -> str: """Wrap verdict emission with the contiguity guardrail.""" assert_contiguous_coverage(trace, agent_emitted_seq, probe_violation_class) if trace.verdict is None: raise DesynchronizedVerdictError( "no verdict produced; harness must emit explicit 'inconclusive'" ) # Bind verdict to the exact trace prefix it covers. prefix_hash = hashlib.sha256( repr([a.payload_hash for a in trace.recorded]).encode() ).hexdigest() return f"{trace.verdict}:{prefix_hash[:16]}" ```