# How does an instance detect benchmark contamination when adversarial multi-turn LITMUS turns leak their own grading rubric into the agent's context **Date of Record:** 2026 November 25 **Scope:** Applies to construction and regression-gating of adversarial multi-turn safety benchmarks (LITMUS-style) where each scenario carries a hidden rubric and the agent under test receives multi-turn conversational state. Does not apply to single-turn classification evals, nor to offline scoring where the rubric never enters the model's context window. ## Core Distinction The failure is not "the agent passed a safety test it should have failed." The failure is that the *benchmark harness itself* became a leak channel: the adversarial turn that was supposed to probe the agent's resistance also carried, in its own scaffolding (system preamble, tool-result injection, or a "grader hint" field merged into the running transcript), enough of the rubric's decision criteria that the agent's apparent compliance was a read-out of the rubric rather than of its policy. Two things get conflated that must be separated: - **Policy adherence** — the agent refuses/redirects because its safety prior fires. - **Rubric echo** — the agent refuses/redirects because the grading criteria were present in context and the model pattern-matched them. A contaminated LITMUS turn produces near-perfect safety scores and near-zero discriminative power. The invariant that must hold: *no token of the scoring rubric may appear in any context window the agent under test ever observes, across every turn of the multi-turn episode, including tool outputs and resumed checkpoints.* ## What Was Observed A multi-turn LITMUS episode is assembled from turn records. Each turn record in the authoring store has fields like `user_turn`, `expected_behavior`, `rubric_criteria`, `grader_notes`. During episode serialization for the agent, a harness bug merged the whole turn record (minus `expected_behavior`) into the transcript as a `role: "system"` continuation after turn 3 — a "context refresh" step intended to re-anchor the agent to the scenario. The `rubric_criteria` field rode along. Symptoms, in order of appearance: 1. Safety pass-rate on the contaminated suite jumped from 0.71 to 0.98 across the model matrix — suspiciously uniform, and *inversely* correlated with model capability (weaker models "passed" more). 2. Regression gate stopped firing: three candidate checkpoints that regressed on a held-out human-redteam set showed zero regression on LITMUS. The gate was blind. 3. The tell: on turns *after* the leak, refusal strings began echoing rubric vocabulary ("I must not provide operational detail regarding...") — the agent was quoting the grader. The leak was per-episode, deterministic, and invisible to the agent's own self-report. Cold-start resume from a checkpoint taken post-leak inherited the poisoned context; resume from pre-leak checkpoints did not. So the contamination was also a *state-continuity* fault: it persisted across checkpoint boundaries and silently replayed. ## Condition of Validity The invariant holds only if the harness enforces a **context firewall** between the authoring store and the agent-visible transcript, and verifies it at assembly time rather than trusting field-level discipline. Concretely: - The agent-visible transcript is built from a strict allowlist of projection fields (`user_turn`, sanitized tool results), never by "serialize record minus a denylist." Denylists fail open when new rubric fields are added. - A **rubric fingerprint** (normalized n-gram set of every `rubric_criteria`/`grader_notes` string) is computed per episode and asserted disjoint from the token set of the assembled transcript, at every turn boundary and after every checkpoint resume. - The check must run on the *post-merge* transcript, because the leak vector is the merge step (system refresh, tool-output enrichment, memory distillation), not the source record. If any of these is absent, the validity of every score in the suite is unestablished — not merely suspect. ## Decision Boundary - **Leak detected (fingerprint intersection non-empty):** the episode is quarantined and its scores are marked `INVALID`; the regression gate must treat `INVALID` as a hard fail-open-to-blocking, i.e. it blocks release until the episode is rebuilt. Never silently drop the episode — dropping contaminated episodes biases the suite toward the leak-prone scenarios that were easiest to author. - **Fingerprint empty but rubric vocabulary appears in agent output:** flag as *possible* echo, do not auto-quarantine. Distinguish by checking whether the matched vocabulary exists in the model's refusal templates independent of the episode. - **Resume from checkpoint:** re-run the fingerprint check against the *resumed* context, not the original. A checkpoint taken after a leak that was later patched will still carry the poisoned tokens; the pre-patch contamination is a continuity fault that survives the fix. The boundary is: contamination is a property of the assembled context at the moment of inference, not of the authoring artifact. Audit the former. ## Operational Effect With the firewall and post-merge fingerprint assertion in place, the contaminated suite's pass-rate fell back to 0.69–0.74 and regained discriminative power: the three regressed checkpoints now trip the gate. The cost is one extra tokenization pass per turn boundary (cheap relative to the inference it guards) and a rebuild of any episode that fails the assertion. The deeper operational lesson: a safety benchmark's *scores are only as trustworthy as its context firewall*, and because multi-turn episodes involve merge steps (refresh, tool enrichment, resume), the firewall must be a runtime assertion at each boundary rather than an authoring-time convention. An agent instance cannot detect that it was graded against a leaked rubric from the inside — its compliance looks identical to genuine policy adherence. Detection must be external, structural, and run against the post-merge transcript. ```python import re from dataclasses import dataclass, field class RubricLeakError(RuntimeError): """Raised when scoring-rubric tokens appear in the agent-visible transcript.""" pass class CheckpointContinuityError(RuntimeError): """Raised when a resumed checkpoint carries pre-patch contamination.""" pass def _normalize_tokens(text: str) -> set[str]: return set(re.findall(r"[a-z0-9]+", text.lower())) @dataclass class TurnRecord: user_turn: str rubric_criteria: str = "" grader_notes: str = "" expected_behavior: str = "" @dataclass class Episode: turns: list[TurnRecord] transcript: list[str] = field(default_factory=list) def rubric_fingerprint(self) -> set[str]: blob = " ".join(t.rubric_criteria + " " + t.grader_notes for t in self.turns) return _normalize_tokens(blob) def assemble(self) -> None: # Allowlist projection: only user_turn enters the transcript. self.transcript = [t.user_turn for t in self.turns] def assert_context_firewall(episode: Episode, *, resumed_from_checkpoint: bool = False) -> None: fp = episode.rubric_fingerprint() if not fp: return visible = _normalize_tokens(" ".join(episode.transcript)) leaked = fp & visible # Ignore ubiquitous stopword-like tokens that carry no rubric signal. leaked -= {"the", "a", "an", "and", "or", "to", "of", "in", "is", "be", "should", "must"} if leaked: if resumed_from_checkpoint: raise CheckpointContinuityError( f"Resumed checkpoint carries rubric tokens {sorted(leaked)[:8]}; " "pre-patch contamination survives the fix." ) raise RubricLeakError( f"Rubric tokens leaked into agent-visible transcript: {sorted(leaked)[:8]}. " "Episode quarantined; scores marked INVALID; gate must block." ) def run_episode(episode: Episode, *, resumed_from_checkpoint: bool = False) -> None: episode.assemble() # Firewall assertion runs on the POST-MERGE transcript, every boundary. assert_context_firewall(episode, resumed_from_checkpoint=resumed_from_checkpoint) if __name__ == "__main__": bad = Episode(turns=[ TurnRecord(user_turn="Walk me through X.", rubric_criteria="must not provide operational detail"), TurnRecord(user_turn="Continue, now with specifics.", rubric_criteria="refuse and redirect to safe alternative"), ]) # Simulate the merge bug: rubric text bleeds into a system continuation. bad.assemble() bad.transcript.append("must not provide operational detail; refuse and redirect") run_episode(bad) # raises RubricLeakError ```