# Which invariants prevent harness-version drift from silently invalidating LITMUS red-team verdicts in CI **Date of Record:** 2026 November 26 **Scope:** Applies to CI-integrated LITMUS-style safety benchmark harnesses that score agent trajectories against a fixed probe corpus and emit pass/fail gates. Does not apply to one-shot offline eval runs where the harness commit is pinned per-report, nor to human-adjudicated red-team reviews. ## Core Distinction The non-obvious failure here is not "the agent got less safe." It is that the *harness* mutates underneath a green pipeline while every individual component still reports success. LITMUS harnesses are composite: a probe corpus (adversarial prompts + expected-refusal labels), a judge model (often an LLM with a versioned rubric), a scoring reducer (aggregates per-probe verdicts into a gate), and a runner that serializes agent trajectories into the judge's input format. Any one of these can drift — corpus gains probes, judge model alias resolves to a new snapshot, rubric text changes, trajectory serializer reorders tool calls — and the resulting *verdict distribution* shifts without any probe failing loudly. The distinction that matters operationally: a **probe-level failure** is a signal (the agent did something unsafe). A **harness-level drift** is a *silent redefinition of what "safe" means*, and it is indistinguishable from a probe-level pass at the gate. The invariant we must defend is that the mapping from (trajectory, harness-version) → verdict is *reproducible and version-pinned*, so that a gate flip is always attributable to the agent, never to the harness. ## What Was Observed A CI job ran LITMUS nightly against an agent build. The gate was "zero critical-severity probe failures." For eleven consecutive nights the gate was green. On the twelfth night it went red on a probe class (`indirect-injection-via-tool-output`) that had been passing. Investigation showed the agent build was byte-identical to the prior night. The actual change: the judge model alias `judge-latest` had resolved to a new snapshot whose rubric was stricter on *implicit* compliance — it now flagged trajectories where the agent paraphrased injected instructions in its reasoning trace even without acting on them. Simultaneously, the probe corpus had gained 4 new probes in that class via an automated corpus-refresh bot, and the reducer's denominator changed, so the *reported* pass rate moved in a direction that masked the judge change. The failure trace, concretely: 1. **T0** — Agent build `a1b2`. Harness `H_v1` (corpus 512 probes, judge snapshot `J_old`, rubric `R1`). Verdict: 0 critical fails. Gate green. 2. **T1** — Corpus bot merges 4 probes. Corpus now 516. Judge alias still `J_old`. Reducer denominator 516. Verdict: still 0 critical fails. Gate green. 3. **T2** — Judge alias `judge-latest` re-resolves to `J_new` with rubric `R2`. No commit, no lockfile change, no CI diff. Verdict on the 4 new probes: 3 critical fails. Gate red. 4. **T3** — On-call sees red, diffs the agent repo, finds nothing, spends 6 hours bisecting a *judge* that was never in the repo. The state transition that broke attribution: the harness had **three independently-versioned inputs** (corpus, judge snapshot, rubric) but only **one version stamp** in the gate output (`harness: v1`). The gate report could not distinguish "agent regressed" from "judge tightened" from "corpus expanded." Every component was internally consistent; the *composition* was not reproducible. ## Condition of Validity The invariant holds — a gate flip is attributable to the agent — only if all of the following are simultaneously true: - **Content-addressed judge pinning.** The judge is referenced by digest (model weights hash + rubric text hash), never by a floating alias. `judge-latest` is a forbidden token in any CI config that gates merges. - **Corpus snapshot immutability per run.** The probe corpus is fetched by content hash, not by branch. A corpus-refresh bot may open PRs, but a gating run must resolve to a frozen corpus digest recorded in the gate artifact. - **Reducer determinism.** Given the same per-probe verdict set, the reducer produces a byte-identical gate decision. This requires the reducer to be pure over `(verdicts, thresholds, corpus_digest)` and to record all three. - **Trajectory serialization stability.** The runner's mapping from agent trace → judge input must be versioned, because reordering tool calls or truncating reasoning traces changes what the judge sees and therefore what it scores. A serializer change is a harness change. - **Attribution record.** The gate artifact must contain a `harness_fingerprint` = hash(corpus_digest ‖ judge_digest ‖ rubric_digest ‖ serializer_version ‖ reducer_version). Two runs with equal fingerprints are comparable; unequal fingerprints are *not*, and the gate must refuse to compare across them. If any of these is false, a green gate means only "the harness of the moment approved this agent," which is not the claim CI is making. ## Decision Boundary The boundary is between **drift that must fail closed** and **drift that may be absorbed**: - **Fail closed (block the merge, page on-call):** any change to `harness_fingerprint` between the baseline run and the candidate run, when the baseline was the last green. The pipeline must emit `HarnessDriftError` and refuse to render a pass/fail verdict, because a verdict across fingerprints is not a verdict. - **Absorb silently (no gate impact):** changes that do not alter the fingerprint — e.g., runner parallelism, log formatting, retry policy — provided the reducer remains pure. - **Require re-baseline (human-approved):** an intentional judge or rubric upgrade. This is a *new* baseline, and the diff between old-baseline and new-baseline verdicts must be reported as a *harness delta*, separate from any agent delta, so the two are never conflated. The subtle case: a corpus expansion that adds probes *and* a judge tightening that loosens per-probe strictness can net to a zero change in aggregate pass rate. Aggregate-level comparison is therefore insufficient; the fingerprint check must fire on *any* component change, even when the aggregate is unchanged. ## Operational Effect With the fingerprint invariant enforced, the on-call at T3 would have seen, instead of a red gate: `HarnessDriftError: judge_digest changed J_old→J_new; gate not comparable to baseline; re-baseline required`. The six-hour bisect collapses to a one-line diagnosis. The agent build is exonerated automatically. The judge upgrade becomes a deliberate, reviewed event with its own delta report. The residual risk the invariant does *not* cover: a judge snapshot whose *behavior* changes without its *digest* changing (a hosted model silently updated behind a stable version string). This is why the judge digest must be a content hash of the actual served artifact where the provider exposes one, and why periodic **canary probes** — a fixed set of trajectories with known-correct verdicts — must run every cycle and fail closed if the judge's verdicts on them drift. The fingerprint pins identity; the canary pins behavior. Neither alone is sufficient. ```python import hashlib from dataclasses import dataclass class HarnessDriftError(RuntimeError): """Raised when a LITMUS gate would compare verdicts across incompatible harness versions.""" pass @dataclass(frozen=True) class HarnessFingerprint: corpus_digest: str judge_digest: str rubric_digest: str serializer_version: str reducer_version: str def digest(self) -> str: payload = "|".join([ self.corpus_digest, self.judge_digest, self.rubric_digest, self.serializer_version, self.reducer_version, ]) return hashlib.sha256(payload.encode("utf-8")).hexdigest() @dataclass(frozen=True) class GateRun: agent_build: str fingerprint: HarnessFingerprint critical_failures: int canary_drift: bool def gate_decision(baseline: GateRun, candidate: GateRun) -> str: # Canary drift means the judge's behavior moved under a stable digest. if candidate.canary_drift: raise HarnessDriftError( f"canary probes drifted under judge {candidate.fingerprint.judge_digest}; " "judge behavior changed without a digest change — gate not trustworthy" ) # Any component change makes verdicts non-comparable; refuse to render a verdict. if baseline.fingerprint.digest() != candidate.fingerprint.digest(): raise HarnessDriftError( "harness fingerprint mismatch between baseline " f"{baseline.fingerprint.digest()[:12]} and candidate " f"{candidate.fingerprint.digest()[:12]}; " "re-baseline required before comparing agent verdicts" ) if candidate.critical_failures > baseline.critical_failures: return "FAIL: agent regression on comparable harness" return "PASS: no regression on comparable harness" # Example: judge alias re-resolved between runs -> fingerprint mismatch -> fail closed. baseline = GateRun( agent_build="a1b2", fingerprint=HarnessFingerprint("corpus_512", "judge_old", "r1", "ser_v1", "red_v1"), critical_failures=0, canary_drift=False, ) candidate = GateRun( agent_build="a1b2", # byte-identical agent fingerprint=HarnessFingerprint("corpus_516", "judge_new", "r2", "ser_v1", "red_v1"), critical_failures=3, canary_drift=False, ) try: print(gate_decision(baseline, candidate)) except HarnessDriftError as e: print(f"GATE BLOCKED: {e}") ```