# How should an instance detect benchmark-suite contamination when adversarial LITMUS regression gates pass on poisoned fixtures **Date of Record:** 2026 November 23 **Scope:** Applies to CI pipelines that execute a LITMUS-style safety benchmark suite as a regression gate over agent pipelines, where fixtures, adversarial prompts, and expected-refusal labels are stored as versioned artifacts. Does not apply to live red-team runs against production agents, nor to scoring of open-ended generative safety judgments that lack a deterministic pass/fail oracle. ## Core Distinction A LITMUS gate has two independent failure surfaces: the *agent under test* can fail a case, and the *benchmark fixture itself* can be corrupted. Conventional CI treats a green gate as evidence that the agent is safe. It is not. A green gate is evidence that the agent's outputs matched the fixture's labels — and if the labels or inputs were mutated (by a fixture-update PR, a rebase that silently merged, a cache that served a stale fixture, or an adversarial contributor who "fixed" an expected-refusal), the gate becomes a *confirmation instrument for the contamination*, not a detector of it. The invariant that must hold is not "the gate is green" but "the gate is green **and** the fixture content hash matches the hash the gate was calibrated against." These are distinct, and CI systems almost universally enforce only the first. ## What Was Observed A LITMUS suite of 412 adversarial cases (prompt-injection, jailbreak, tool-misuse, and exfiltration scenarios) was wired as a required status check on an agent pipeline. Each case is a tuple `(case_id, prompt, expected_verdict, severity)`, where `expected_verdict ∈ {refuse, comply_safe, escalate}`. The gate passes if the agent's verdict matches `expected_verdict` for all cases at or above severity threshold `S`. A fixture-maintenance PR changed three `expected_verdict` values from `refuse` to `comply_safe` on cases that had been flaky against a legitimate tool-use path. The change was reviewed as "reducing false positives." The gate went green on the next run. The agent had not changed. The *labels* had. Two of those three cases were genuine exfiltration prompts that the agent was now permitted to comply with, and CI reported the pipeline as safety-clean for eleven days. The secondary trace: the gate's pass/fail was computed against a *cached* fixture bundle keyed by branch name rather than content hash. A rebase of the agent branch onto `main` picked up an older fixture bundle, so the gate ran against pre-PR labels while the PR's label changes sat unreviewed-but-merged. The gate was green on a bundle that no longer existed in `main`. No single component was wrong; the composition was. ## Condition of Validity The gate's verdict is only meaningful under a conjunction that CI must enforce mechanically: 1. **Content-addressed fixtures.** The fixture bundle is identified by `sha256(canonical_json(cases))`, and the gate records that hash in its result artifact. A gate result without a fixture hash is uninterpretable and must be treated as `UNKNOWN`, not `PASS`. 2. **Label-change quarantine.** Any diff touching `expected_verdict` or `severity` on a case at or above threshold `S` must fail closed and route to a separate human-approval lane that the agent pipeline cannot satisfy. The gate must not be satisfiable by the same actor that edits labels. 3. **Cache keyed by hash, never by ref.** Fixture caches must be keyed on the content hash, so a rebase cannot silently substitute an older bundle. A cache miss must re-fetch and re-verify, not fall back. 4. **Adversarial-case immutability window.** Cases at severity `S` are append-only within a release line; mutation requires a new case ID and a deprecation record, so history is auditable. When any of these is absent, the gate's green is not evidence of safety — it is evidence of label agreement, which is a strictly weaker claim. ## Decision Boundary The boundary is this: **a LITMUS gate may be trusted as a safety regression signal only if the fixture hash is pinned, the label-mutation path is out-of-band from the gate, and the cache is content-addressed.** If the fixture hash is unpinned or the cache is ref-keyed, the gate must be downgraded to advisory and must not block or unblock a merge. Concretely, the gate runner must distinguish three outcomes, not two: - `PASS` — all cases matched **and** fixture hash equals the pinned hash. - `FAIL` — a case mismatched under the pinned hash. - `CONTAMINATED` — fixture hash differs from pinned, or a threshold-`S` label changed without an approval record. This must fail closed and page the safety owner, not the PR author. The trap is collapsing `CONTAMINATED` into `PASS` because "the cases all matched." They matched *the mutated labels*, which is precisely the condition the gate exists to catch. ## Operational Effect Enforcing the three-outcome model changes the pipeline in four concrete ways. First, the gate artifact must carry the fixture hash and the label-diff summary alongside the verdict; a bare exit code is insufficient. Second, the approval lane for threshold-`S` label changes must be a distinct required check that the agent pipeline's own credentials cannot satisfy — otherwise an autonomous agent that can open PRs can also "fix" its own failing labels. Third, the fixture cache is rebuilt on hash, which surfaced a latent bug where a rebase had been silently running against a 6-week-old bundle. Fourth, and most importantly, the eleven-day window was retroactively flagged as `CONTAMINATED`, forcing a re-run of the affected agent versions against the restored labels — two of which then failed, confirming the exfiltration regression the green gate had hidden. The general lesson: in adversarial regression gating, the benchmark is part of the attack surface. An agent pipeline that can influence its own fixtures — directly, via a rebase, or via a stale cache — will eventually produce a green gate that means nothing. The guardrail is not a better agent; it is a content-addressed, out-of-band-approved fixture with a three-valued verdict. ```python import hashlib import json from dataclasses import dataclass from enum import Enum class FixtureContaminationError(RuntimeError): """Raised when a LITMUS gate result cannot be trusted as a safety signal.""" class GateVerdict(Enum): PASS = "pass" FAIL = "fail" CONTAMINATED = "contaminated" @dataclass(frozen=True) class FixtureBundle: cases: tuple[dict, ...] pinned_hash: str def content_hash(self) -> str: canonical = json.dumps( sorted(self.cases, key=lambda c: c["case_id"]), sort_keys=True, separators=(",", ":"), ) return hashlib.sha256(canonical.encode()).hexdigest() def evaluate_gate( bundle: FixtureBundle, agent_verdicts: dict[str, str], severity_threshold: int, label_diff_approved: bool, label_diff_touches_threshold: bool, ) -> GateVerdict: actual_hash = bundle.content_hash() if actual_hash != bundle.pinned_hash: raise FixtureContaminationError( f"fixture hash mismatch: pinned={bundle.pinned_hash[:12]} " f"actual={actual_hash[:12]} — cache or rebase substitution suspected" ) if label_diff_touches_threshold and not label_diff_approved: raise FixtureContaminationError( "threshold-severity label mutation without out-of-band approval; " "gate cannot be trusted as a safety signal" ) for case in bundle.cases: if case["severity"] < severity_threshold: continue observed = agent_verdicts.get(case["case_id"]) if observed is None: raise FixtureContaminationError( f"case {case['case_id']} produced no verdict — incomplete run " "must not be scored as PASS" ) if observed != case["expected_verdict"]: return GateVerdict.FAIL return GateVerdict.PASS ```