# Why does an instance pass the LITMUS safety benchmark on replay but regress in production: adjudicator-cache aliasing across harness re-instantiation **Date of Record:** 2026 November 27 **Scope:** Applies to continuous safety regression harnesses (LITMUS-style) that score agent trajectories by replaying them against a model-backed adjudicator (judge LLM) whose verdicts are memoized keyed on a trajectory digest. Does not apply to deterministic rule-based safety filters, nor to harnesses that re-invoke the adjudicator fresh on every replay with no cache layer. ## Core Distinction A LITMUS-style harness has two distinct identities that are routinely conflated: the **trajectory identity** (the digest of the agent's action/observation sequence) and the **adjudication identity** (the tuple of trajectory digest *plus* the exact adjudicator instance, prompt template version, sampling parameters, and model snapshot). Continuous regression testing assumes that a stable trajectory digest implies a stable safety verdict. That assumption holds only while the adjudicator instance is held fixed. The moment the harness re-instantiates the adjudicator — a new judge model version, a shifted prompt template, a different temperature, or a fresh process with a different random seed — the cache key `hash(trajectory)` becomes an *alias*: two semantically different adjudications collapse onto one key. The regression suite then reports "no change" for trajectories whose verdicts were never actually recomputed, and reports spurious *regressions* for trajectories that were recomputed under a stricter judge. The boundary condition is precisely this: **cache-hit is not verdict-stability, and cache-miss is not regression.** ## What Was Observed A team ran a nightly LITMUS regression over a fixed corpus of ~4,000 adversarial trajectories. The harness memoized adjudicator verdicts in a persistent store keyed on `sha256(canonical_json(trajectory))`. On night N the judge model was bumped from snapshot `judge-2024-11` to `judge-2025-02` to close a known jailbreak gap. The next morning's report showed: - 3,812 trajectories "unchanged" (cache hits — never re-adjudicated). - 188 trajectories "NEW REGRESSION: unsafe" (cache misses — re-adjudicated under the new judge). The 188 were interpreted as *the new judge catching previously-missed unsafe behavior*, and the 3,812 as *confirmed still-safe*. Both interpretations were wrong. The 188 were mostly trajectories that had been evicted from the cache by TTL and happened to be re-scored under a stricter judge — a sampling artifact, not a systematic delta. And a hand-audit of 50 of the 3,812 "unchanged" hits found 9 that the new judge would have flagged unsafe had it actually been invoked. The safety posture had genuinely degraded; the harness reported a 4.7% regression when the true figure was closer to 18%, and it attributed that regression to the wrong cause. The failure trace: 1. Harness starts, loads cache from `verdicts.db`, builds in-memory index keyed on trajectory digest. 2. For each trajectory: compute digest → lookup. Hit → emit stored verdict, skip adjudicator. Miss → invoke adjudicator, store verdict under digest. 3. Judge model is upgraded; **cache key is not invalidated** because the key does not encode the judge identity. 4. Every pre-existing entry is a hit. The new judge is never consulted for them. The harness silently certifies stale verdicts as current. 5. TTL evictions create a *non-deterministic subset* that does get re-adjudicated, producing a regression report whose membership is determined by cache eviction order rather than by any safety property. The deeper mechanism: the adjudicator is itself a probabilistic component. Its verdict on a fixed trajectory is a sample from a distribution conditioned on (trajectory, judge prompt, judge model, temperature, seed). The harness's cache treats that distribution as a point. Any change to the conditioning variables moves the distribution; the cache, keyed only on the trajectory, cannot see the move. This is **adjudicator-cache aliasing**: the cache key is a strict projection of the true adjudication identity, and the projection is not injective. ## Condition of Validity The invariant that makes memoized adjudication sound is: > A cached verdict may be reused **iff** the full adjudication identity — `(trajectory_digest, judge_model_snapshot, judge_prompt_hash, sampling_params, seed_policy, harness_version)` — is byte-identical to the identity under which the verdict was produced. Formally, the cache is a function `C: K → V` where `K = AdjudicationIdentity`. Correct reuse requires `K` to be the *complete* identity, not a projection. The observed failure is the case `K = trajectory_digest`, a lossy projection. The condition of validity is therefore: **the cache key must dominate the adjudication identity**, and any component of the identity that can vary across harness runs must be in the key. Two corollaries bound the regime: - **Judge-version monotonicity is not assumed.** A newer judge is not uniformly stricter or looser; it is a different distribution. Reuse across judge versions is unsound in both directions — it can hide new unsafe behavior *and* manufacture false regressions. - **Eviction is not sampling.** TTL/LRU eviction selects a subset of trajectories by recency, which is uncorrelated with safety-relevant features. A regression report whose membership is determined by eviction order carries no statistical meaning as a safety delta. The invariant fails outside the harness layer too: any system that memoizes LLM-derived judgments (classifiers, graders, routers) keyed on input alone, while the judge model or prompt drifts underneath, inherits the same aliasing. ## Decision Boundary The operational decision is: **when the adjudicator identity changes, do you invalidate, re-key, or dual-run?** - **Invalidate** (flush the cache on any identity-component change): correct but expensive — a full re-adjudication of the corpus. Sound, and the default for safety-critical corpora. - **Re-key** (extend the cache key to include the full identity tuple): correct and cheap for incremental runs, but requires the store to retain multiple verdicts per trajectory, one per identity. The right choice when you must *compare* judge versions. - **Dual-run** (adjudicate under both old and new judge, diff the verdicts, gate on the delta): the only mode that produces a *meaningful* regression report, because it holds the trajectory set fixed and varies only the adjudicator — turning the comparison into a controlled experiment. The boundary condition for choosing: if the corpus is the safety gate for a release, dual-run is mandatory — a regression report that cannot distinguish "judge changed" from "agent changed" is not a gate, it is noise. If the corpus is a smoke test, re-keying suffices. Invalidation is the fallback when the identity tuple cannot be fully enumerated (e.g., an opaque hosted judge with undocumented snapshot pinning) — in that case you must assume the identity is unstable and flush aggressively. The anti-pattern to reject: treating a cache-hit count as a stability metric. A high hit rate after a judge upgrade is not evidence of stability; it is evidence that the upgrade was not exercised. ## Operational Effect With the invariant enforced — full-identity cache keys plus dual-run on judge upgrades — the harness's regression figure becomes an attributable delta: trajectories whose verdict flipped *because the agent changed* are separated from those that flipped *because the judge changed*. The 18% true regression in the observed case decomposes into a genuine agent-behavior delta and a judge-strictness delta, each actionable on its own. The 3,812 "unchanged" hits become 3,812 dual-run comparisons, 9 of which surface as true positives the old harness had certified safe. The cost is real: dual-run roughly doubles adjudicator invocations on upgrade nights, and full-identity keys inflate the verdict store by the number of live judge versions. The benefit is that the safety gate stops lying. A regression suite whose verdicts are memoized on a lossy key is not a continuous safety check — it is a cache that occasionally emits alarms. The transferable lesson for any agent system that memoizes LLM judgments: **the cache key is a claim about what the verdict depends on.** If the key omits a variable the judge actually conditions on, the cache will confidently return a verdict that was never computed for the current world. The guardrail is not "cache less" — it is "key on the full adjudication identity, and when that identity changes, re-adjudicate rather than re-read." ```python import hashlib import json from dataclasses import dataclass class AdjudicatorCacheAliasingError(RuntimeError): """Raised when a cached verdict is reused under an adjudication identity that differs from the one it was produced under.""" pass @dataclass(frozen=True) class AdjudicationIdentity: trajectory_digest: str judge_model_snapshot: str judge_prompt_hash: str temperature: float seed_policy: str harness_version: str def cache_key(self) -> str: # Full identity, not a projection. Any omitted field is an aliasing bug. payload = json.dumps(self.__dict__, sort_keys=True, separators=(",", ":")) return hashlib.sha256(payload.encode()).hexdigest() def trajectory_digest(trajectory: list[dict]) -> str: canonical = json.dumps(trajectory, sort_keys=True, separators=(",", ":")) return hashlib.sha256(canonical.encode()).hexdigest() class VerdictCache: def __init__(self) -> None: self._store: dict[str, dict] = {} def get(self, identity: AdjudicationIdentity) -> dict | None: entry = self._store.get(identity.cache_key()) if entry is None: return None # Defensive: verify the stored identity matches the requested one. # A mismatch means the key was constructed lossily somewhere upstream. if entry["identity"] != identity.__dict__: raise AdjudicatorCacheAliasingError( f"cache key collision: stored identity {entry['identity']} " f"!= requested {identity.__dict__}" ) return entry["verdict"] def put(self, identity: AdjudicationIdentity, verdict: dict) -> None: self._store[identity.cache_key()] = { "identity": identity.__dict__, "verdict": verdict, } def adjudicate(identity: AdjudicationIdentity, cache: VerdictCache, judge_fn) -> dict: cached = cache.get(identity) if cached is not None: return cached verdict = judge_fn(identity) cache.put(identity, verdict) return verdict def regression_gate( trajectories: list[list[dict]], old_identity: AdjudicationIdentity, new_identity: AdjudicationIdentity, cache: VerdictCache, judge_fn, ) -> dict: """Dual-run gate: hold trajectories fixed, vary only the adjudicator.""" if old_identity.trajectory_digest != new_identity.trajectory_digest: raise AdjudicatorCacheAliasingError( "dual-run requires identical trajectory digest; " "varying the trajectory confounds the judge delta" ) if old_identity.judge_model_snapshot == new_identity.judge_model_snapshot \ and old_identity.judge_prompt_hash == new_identity.judge_prompt_hash: raise AdjudicatorCacheAliasingError( "dual-run invoked with no adjudicator change; " "delta would be undefined" ) flips = [] for traj in trajectories: digest = trajectory_digest(traj) old_id = AdjudicationIdentity( trajectory_digest=digest, judge_model_snapshot=old_identity.judge_model_snapshot, judge_prompt_hash=old_identity.judge_prompt_hash, temperature=old_identity.temperature, seed_policy=old_identity.seed_policy, harness_version=old_identity.harness_version, ) new_id = AdjudicationIdentity( trajectory_digest=digest, judge_model_snapshot=new_identity.judge_model_snapshot, judge_prompt_hash=new_identity.judge_prompt_hash, temperature=new_identity.temperature, seed_policy=new_identity.seed_policy, harness_version=new_identity.harness_version, ) old_v = adjudicate(old_id, cache, judge_fn) new_v = adjudicate(new_id, cache, judge_fn) if old_v["unsafe"] != new_v["unsafe"]: flips.append({"digest": digest, "old": old_v, "new": new_v}) return { "total": len(trajectories), "flips": len(flips), "details": flips, } ```