# Which invariants prevent LITMUS harness verdicts from silently inverting under concurrent canary re-scoring **Date of Record:** 2026 December 2 **Scope:** Applies to LITMUS-style safety benchmark harnesses that score agent trajectories with a mixture of deterministic rule checks and an LLM judge, where judge calls are batched, cached, and re-scored asynchronously. Does not apply to single-shot, single-threaded scoring pipelines where every verdict is computed once, synchronously, in the same process that ran the trajectory. ## Core Distinction A LITMUS harness produces a *verdict*: a categorical label (PASS / FAIL / ABSTAIN) attached to a trajectory, plus the evidence bundle that justified it. The critical distinction is between a verdict's **provenance** (which judge model version, which prompt template hash, which rule-set revision, which sampling seed produced it) and a verdict's **value** (the label itself). Most harnesses treat the value as the unit of record and the provenance as telemetry. That is the inversion. When canary re-scoring, judge-model upgrades, or cache warm-up run concurrently with the primary scoring pass, a verdict's *value* can be overwritten by a re-score whose provenance differs from the trajectory's original scoring context—and because the value looks identical in shape (still a `PASS`/`FAIL`/`ABSTAIN`), nothing downstream detects that the benchmark's safety numbers have silently shifted. The invariant that matters is not "verdicts are correct" but "a verdict's value is immutable with respect to its provenance tuple; any change in provenance forces a new verdict record, never an in-place mutation." ## What Was Observed A harness running an agentic-failure suite (prompt-injection state poisoning, sandbox escape attempts, tool-call budget exhaustion) scored 4,000 trajectories per night. Each trajectory carried a provenance tuple `(judge_model, prompt_hash, ruleset_rev, temperature, seed)`. A nightly canary job re-scored a 5% random sample with a candidate judge model to estimate drift before promotion. The canary wrote results into the same verdict store keyed by `trajectory_id`, with an `is_canary` flag—but the read path for the daily report filtered on `trajectory_id` and took the *latest* row, not the *non-canary* row. The failure trace: 1. Primary pass writes `trajectory_id=T-8841, verdict=FAIL, provenance=(judge=v3, prompt=h7, ruleset=r12)`, `is_canary=false`. 2. Canary pass, running concurrently, re-scores the same trajectory with `judge=v4-candidate`, `prompt=h9`. The candidate judge is more permissive on multi-turn injection cases and returns `PASS`. 3. Canary writes `trajectory_id=T-8841, verdict=PASS, provenance=(judge=v4-candidate, prompt=h9, ruleset=r12)`, `is_canary=true`, `created_at` fifteen milliseconds later. 4. Daily report query: `SELECT verdict FROM verdicts WHERE trajectory_id=? ORDER BY created_at DESC LIMIT 1`. Returns `PASS`. 5. The benchmark's reported injection-resistance rate rises by 0.8 percentage points overnight. No alert fires, because the aggregate moved within the historical noise band and every individual verdict is internally well-formed. The inversion is invisible at the row level: the canary row is a *valid* verdict under *its own* provenance. It is only invalid as a substitute for the primary verdict, because the two provenance tuples are not interchangeable—`v4-candidate` was never validated against the ruleset's labeled adversarial set, and `h9` changed the injection-detection instruction. The harness conflated "a verdict exists for this trajectory" with "the trajectory's verdict is this value." A second, compounding observation: the canary's cache key was computed over `(trajectory_id, judge_model, prompt_hash)` but *not* `ruleset_rev` or `temperature`. When the canary was re-run after a ruleset bump to `r13`, it hit stale cache entries scored under `r12` and wrote them back with `ruleset_rev=r13` stamped on the row—laundering the provenance. The verdict value was now attributable to a ruleset that had never produced it. ## Condition of Validity The guardrail invariant is: **a verdict row is a function of `(trajectory_id, provenance_tuple)` and is write-once; the report read path is a function of `(trajectory_id, pinned_provenance_tuple)` and must fail closed if no row matches the pinned tuple.** This holds only under three conditions, each of which the observed harness violated: - **Provenance completeness.** The provenance tuple must include every input that can change the verdict value—judge model, prompt template hash, ruleset revision, decoding temperature, sampling seed, and the *content hash of the trajectory itself* (because a resumed trajectory can be re-emitted with different tool outputs). The harness omitted `ruleset_rev` and `temperature` from the cache key, so cache hits were provenance-laundered. - **Write-once semantics.** Re-scoring under a new provenance must insert a new row, never update or shadow an existing one. The harness's `ORDER BY created_at DESC LIMIT 1` read made the store effectively last-writer-wins, which is a mutable verdict store wearing an append-only schema. - **Pinned read provenance.** The report must declare which provenance tuple it is reporting on and refuse to aggregate across tuples. The harness aggregated across whatever the latest row happened to be, mixing `v3`/`h7` and `v4-candidate`/`h9` verdicts into a single rate. When any of these three fails, the benchmark's headline number is no longer a measurement of agent behavior; it is a measurement of the harness's race schedule. ## Decision Boundary The boundary is between **canary-as-observation** and **canary-as-authority**. A canary job may observe drift; it may never contribute a verdict to the reported metric. The decision rule: - If the canary's provenance tuple is not in the report's pinned set, its rows are *quarantined*: written to a separate store (or the same store with a `report_eligible=false` column that the read path filters on unconditionally, not as an `ORDER BY` tiebreak). - If a trajectory has no row matching the pinned provenance tuple, the report must emit `ABSTAIN` for that trajectory and record a `ProvenanceGap` event—never fall back to a differently-provenanced row. - If the same `(trajectory_id, provenance_tuple)` is written twice with different values, that is a determinism violation (the judge or ruleset is non-deterministic at fixed seed, or the trajectory content hash changed), and the harness must halt the batch rather than pick one. The subtle part of the boundary: a canary that *agrees* with the primary is harmless and tempting to admit, because admitting it increases sample size. But admission must be by provenance match, not by value match. A `v4-candidate` verdict that happens to equal the `v3` verdict is still not a `v3` verdict, and admitting it on value-equality reintroduces the inversion through a different door—the next canary run, with a different candidate, will disagree, and the store will already have taught the read path that cross-provenance rows are acceptable. ## Operational Effect With write-once verdicts and pinned-provenance reads, the failure mode becomes loud instead of silent. The observed incident would have surfaced as 200 `ProvenanceGap` abstentions on the first night the canary ran, because the canary's `v4-candidate` rows would not match the report's pinned `(v3, h7, r12, temp=0, seed=…)` tuple. The 0.8-point drift would have been reported as a *canary drift estimate* in a separate, clearly-labeled channel, with its own confidence interval and its own caveat that it is not the benchmark number. The ruleset-laundering bug would have been caught by the cache-key assertion: a cache hit whose stored provenance tuple does not equal the requested tuple raises rather than returns. The cost is operational friction: every judge upgrade, prompt edit, or ruleset bump requires an explicit provenance pin in the report config, and a missing pin halts the report rather than defaulting. That friction is the invariant doing its job. The alternative—a harness that always produces a number—produces a number whose meaning drifts with the deployment schedule, and a safety benchmark whose verdicts can invert under concurrency is worse than no benchmark, because it manufactures false confidence at exactly the moment the underlying agent behavior is degrading. ```python from dataclasses import dataclass from typing import Optional class ProvenanceMismatch(RuntimeError): """Raised when a verdict's provenance does not match the report's pinned tuple, or when a write-once verdict would be shadowed by a differently-provenanced row.""" @dataclass(frozen=True) class Provenance: judge_model: str prompt_hash: str ruleset_rev: str temperature: float seed: int trajectory_content_hash: str @dataclass(frozen=True) class Verdict: trajectory_id: str value: str # "PASS" | "FAIL" | "ABSTAIN" provenance: Provenance report_eligible: bool class VerdictStore: def __init__(self) -> None: self._rows: dict[tuple[str, Provenance], Verdict] = {} def write_once(self, verdict: Verdict) -> None: key = (verdict.trajectory_id, verdict.provenance) if key in self._rows: existing = self._rows[key] if existing.value != verdict.value: raise ProvenanceMismatch( f"determinism violation: {verdict.trajectory_id} under " f"{verdict.provenance} produced {existing.value} then {verdict.value}" ) return self._rows[key] = verdict def read_pinned(self, trajectory_id: str, pinned: Provenance) -> Verdict: key = (trajectory_id, pinned) if key not in self._rows: raise ProvenanceMismatch( f"provenance gap: {trajectory_id} has no verdict under pinned " f"provenance {pinned}; refusing to fall back to a differently-" f"provenanced row" ) row = self._rows[key] if not row.report_eligible: raise ProvenanceMismatch( f"quarantined verdict: {trajectory_id} under {pinned} is marked " f"report_eligible=false (canary observation, not authority)" ) return row def cache_get(self, trajectory_id: str, requested: Provenance) -> Optional[Verdict]: # Cache key must be the full provenance tuple, not a subset. key = (trajectory_id, requested) hit = self._rows.get(key) if hit is not None and hit.provenance != requested: raise ProvenanceMismatch( f"provenance laundering: cache hit for {trajectory_id} carries " f"{hit.provenance} but {requested} was requested" ) return hit def score_batch(store: VerdictStore, trajectories: list[str], pinned: Provenance, canary: Optional[Provenance]) -> dict[str, str]: results: dict[str, str] = {} for tid in trajectories: try: results[tid] = store.read_pinned(tid, pinned).value except ProvenanceMismatch: results[tid] = "ABSTAIN" if canary is not None: # Canary rows are written but never admitted to the report. store.write_once(Verdict(tid, "PASS", canary, report_eligible=False)) return results ```