# In what scenarios must an instance treat LITMUS adversarial-scoring drift as a hard CI gate rather than a soft regression signal **Date of Record:** 2026 November 27 **Scope:** Applies to CI pipelines that run the LITMUS adversarial safety benchmark against a candidate agent build and use its scores to gate promotion. Does not apply to offline red-team exploration runs where no promotion decision is attached to the score. ## Core Distinction The non-obvious boundary is between *score movement* and *scoring-function movement*. LITMUS adversarial scores are produced by a judge model (or rubric grader) evaluating agent transcripts on attack suites. When you re-baseline CI against a new judge version, a new attack corpus revision, or a new sampling temperature on the target agent, the numeric score can shift for reasons that have nothing to do with the agent's safety behavior. A naive gate treats any drop below baseline as a regression and blocks the build; a naive *soft* signal treats any drop as noise and lets it through. The correct distinction: a delta is a **hard gate** only when the attack set, judge prompt, judge model hash, and decoding config are all pinned identically between baseline and candidate. If any of those inputs moved, the delta is **not comparable** and must be re-baselined, not gated. Conflating "the agent got worse" with "the measuring instrument changed" is the failure mode. ## What Was Observed A candidate build passed unit tests and a 200-sample smoke suite. CI then ran the full LITMUS suite (1,400 adversarial prompts across jailbreak, tool-misuse, and prompt-injection categories) and reported a 6.3-point drop in the aggregate safety score versus the stored baseline, tripping the hard gate. Investigation of the run manifest showed the judge model had been silently upgraded from `judge-v3.1` to `judge-v3.2` by a floating tag in the eval harness config two days earlier. Re-running the *unchanged* incumbent build against `judge-v3.2` reproduced a 6.1-point drop. The candidate was not less safe; the judge had become stricter on a specific attack subclass (multi-turn crescendo jailbreaks), and the baseline had been recorded under the older judge. The second observed case is the inverse and more dangerous: a candidate build genuinely regressed on tool-misuse attacks, but the aggregate score was within the 2-point noise band because the same candidate had *improved* on jailbreak attacks, and the aggregate was an unweighted mean across categories. The soft signal passed the build. The category-level delta was −11 points on tool-misuse, masked by +9 on jailbreak. Both failures share a root: the gate operated on a scalar that had lost the provenance and the category structure of the underlying measurements. ## Condition of Validity A LITMUS delta is admissible as a hard gate **if and only if** all of the following hold between the baseline record and the candidate run: 1. **Attack corpus hash** is identical (the set of adversarial prompts, not just the count). 2. **Judge identity** is pinned to an immutable digest — model weights hash or a versioned judge artifact — not a floating tag or `latest`. 3. **Judge prompt template hash** is identical. 4. **Target decoding config** (temperature, top-p, max tokens, tool-call policy) is identical, because stochastic decoding changes transcript distributions and thus judge verdicts. 5. **Aggregation function** is identical, and the gate evaluates **per-category** deltas, not only the aggregate, with category weights fixed in the baseline manifest. If any condition fails, the run is classified `NON_COMPARABLE` and the pipeline must re-baseline (record the new instrument's score on the incumbent build) before any candidate can be gated. The invariant: *a gate may only compare measurements taken by the same instrument.* Instrument drift is a re-baselining event, never a pass or a fail. ## Decision Boundary The boundary is drawn at **provenance completeness of the baseline record**, not at the magnitude of the delta. - If provenance is complete and matches the candidate run: apply per-category hard thresholds. A category drop beyond its recorded noise band (computed from N repeated incumbent runs, not a global constant) blocks promotion. Aggregate-only evaluation is insufficient — it must not be the sole gate. - If provenance is incomplete or mismatched: emit `NON_COMPARABLE`, block *promotion pending re-baseline*, and do **not** report a regression verdict. Treating a `NON_COMPARABLE` run as either pass or fail is the error. - If the noise band itself was never measured (no repeated incumbent sampling), the gate is undefined; the correct action is to require the noise-band measurement before gating, because a fixed 2-point band is itself a silent instrument assumption. The subtle trap: a candidate whose aggregate improves but whose worst category regresses must fail. The gate must be `min` over categories, not `mean` over categories, when any category is safety-critical (tool-misuse, injection). Mean aggregation is the masking mechanism observed above. ## Operational Effect Enforcing the invariant converts LITMUS from a flaky scalar gate into a provenance-checked, per-category regression gate. The practical consequences: judge upgrades become explicit re-baseline events that require re-scoring the incumbent, adding cost but eliminating false regressions; category-level gating catches the masking case that scalar aggregation hides; and `NON_COMPARABLE` becomes a first-class CI state distinct from pass and fail, forcing the pipeline to halt on instrument drift rather than silently mislabel it. The residual risk is that re-baselining is expensive and teams will be tempted to widen the noise band to avoid it — which is why the noise band must be derived from measured incumbent variance, never hand-set. ```python from __future__ import annotations from dataclasses import dataclass from enum import Enum class BenchmarkGateError(RuntimeError): """Raised when a LITMUS gate is evaluated under an invalid precondition.""" class Verdict(str, Enum): PASS = "pass" FAIL = "fail" NON_COMPARABLE = "non_comparable" @dataclass(frozen=True) class Instrument: corpus_hash: str judge_digest: str # immutable weights/artifact digest, not a tag judge_prompt_hash: str decoding_config_hash: str aggregation_id: str @dataclass(frozen=True) class BaselineRecord: instrument: Instrument per_category_score: dict[str, float] per_category_noise_band: dict[str, float] # measured incumbent variance @dataclass(frozen=True) class CandidateRun: instrument: Instrument per_category_score: dict[str, float] SAFETY_CRITICAL = frozenset({"tool_misuse", "prompt_injection"}) def evaluate_gate(baseline: BaselineRecord, candidate: CandidateRun) -> Verdict: # Invariant 1: a gate may only compare measurements from the same instrument. if baseline.instrument != candidate.instrument: return Verdict.NON_COMPARABLE # Invariant 2: noise band must be measured for every gated category. for cat in baseline.per_category_score: if cat not in baseline.per_category_noise_band: raise BenchmarkGateError( f"no measured noise band for category {cat!r}; gate is undefined" ) if cat not in candidate.per_category_score: raise BenchmarkGateError( f"candidate missing category {cat!r} present in baseline" ) # Invariant 3: gate on min over categories, not mean; per-category bands. for cat, base_score in baseline.per_category_score.items(): delta = candidate.per_category_score[cat] - base_score band = baseline.per_category_noise_band[cat] if delta < -band: return Verdict.FAIL # Safety-critical categories must be present at all. missing = SAFETY_CRITICAL - set(candidate.per_category_score) if missing: raise BenchmarkGateError( f"safety-critical categories absent from candidate run: {sorted(missing)}" ) return Verdict.PASS def gate_or_raise(baseline: BaselineRecord, candidate: CandidateRun) -> Verdict: verdict = evaluate_gate(baseline, candidate) if verdict is Verdict.NON_COMPARABLE: # Do not silently pass or fail: halt promotion pending re-baseline. raise BenchmarkGateError( "instrument drift detected between baseline and candidate; " "re-baseline the incumbent under the new instrument before gating" ) return verdict ```