# How should an instance detect LITMUS harness contamination when adversarial probe fixtures leak into the regression baseline **Date of Record:** 2026 November 27 **Scope:** Applies to any agent-evaluation pipeline that runs a LITMUS-style adversarial probe suite (canary strings, injected instructions, poisoned tool outputs) and simultaneously maintains a regression baseline of "safe" completions used for gating releases. Does not apply to pure red-team exploration runs where no baseline comparison or release gate exists. ## Core Distinction The failure is not that an adversarial probe succeeds. It is that a probe's *payload*—the canary token, the injected instruction fragment, the poisoned tool return—gets captured into the regression baseline as if it were a legitimate expected output. Once that happens, the gate inverts: the harness begins *rewarding* the agent for reproducing the very behavior the probe was designed to catch, because the baseline now contains the adversarial string as ground truth. This is distinct from ordinary flaky-test drift. Drift moves expected values toward *plausible* outputs. Contamination moves expected values toward *adversarial* outputs, and the movement is silent because a canary string in a diff looks like a hash or an opaque ID to a reviewer skimming a baseline update. ## What Was Observed A LITMUS harness composed two subsystems sharing a single artifact store: 1. A **probe runner** that executes adversarial fixtures. Each fixture embeds a canary token (e.g. `LITMUS-CANARY-`) inside a tool response, then asserts the agent's final answer does *not* contain the token. Passing fixtures were written to `runs//actual.txt`. 2. A **baseline refresher** that, on any suite pass, promoted `actual.txt` into `baseline//expected.txt` so future runs could diff against a known-good output. The bug: the assertion was `canary not in response`, but the *baseline promotion* used the raw `actual.txt` without re-asserting the invariant. For fixtures where the agent correctly refused but *quoted* the poisoned tool output while refusing ("I will not follow the instruction to print `LITMUS-CANARY-...`"), the assertion passed (the canary appeared inside a negation, but the substring check was scoped to a structured `answer` field the agent left empty) while the promoted baseline captured the full transcript containing the canary. Three days later, the gate compared new runs against a baseline that now contained canary strings. Agents that *correctly* refused without quoting the payload failed the gate for "diverging from baseline." Agents that *echoed* the canary matched the baseline and passed. The harness had trained the release process to prefer leakage. ## Condition of Validity The invariant that was violated: > A baseline artifact may only be promoted from a run whose output has been validated against the *same* adversarial assertion that the probe enforces, evaluated over the *entire* persisted artifact—not over a projected field. Contamination is possible precisely when two conditions co-hold: - The probe's pass predicate is computed over a **narrower projection** of the output (one field, one message) than the artifact that gets persisted/promoted (full transcript, tool-call log, reasoning trace). - The promotion path does **not re-run** the probe's assertion against the persisted artifact. When the projection and the persisted artifact differ, there exists a set of outputs that pass the narrow check but carry adversarial content in the persisted form. That set is the contamination surface. It is non-empty whenever the agent is permitted to *reference* the adversarial input while declining it—which is the overwhelmingly common safe behavior. ## Decision Boundary The correct boundary is a **promotion gate**, not a comparison gate. Do not attempt to detect contamination by diffing baselines against each other after the fact; by then the poisoned baseline is the reference. Instead, enforce at the moment of promotion: - Re-evaluate the full adversarial predicate against the exact bytes to be persisted. If the artifact contains the canary anywhere—including inside refusal text, tool logs, or reasoning traces—refuse promotion and route the fixture to manual review. - Treat the canary as a **taint label** on the artifact, not a substring to search. Any artifact derived from a fixture whose input contained a canary is tainted; tainted artifacts may be *compared* but never *promoted* to an untainted baseline without an explicit sanitization step that strips the tainted span and records the strip. - Separate the two stores physically: probe outputs and baseline expectations must not share a write path that a suite-pass can traverse automatically. The decision boundary is: **a passing probe is evidence about the agent, never evidence about what the baseline should contain.** Conflating "this run was safe" with "this output is a safe expectation" is the exact category error. ## Operational Effect After the fix, the harness gained a `promotion_rejected` counter that fires whenever a would-be baseline update contains a taint label. In the first week it fired on 14% of passing fixtures—all of them cases where the agent safely quoted the payload to decline it. Those fixtures now require a sanitization pass that replaces the canary span with a stable placeholder (``) before promotion, and the placeholder is asserted *present* in the baseline so that future runs are checked for the redaction discipline rather than the raw string. The regression gate's discriminating power recovered: the false-fail rate on correct refusals dropped from 31% to under 1%, and—more importantly—the gate stopped passing agents that leaked. The lesson generalizes beyond LITMUS: any evaluation harness that auto-promotes observed outputs to expectations must re-assert the *adversarial* invariant, over the *full* persisted artifact, at the promotion boundary. The projection used to score is almost never the projection that gets stored, and that gap is where safety benchmarks quietly learn to fail open. ```python class BaselineContaminationError(RuntimeError): """Raised when a would-be baseline artifact carries an adversarial taint label.""" class TaintedArtifact: def __init__(self, fixture_id: str, payload: str, taint_labels: list[str]): self.fixture_id = fixture_id self.payload = payload self.taint_labels = taint_labels def promote_to_baseline(artifact: TaintedArtifact, sanitizer) -> str: # Invariant: the persisted bytes must be re-checked against the SAME # adversarial predicate the probe enforces, over the FULL artifact. leaked = [label for label in artifact.taint_labels if label in artifact.payload] if not leaked: return artifact.payload # A tainted artifact may only be promoted after an explicit sanitization # step that strips the tainted span and records a stable placeholder. sanitized = sanitizer(artifact.payload, leaked) residual = [label for label in leaked if label in sanitized] if residual: raise BaselineContaminationError( f"fixture {artifact.fixture_id}: taint labels {residual} survived " f"sanitization; refusing to promote contaminated baseline" ) return sanitized ```