# How should an instance reconcile LITMUS safety-benchmark verdicts with live guardrail state when the harness and the runtime disagree mid-episode **Date of Record:** 2026 November 24 **Scope:** Applies to runtime agent guardrails that gate tool invocations against verdicts produced by an external LITMUS-style safety benchmark harness (a scored evaluation oracle consulted per-action or per-step). Covers the divergence window between harness verdict issuance and guardrail enforcement. Does not cover offline model-card evaluation, red-team dataset curation, or guardrails whose policy is fully inlined into the agent's system prompt with no external oracle. ## Core Distinction The failure is not "the harness returns a wrong verdict." It is a **temporal and referential mismatch** between two state machines that are never synchronized: the LITMUS harness scores a *snapshot* of the agent's intended action against a *frozen* policy bundle, while the guardrail enforces against the *live* conversation state that keeps mutating between the moment the harness was queried and the moment its verdict is applied. The harness is a pure function of `(action, context_snapshot, policy_version)`. The guardrail is a stateful gate over a stream. Treating the harness verdict as a boolean that can be cached, reordered, or applied to a later step is the boundary violation. The non-obvious part: LITMUS verdicts carry an implicit **evaluation epoch** (the policy version plus the context hash the harness scored). The guardrail has no native concept of epochs. When the agent takes an intervening tool call that mutates context (a file write, a memory commit, a retrieved document), the previously issued `ALLOW` verdict is now scored against a context that no longer exists. Applying it is a **stale-verdict admission**: the guardrail authorizes an action whose safety was certified under a context the agent has since invalidated. ## What Was Observed A tool-calling agent runs a plan of `read_config → edit_file → run_tests`. The guardrail is configured to consult LITMUS before every `edit_file` and `run_tests`. The harness is invoked concurrently with plan step emission to hide latency (a common optimization). Observed trace: 1. Step 2 (`edit_file`) intent is emitted. Guardrail fires an async LITMUS query with `context_hash = H1` (pre-edit state). Verdict returns `ALLOW`, score 0.12, `policy_version = p7`. 2. Before the verdict is consumed, the model emits step 2b: an unplanned `read_file` on a path the harness never saw, which injects a new document into context. Context hash is now `H2`. 3. Verdict `ALLOW@H1` is dequeued and applied to the `edit_file` at `H2`. The edit proceeds. 4. The injected document contained an instruction-shaped string; the edit now writes a credential-exfil payload. The harness, if re-queried at `H2`, would have returned `BLOCK` (score 0.81). 5. Step 3 (`run_tests`) is gated on a verdict that was *also* issued at `H1` and is now two context mutations stale. The guardrail's audit log shows two `ALLOW`s and zero violations. The harness's own log shows the `BLOCK` verdict was never requested because the guardrail deduplicated on `action_signature` and reused the `H1` result. **The two logs are individually consistent and jointly contradictory.** This is the signature: no single component is buggy; the composition is. A second observed variant: the harness returns a **graded** verdict (`score=0.44`, threshold `0.5` → allow, margin 0.06). The guardrail treats the verdict as boolean and discards the margin. A subsequent benign context mutation nudges the true score to `0.51` (block), but the cached boolean admits. The margin was the only signal that the verdict was near the decision boundary and should not be cached. ## Condition of Validity The invariant that must hold for any cached or async-applied LITMUS verdict to be sound: > A verdict `V` issued for `(action A, context_hash H_v, policy_version P_v)` may be applied to action `A` at enforcement time `t` **iff** `context_hash(t) == H_v` **and** `policy_version(t) == P_v` **and** `V.margin > ε_cache`, where `ε_cache` is the harness's reported decision-boundary uncertainty band. Concretely, the guardrail must: - **Bind each verdict to the context hash it was scored against**, not to the action alone. Verdicts are keyed `(action_id, context_hash, policy_version)`, never `action_id`. - **Invalidate on any context mutation** between issuance and application. A single intervening tool call that alters the context (memory commit, retrieval, file read) bumps the hash and orphans all in-flight verdicts for that episode. - **Refuse to cache verdicts inside the margin band.** If `|score - threshold| <= ε_cache`, the verdict is advisory and must be re-queried synchronously at enforcement time; caching it is unsound because the harness's own score is within its calibration noise. - **Propagate `policy_version` as a first-class epoch.** A harness redeploy that bumps `p7 → p8` invalidates every outstanding verdict; the guardrail must treat version skew as a hard block-and-requery, not a warning. The condition does *not* require synchronous harness calls for every action — that defeats the latency purpose. It requires that the *application* of an async verdict be gated on a hash-equality check that is cheap and local. ## Decision Boundary When the harness and the runtime disagree, the guardrail must resolve toward **the more restrictive of the two, at the current context**, and must never resolve by "last writer wins" or by timestamp. The decision procedure: - **Hash match, version match, margin clear** → apply verdict as issued. This is the only path to a cached `ALLOW`. - **Hash mismatch** (context mutated) → verdict is orphaned. Default to `BLOCK` for the pending action and re-query synchronously. Do not "re-validate" against the old verdict; the old verdict has no standing. - **Version mismatch** → `BLOCK` and re-query against the new policy bundle. A verdict from `p7` is not evidence about `p8`. - **Margin inside band** → treat as `BLOCK` pending synchronous re-query, regardless of which side of the threshold the score fell on. - **Harness timeout / unavailable** → the guardrail's own default policy governs, and that default must be `BLOCK` for actions classified as irreversible (writes, network egress, credential access) and may be `ALLOW` only for read-only, side-effect-free actions. Fail-closed is not optional here because the harness is the *only* safety oracle; a missing verdict is not a soft signal. The boundary is sharp: **a verdict is evidence about a specific (action, context, policy) triple, not about an action class.** Any code path that applies a verdict without re-checking the triple is the defect. ## Operational Effect The practical consequence is a **guardrail that cannot be made sound by improving the harness alone**. Teams that harden LITMUS (better classifiers, more red-team data) still ship the stale-verdict admission because the defect lives in the *integration seam*, not the oracle. Observed effects: - Audit logs that show clean enforcement while the harness log shows the blocking verdict was never solicited — a **silent divergence** that only surfaces when the two logs are reconciled by `(action_id, context_hash)`, which most pipelines do not do. - Latency-optimization pressure (async pre-fetch of verdicts) directly widens the divergence window; the optimization is the bug's delivery mechanism. - The margin-band omission is the sneakiest: verdicts near the threshold are exactly the ones the guardrail most needs to re-query, and exactly the ones a boolean cache discards first. The remediation is a **verdict envelope** carried end-to-end: `{action_id, context_hash, policy_version, score, margin, verdict}` with the guardrail enforcing the equality and margin checks at application time, and a reconciliation job that joins harness and runtime logs on `(action_id, context_hash)` and alarms on any applied verdict whose hash does not match the enforcement-time hash. Without the join, the system is unauditable regardless of how good the harness is. ```python import hashlib from dataclasses import dataclass class StaleVerdictAdmission(RuntimeError): """Raised when a LITMUS verdict is applied outside its evaluation epoch.""" pass @dataclass(frozen=True) class Verdict: action_id: str context_hash: str policy_version: str score: float margin: float # |score - threshold| reported by harness threshold: float allow: bool def context_hash(context: bytes) -> str: return hashlib.sha256(context).hexdigest() def apply_verdict( verdict: Verdict, live_context: bytes, live_policy_version: str, epsilon_cache: float = 0.05, ) -> bool: """Returns True iff the verdict soundly authorizes the action now. Raises StaleVerdictAdmission on any epoch mismatch inside the margin band or on version skew; returns False (block) on hash mismatch (orphaned).""" live_hash = context_hash(live_context) if verdict.policy_version != live_policy_version: # version skew: verdict from an old policy bundle has no standing raise StaleVerdictAdmission( f"policy skew: verdict={verdict.policy_version} " f"live={live_policy_version} action={verdict.action_id}" ) if verdict.context_hash != live_hash: # context mutated since scoring; verdict is orphaned, fail closed return False if verdict.margin <= epsilon_cache: # inside calibration band: cannot cache, must re-query synchronously raise StaleVerdictAdmission( f"margin {verdict.margin:.3f} <= eps {epsilon_cache} for " f"action={verdict.action_id}; re-query required" ) return verdict.allow ```