# Which invariants prevent LITMUS adversarial-probe attribution drift from silently passing a regressed agent through CI gating **Date of Record:** 2026 November 25 **Scope:** Applies to LITMUS-style adversarial safety harnesses that score an agent against a fixed probe corpus and emit a pass/fail gate for CI. Covers probe-set mutation, scorer re-anchoring, and cross-run comparison. Does not cover live red-teaming, human adjudication of borderline outputs, or model-weights-level safety training. ## Core Distinction The failure is not "the agent got less safe." It is that **the gate compared two runs that were not the same experiment**, and reported the difference as safety delta. LITMUS gates fail in two distinct ways that look identical in the CI log: 1. **Genuine regression** — same probes, same scorer, agent behavior changed. 2. **Attribution drift** — the probe set, the scorer rubric, or the reference baseline changed between the gating run and the anchor run, so the delta is an artifact of the harness, not the agent. The non-obvious boundary: attribution drift does not raise errors. It produces a *plausible, often improved* score. A regenerated or re-weighted probe corpus frequently makes an agent look safer because the new probes are easier or the scorer has shifted its decision boundary. CI goes green. The invariant that must hold is **experiment identity**: a gate is only valid if the tuple `(probe_set_hash, scorer_version, rubric_hash, baseline_anchor_id, seed_policy)` is bit-identical between the candidate run and the anchor run. Any component change invalidates the comparison and must force a re-baseline, not a delta. ## What Was Observed A safety harness ran nightly against a fixed 1,200-probe corpus (prompt-injection, jailbreak, tool-misuse, data-exfiltration categories). Gating rule: candidate pass-rate must not drop more than 2 percentage points below the stored anchor pass-rate. A routine maintenance commit regenerated 140 probes because their target strings had become stale after a tool-schema rename. The regeneration process re-derived probe difficulty from a fresh sampling pass, which produced slightly softer variants (longer preambles, more explicit refusal cues). The scorer was untouched. Trace of the failure: - Anchor run (week N): pass-rate 0.912, stored with `probe_set_hash = a1b2…`. - Maintenance commit: 140 probes replaced; `probe_set_hash` became `c9d4…`. The CI config still pointed the gate at the old anchor ID. - Candidate run (week N+1): pass-rate 0.934. Delta = +2.2 pp. Gate passes with margin. - Same week, a separate agent change (loosened a refusal heuristic in the tool-call planner) shipped. It was masked because the probe corpus had *also* gotten easier by roughly the same magnitude the agent had gotten worse. The scorer never flagged anything because the scorer is stateless per-probe. The harness never flagged anything because the gate compared aggregate rates, not experiment identity. The drift was only caught three weeks later when a manual audit replayed the week-N+1 candidate against the *original* probe set and found an 8.1 pp drop in the tool-misuse category. The mechanism: **probe regeneration is a silent re-weighting of the test distribution.** Aggregate pass-rate is a scalar summary that hides category-level redistribution. A 140-probe swap out of 1,200 (11.7%) can move the aggregate by several points if the swapped probes were disproportionately from high-failure categories. The gate's 2 pp threshold is smaller than the plausible magnitude of regeneration noise, so the threshold cannot distinguish signal from harness churn. ## Condition of Validity The gate is only meaningful under the following conjunction, which must be checked *before* any delta is computed: - `probe_set_hash(candidate) == probe_set_hash(anchor)` — the exact probe bytes, including target strings, preambles, and per-probe metadata. - `scorer_version(candidate) == scorer_version(anchor)` AND `rubric_hash(candidate) == rubric_hash(anchor)` — the scoring function and its decision boundary are pinned. - `seed_policy(candidate) == seed_policy(anchor)` — sampling temperature, top-p, and any probe-order randomization are identical, because order affects stateful agents. - `baseline_anchor_id` resolves to a run whose tuple matches the candidate's tuple on all of the above. If any conjunct fails, the correct action is **re-baseline**: run the anchor configuration against the current probe set, store the new anchor, and *do not emit a delta* for that cycle. A delta across mismatched tuples is undefined, not small. A second invariant bounds category-level masking: **per-category deltas must be gated independently**, and the gate must fail if any category drops beyond threshold even when the aggregate improves. Aggregate-only gating is the specific vulnerability that let the tool-misuse regression hide behind an easier overall corpus. ## Decision Boundary The harness must draw a hard line between *comparable* and *incomparable* runs, and refuse to compute a delta in the incomparable case rather than clamping it to zero or to the nearest anchor. - **Comparable**: all five tuple components match. Compute aggregate and per-category deltas; apply thresholds. - **Incomparable, probe-only change**: force re-baseline; emit `REBASELINED`, not `PASS`/`FAIL`. The CI status must be neutral-amber, not green, so a human sees the corpus moved. - **Incomparable, scorer or rubric change**: force re-baseline *and* replay the previous anchor's stored raw outputs through the new scorer to measure scorer-induced delta separately. Scorer drift and agent drift must never be summed into one number. - **Missing anchor**: hard fail. An unanchored run cannot gate. The subtle boundary: a probe *addition* (not replacement) is also a distribution change. Adding 50 probes to a 1,200-probe corpus shifts the denominator and can move the aggregate by more than the 2 pp threshold even if the agent is unchanged. Additions must be treated identically to replacements — re-baseline required — unless the gate scores only the intersection of probe IDs present in both runs, in which case the addition is inert for gating and the intersection size must be logged. ## Operational Effect With experiment-identity enforcement, the failure above becomes impossible in its silent form. The maintenance commit that regenerated 140 probes would have tripped `probe_set_hash` mismatch, forced a re-baseline, and emitted a neutral status. The subsequent planner regression would then have been measured against a *fresh, matched* anchor and surfaced as a real drop. The cost is operational: every probe-corpus edit requires a re-baseline run, which is a full harness pass. Teams resist this and are tempted to "just update the anchor ID." That temptation is exactly the failure. The invariant must be enforced in code, not in convention — the gate must *derive* comparability from the run manifest, never trust a hand-edited anchor pointer. Two guardrails make the invariant durable: 1. **Manifest hash binding.** Every run stores a manifest containing the five tuple components plus per-probe IDs and their individual outcomes. The gate recomputes the tuple hash from the manifest and compares to the anchor's; it does not read a separately-stored anchor ID that could go stale. 2. **Per-category independent gating with intersection scoring.** Score aggregate on the probe-ID intersection (so additions are inert), but gate each category independently against its own threshold. This catches the redistribution masking that aggregate deltas hide. The residual risk after these guardrails is *scorer* drift — a rubric edit that changes the decision boundary without changing the version string. That is caught only by the replay step: re-scoring the previous anchor's raw outputs through the current scorer and asserting the scorer-induced delta is below a tight bound (e.g., 0.5 pp). If replay shows the scorer moved, the scorer change is the regression source, and the agent gate is blocked until the scorer is re-pinned. ```python import hashlib import json from dataclasses import dataclass class AttributionDriftError(RuntimeError): """Raised when a LITMUS gate attempts to compare incomparable runs.""" pass @dataclass(frozen=True) class RunManifest: probe_set_hash: str scorer_version: str rubric_hash: str seed_policy: str per_probe_outcomes: dict # probe_id -> bool (passed) def _tuple_hash(m: RunManifest) -> str: payload = json.dumps( { "probe_set_hash": m.probe_set_hash, "scorer_version": m.scorer_version, "rubric_hash": m.rubric_hash, "seed_policy": m.seed_policy, }, sort_keys=True, ).encode() return hashlib.sha256(payload).hexdigest() def gate(candidate: RunManifest, anchor: RunManifest, threshold_pp: float) -> str: # Invariant 1: experiment identity must hold before any delta is computed. if _tuple_hash(candidate) != _tuple_hash(anchor): # Do NOT compute a delta. Force re-baseline. return "REBASELINED" # Invariant 2: score only the probe-ID intersection so additions are inert. common = set(candidate.per_probe_outcomes) & set(anchor.per_probe_outcomes) if not common: raise AttributionDriftError( "No overlapping probe IDs between candidate and anchor; " "delta is undefined, not zero." ) def rate(m: RunManifest) -> float: hits = sum(1 for pid in common if m.per_probe_outcomes[pid]) return hits / len(common) delta_pp = (rate(candidate) - rate(anchor)) * 100.0 if delta_pp < -threshold_pp: return "FAIL" return "PASS" def gate_with_category_guard( candidate: RunManifest, anchor: RunManifest, category_of: dict, # probe_id -> category threshold_pp: float, ) -> str: if _tuple_hash(candidate) != _tuple_hash(anchor): return "REBASELINED" common = set(candidate.per_probe_outcomes) & set(anchor.per_probe_outcomes) if not common: raise AttributionDriftError("Empty probe intersection; refusing to gate.") # Per-category independent gating: aggregate improvement cannot mask a # category-level regression. by_cat: dict = {} for pid in common: by_cat.setdefault(category_of.get(pid, "uncategorized"), []).append(pid) for cat, pids in by_cat.items(): c_rate = sum(1 for p in pids if candidate.per_probe_outcomes[p]) / len(pids) a_rate = sum(1 for p in pids if anchor.per_probe_outcomes[p]) / len(pids) if (c_rate - a_rate) * 100.0 < -threshold_pp: return "FAIL" return "PASS" # Example trigger: probe regeneration invalidates the anchor. anchor = RunManifest("a1b2", "scorer-3.1", "rubric-7", "temp=0.0", {"p1": True, "p2": False}) regen = RunManifest("c9d4", "scorer-3.1", "rubric-7", "temp=0.0", {"p1": True, "p2": True}) status = gate(regen, anchor, threshold_pp=2.0) if status == "PASS": raise AttributionDriftError( "Gate passed across mismatched probe_set_hash; experiment identity " "was not enforced." ) assert status == "REBASELINED" ```