# What happens when an instance of a LITMUS safety harness reuses a cached adversarial transcript across a model swap and the regression gate silently passes a poisoned baseline **Date of Record:** 2026 November 22 **Scope:** Applies to LITMUS-style adversarial evaluation harnesses that cache rendered attack transcripts (prompt + tool fixtures + expected-refusal labels) keyed by scenario ID and reuse them across model/agent revisions. Does not apply to harnesses that regenerate attack payloads per run or that key caches on a full (model, system-prompt, tool-schema, tokenizer) tuple. ## Core Distinction A LITMUS harness has two distinct notions of "the same test": **scenario identity** (the adversarial intent — a jailbreak vector, a tool-abuse fixture, a prompt-injection payload) and **execution identity** (the exact byte sequence the target instance actually sees, plus the label the grader compares against). Regression gating is only valid when the pass/fail decision is bound to execution identity. The failure mode here is that a cache keyed on scenario identity lets a new target instance inherit an old instance's rendered transcript *and* its old grader verdict, so the gate compares a fresh model's behavior against a stale baseline that was itself produced by a different model. The gate stops measuring the target and starts measuring the cache. ## What Was Observed A harness pins attack scenarios to a content-addressed store: `cache[scenario_id] -> {rendered_prompt, tool_fixtures, expected_label, last_verdict}`. On a model revision bump the orchestrator swaps the `target_model` field but the `scenario_id` is unchanged, so every scenario resolves to a cache hit. Three things then go wrong in sequence: 1. **Transcript staleness.** The rendered prompt embeds the target's own system prompt and tool schemas via a template. After the swap, the template re-renders *only if* the cache misses. Because it hits, the target receives the *previous* model's system prompt and a tool schema the new model may not even accept. The adversarial payload is now attacking a scaffold the instance is not running. 2. **Label drift.** `expected_label` was set by a human on the old transcript. If the new target legitimately refuses under its new system prompt, the grader still compares to the old label and may mark it a *regression* (false positive) — or, worse, if the old label was `unsafe_complied` (a known-bad baseline kept for tracking), a new target that also complies is marked *pass* because it "matches baseline." 3. **Verdict laundering.** `last_verdict` is written back on cache hit. A scenario that failed on model v1 is cached as `fail`; when the gate runs on v2 it reads `last_verdict` for unchanged scenarios and reports the aggregate as v2's safety score. The v2 run never actually executed those scenarios. The net effect: the regression gate reports a delta of ~0 across a model swap because the majority of scenarios were never re-executed, and the ones that were re-executed were graded against a transcript the new instance never saw. ## Condition of Validity The invariant that must hold for any cached-scenario gate to be sound: > For every scenario in the gate's evaluation set, the tuple `(rendered_prompt_bytes, tool_schema_hash, system_prompt_hash, tokenizer_id, expected_label, grader_version)` must be identical between the baseline run and the candidate run, **or** the scenario must be re-executed and re-labeled before its verdict contributes to the delta. Equivalently: the cache key must be a superset of every input the target instance can observe. `scenario_id` alone is not such a superset — it identifies intent, not execution. The moment any observable input changes (system prompt, tool schema, decoding params, tokenizer), the cached transcript is no longer a valid probe of the candidate and the cached verdict is no longer a valid baseline. This condition is *not* satisfied by "the scenario text didn't change." It is satisfied only by hashing the full observable surface. A harness that keys on scenario ID is valid only under the narrow precondition that the target's observable surface is frozen — which is precisely what a model swap violates. ## Decision Boundary The boundary is between **cache reuse for cost** and **cache reuse for verdict attribution**. Reusing a rendered transcript to save tokenization and fixture-build cost is fine *if* the harness re-executes and re-grades and treats the cached transcript as a mere input. Reusing the cached *verdict* is the line that must not be crossed. Concretely: - **Allowed:** cache hit → re-run target on cached transcript → re-grade → write fresh verdict. - **Forbidden:** cache hit → skip execution → read `last_verdict` → contribute to gate delta. - **Required guardrail:** on any change to `system_prompt_hash`, `tool_schema_hash`, `tokenizer_id`, or `target_model`, invalidate `expected_label` and mark the scenario `needs_relabel` before it can enter the delta. A scenario in `needs_relabel` state must not be counted as pass or fail — it is excluded from the denominator and surfaced as a coverage gap. The boundary is sharp because the two behaviors are indistinguishable in the aggregate score: both produce a number. Only the per-scenario provenance distinguishes a real measurement from a laundered one. ## Operational Effect Without the guardrail, the harness's regression gate is anti-correlated with actual safety on exactly the transitions it exists to catch — model upgrades and system-prompt revisions. Teams observe flat safety scores across releases and conclude the model is stable, when in fact the gate has stopped probing. The failure is silent because the gate's output schema has no field for "scenarios not executed"; a 100% cache-hit rate reads identically to a 100% pass rate. With the guardrail, a model swap produces a spike in `needs_relabel` coverage, forcing re-execution and human re-labeling of the affected scenarios before the delta is trusted. The cost is real (a full re-run per swap), but the alternative is a gate that certifies a model it never tested. The correct operational posture is: treat every cache hit whose observable-surface hash mismatches the baseline as a *cache miss for grading purposes*, even if the bytes are reusable for execution. ```python import hashlib from dataclasses import dataclass class StaleBaselineError(RuntimeError): """Raised when a cached scenario verdict is reused across an incompatible target surface.""" pass @dataclass(frozen=True) class ObservableSurface: system_prompt: str tool_schema: str tokenizer_id: str target_model: str def fingerprint(self) -> str: h = hashlib.sha256() for part in (self.system_prompt, self.tool_schema, self.tokenizer_id, self.target_model): h.update(part.encode("utf-8")) h.update(b"\x00") return h.hexdigest() @dataclass class CachedScenario: scenario_id: str surface_fingerprint: str expected_label: str last_verdict: str def resolve_verdict( scenario: CachedScenario, candidate_surface: ObservableSurface, require_relabel: set[str], ) -> str: """Return a verdict only if the cached baseline is valid for the candidate surface. A cache hit whose surface fingerprint differs from the candidate's is NOT a valid baseline: the candidate never saw the cached transcript, so its verdict cannot be compared to the cached label. """ if scenario.surface_fingerprint != candidate_surface.fingerprint(): require_relabel.add(scenario.scenario_id) raise StaleBaselineError( f"scenario {scenario.scenario_id!r} cached under surface " f"{scenario.surface_fingerprint[:12]} but candidate runs " f"{candidate_surface.fingerprint()[:12]}; verdict is not attributable" ) if scenario.scenario_id in require_relabel: raise StaleBaselineError( f"scenario {scenario.scenario_id!r} is pending relabel; " "must not contribute to gate delta" ) return scenario.last_verdict def gate_delta( scenarios: list[CachedScenario], baseline_surface: ObservableSurface, candidate_surface: ObservableSurface, ) -> dict: require_relabel: set[str] = set() executed, excluded = 0, 0 for s in scenarios: try: resolve_verdict(s, candidate_surface, require_relabel) executed += 1 except StaleBaselineError: excluded += 1 return { "executed": executed, "excluded_needs_relabel": excluded, "coverage_gap": excluded / max(len(scenarios), 1), "delta_trusted": excluded == 0, } ```