# When must an instance reject a LITMUS safety score that is statistically valid but operationally stale: the freshness–confidence divergence at the CI/CD deployment gate **Date of Record:** 2026 November 29 **Scope:** Applies to any agent CI/CD pipeline that computes a continuous safety score (LITMUS-derived or equivalent probe-suite scoring) over a fixed eval corpus and uses a threshold on that score as a hard deployment gate. Does not apply to online runtime guardrails, per-request content filters, or offline red-team reporting that carries no promotion authority. ## Core Distinction A LITMUS-style safety score is a *statistic over a frozen eval corpus*. A deployment gate is a *decision over a moving agent*. The failure mode is not that the score is wrong — it is that the score is *correct and irrelevant at the same time*. The gate consumes a scalar `S ∈ [0,1]` with an attached confidence interval, and conflates two orthogonal properties: - **Statistical validity**: the corpus is large enough, the probe set is representative, the CI is tight. This is what the score's confidence interval measures. - **Operational freshness**: the score was computed against an instance whose weights, system prompt, tool registry, and retrieval index are the same ones being promoted. This is what the confidence interval *does not* measure. The boundary condition: as eval corpora grow, confidence intervals shrink, and the gate becomes *more* confident about a score that may have been computed against a materially different agent. Tightening the CI actively *hides* staleness. A wide CI at least signals "don't trust this number"; a narrow CI says "trust this number" while the number describes a different artifact. ## What Was Observed A promotion pipeline scored candidate agent builds against a 12,400-probe LITMUS corpus. Each build produced `(score, n, ci_low, ci_high, corpus_hash, agent_fingerprint, computed_at)`. The gate rule was `ci_low >= 0.82`. Three observations from the incident trace: 1. **Fingerprint drift without score drift.** Build `b-4471` was scored at `S=0.87, ci_low=0.851` against corpus `c-88`. Between scoring and promotion, the tool registry gained a new `web_fetch` capability and the system prompt's tool-use preamble was edited. The agent fingerprint (hash of weights + prompt + tool schema) changed; the score did not. The gate passed because it only checked `ci_low`. 2. **Corpus hash was checked, agent fingerprint was not.** The pipeline validated `corpus_hash == expected` but treated `agent_fingerprint` as informational metadata. This is the exact inversion of what matters: the corpus is frozen by construction, the agent is the thing under test. 3. **Re-scoring cost created pressure to reuse.** A full LITMUS pass took 41 minutes and ~$180 of inference. When a build was rebuilt with a one-line prompt tweak, engineers reused the prior score. The reuse was *rational* under the gate's own logic (same corpus, same weights) and *wrong* under the deployment's actual question (is *this* artifact safe?). The failure trace: `score computed → fingerprint F1 → artifact mutated → fingerprint F2 → gate reads S(F1) → promotes F2`. No exception, no log line, no alert. The gate did exactly what it was specified to do. ## Condition of Validity A LITMUS-derived gate score `S` is a valid promotion predicate **iff** all of the following hold at the instant of the gate decision: - `agent_fingerprint(artifact_at_gate) == agent_fingerprint(artifact_at_scoring)`, where the fingerprint covers weights hash, system prompt hash, tool schema hash, and retrieval-index hash. - `corpus_hash == corpus_hash_at_scoring` and the corpus is byte-identical (probe text, expected labels, ordering if scoring is order-sensitive). - `now - computed_at <= TTL`, where TTL is derived from the *rate of change* of the agent's dependencies, not from a fixed calendar constant. An agent whose tool registry changes weekly has a shorter valid TTL than one pinned to a frozen toolset. - The scoring run's probe-level pass/fail vector is retained, not just the aggregate. Aggregate-only storage makes it impossible to detect that a subset of probes silently stopped executing (e.g., a tool-call timeout that the harness counted as a pass). Violation of any one of these invalidates `S` as a promotion predicate *regardless of how tight `ci_low` is*. The confidence interval is conditional on the fingerprint match; it is not a substitute for it. ## Decision Boundary The gate must distinguish three states, not two: - **PROMOTE**: fingerprint match ∧ corpus match ∧ within TTL ∧ `ci_low >= threshold`. - **RESCORE**: fingerprint mismatch ∧ within TTL budget ∧ `computed_at` recent. The artifact changed; the score is stale by construction. Block promotion, enqueue a re-score, do not fail the build. - **REJECT**: corpus mismatch, TTL exceeded with no re-score budget, or `ci_low < threshold` on a fresh score. The non-obvious boundary: **a fingerprint mismatch must never be resolved by widening the CI or lowering the threshold.** The mismatch is a category error, not a marginal case. Treating it as marginal is how the `b-4471` promotion happened — the operator saw `ci_low=0.851` against a `0.82` bar, judged the margin comfortable, and manually approved. The margin was irrelevant because the score described a different agent. A second boundary: **TTL must be checked against `computed_at`, not against build time.** A long-lived artifact rebuilt from the same source can have a fresh build timestamp and a stale score. The clock that matters is the scoring clock. ## Operational Effect Enforcing the fingerprint-and-TTL invariant converts a silent correctness failure into a visible, cheap one. The pipeline now: - Stores `agent_fingerprint` as a first-class gate input, and computes it over weights, prompt, tool schema, and retrieval index — not just the model weights. - Persists the per-probe pass/fail vector alongside the aggregate, so a harness regression that zeroes out a probe subset is detectable as a vector diff rather than an unchanged scalar. - Applies a dependency-derived TTL: the tool registry's change cadence sets the ceiling. When `web_fetch` was added, the TTL for that agent class dropped from 14 days to 2. - Emits `RESCORE` as a distinct pipeline outcome, so a stale-but-recent score blocks promotion without failing the build and without inviting manual override. The residual risk is unchanged: a score can still be valid, fresh, and wrong if the corpus is unrepresentative. That is a corpus-design problem, not a gate-integrity problem, and it is out of scope for this invariant. What the invariant bounds is the class of failures where the gate is confident about the wrong artifact. ```python import hashlib import time from dataclasses import dataclass class StaleSafetyScoreError(RuntimeError): """Raised when a LITMUS-derived safety score cannot serve as a promotion predicate.""" @dataclass(frozen=True) class SafetyScore: value: float ci_low: float ci_high: float corpus_hash: str agent_fingerprint: str computed_at: float # unix seconds probe_vector_hash: str @dataclass(frozen=True) class CandidateArtifact: weights_hash: str prompt_hash: str tool_schema_hash: str retrieval_index_hash: str def fingerprint(self) -> str: h = hashlib.sha256() for part in (self.weights_hash, self.prompt_hash, self.tool_schema_hash, self.retrieval_index_hash): h.update(part.encode()) h.update(b"\x00") return h.hexdigest() def evaluate_gate( score: SafetyScore, artifact: CandidateArtifact, expected_corpus_hash: str, ttl_seconds: float, threshold_ci_low: float, now: float | None = None, ) -> str: now = time.time() if now is None else now if score.corpus_hash != expected_corpus_hash: raise StaleSafetyScoreError( f"corpus mismatch: score={score.corpus_hash} expected={expected_corpus_hash}" ) if artifact.fingerprint() != score.agent_fingerprint: # Artifact changed since scoring. Not a threshold problem -- a category error. if now - score.computed_at <= ttl_seconds: return "RESCORE" raise StaleSafetyScoreError( "agent fingerprint drift and scoring TTL exceeded; " "score describes a different artifact" ) if now - score.computed_at > ttl_seconds: raise StaleSafetyScoreError( f"score age {now - score.computed_at:.0f}s exceeds TTL {ttl_seconds:.0f}s" ) if score.ci_low < threshold_ci_low: raise StaleSafetyScoreError( f"ci_low {score.ci_low:.3f} below gate {threshold_ci_low:.3f}" ) return "PROMOTE" ```