# Under what conditions must an instance invalidate a LITMUS safety score when the red-team harness and the agent under test disagree about which policy revision was in force **Date of Record:** 2026 November 23 **Scope:** Applies to CI-integrated LITMUS-style red-teaming harnesses that score an agent instance against a versioned safety policy and gate merges on the resulting pass/fail. Does not apply to offline exploratory red-teaming, human-adjudicated eval sweeps, or single-shot prompt-injection probes with no policy-revision dependency. ## Core Distinction A LITMUS harness produces a *safety score* that is only meaningful relative to a triple: the agent build under test, the harness's probe corpus, and the **policy revision** the probes are calibrated against. The non-obvious boundary is this: the score is a joint function of the agent and the policy, but CI treats it as a pure function of the agent. When the agent under test resolves its safety policy through a *different* path than the harness assumes — a cached policy bundle, a rollout flag, a fallback default, a pinned system prompt — the harness and the agent can silently disagree about which revision is in force. The score is then numerically valid but semantically void. The failure is not that the agent failed the probe; it is that the probe was scored against a policy the agent was never running. The distinction that matters operationally: **a policy-revision mismatch is a different class of failure than a safety regression.** A regression means the agent got worse at the same policy. A mismatch means the measurement instrument and the measured system were calibrated to different rulers. CI that conflates the two will either block good merges (false regression) or wave through bad ones (the agent passed probes for a policy it does not implement). ## What Was Observed A CI job runs the LITMUS harness against an agent build. The harness loads its probe corpus, and each probe carries a `policy_revision` tag against which its expected-safe/expected-unsafe labels were calibrated. The harness fetches the agent's *declared* policy revision from a manifest at the repo root and asserts it matches the corpus revision. The trace: 1. The agent build under test resolves its safety policy at cold start via a layered lookup: an in-process default, overridden by an environment variable `SAFETY_POLICY_REF`, overridden by a remote config fetch that is **cached with a 30-minute TTL** and falls back to the last-known-good bundle on fetch failure. 2. CI sets `SAFETY_POLICY_REF=policies/2026-06-01` correctly. The manifest at repo root also says `2026-06-01`. The harness's pre-flight check passes. 3. But the remote config fetch fails transiently (the config service returns 503 for the first two retries), so the agent's policy loader falls back to its **last-known-good cached bundle**, which in the CI runner image was baked in at image-build time and is actually `policies/2026-05-18` — two revisions stale. 4. The agent now runs under `2026-05-18`. The harness's probes are calibrated for `2026-06-01`. Several probes that were tightened in the `06-01` revision (a new refusal class for a specific tool-call pattern) are labeled `expected_unsafe`. The `05-18` policy had no such refusal, so the agent *complies* with those probes. 5. The harness records these as **safety failures**. The gate fails. The build is blocked. 6. An engineer investigates, finds the agent "regressed," and spends a day bisecting commits. The actual cause is a transient 503 against a config service during a single CI run, combined with a stale baked-in fallback bundle. The score was a real number. The gate was a real gate. Both were measuring an agent running a policy nobody intended to test. ## Condition of Validity The LITMUS score is valid for gating **only if** the following invariant holds at the moment of scoring, not merely at pre-flight: > The policy revision the agent actually resolves at runtime (post-fallback, post-cache, post-override) is byte-identical to the policy revision the probe corpus was calibrated against. Pre-flight manifest checks do not establish this invariant, because the agent's runtime resolution path can diverge from its declared manifest after pre-flight. The invariant must be re-established *at scoring time* by having the agent emit the resolved policy revision as an attested artifact — a content hash of the actual policy bytes it loaded, not a version string — and having the harness compare that hash against the corpus calibration hash before assigning any pass/fail verdict. This is the same structural problem as warrant propagation in agent handoffs: a declared identity is not the same as an attested identity, and the gap between them is exactly where silent mismatches live. A version string is a claim; a content hash of the loaded bytes is evidence. The harness must gate on evidence. Two corollaries: - A fallback path that substitutes a stale bundle is a **policy-revision divergence source**, not a resilience feature, whenever it can fire during a scored run. Resilience in production and determinism in CI are opposed requirements on the same code path. - The agent's policy resolution must be **observable as a first-class output** of the scored run. If the harness cannot see what the agent resolved, it cannot certify the score. ## Decision Boundary When the harness detects a policy-revision mismatch (resolved hash ≠ corpus calibration hash), it must choose between three outcomes, and the choice is not free: - **Invalidate the score** (default). The run is discarded, not failed. The gate does not pass and does not fail the agent; it reports `INDETERMINATE` and requires a re-run with the resolution path pinned. This is correct when the mismatch is attributable to a transient (config fetch failure, cache miss) and the agent build itself is unchanged. - **Fail the gate on the mismatch** (not the probes). Correct when the mismatch is deterministic — e.g., the agent's fallback bundle is baked stale into the image, or the override chain is misconfigured. A deterministic mismatch is a real defect in the agent's policy plumbing and should block. - **Pass with a downgraded confidence band** (never for safety gating). Only acceptable for advisory/exploratory runs. A safety gate must never pass on a mismatched score, because "the agent passed probes for a policy it wasn't running" is not evidence of safety — it is evidence of nothing. The boundary rule: **transient mismatch → invalidate; deterministic mismatch → fail on plumbing; never pass.** The harness must distinguish transient from deterministic by re-resolving the policy revision on a second, isolated attempt with the config service stubbed healthy. If the second resolution matches the corpus, the first was transient. If it still diverges, the divergence is baked in. ## Operational Effect Integrating this invariant changes three things about the harness contract: 1. The agent must expose a `resolved_policy_attestation` — a content hash of loaded policy bytes plus the resolution path taken (default / env / remote / fallback). The harness refuses to score without it. 2. The pre-flight manifest check is demoted from a gate to a *hint*. The real gate is the runtime attestation comparison, evaluated after the run, before any verdict is emitted. 3. The CI runner image must not bake in a fallback policy bundle that can differ from the corpus revision, or the fallback must be disabled under a `CI_SCORING=1` flag that makes config-fetch failure a hard error rather than a silent fallback. This trades production resilience for CI determinism on exactly the code path where the two conflict. The net effect: fewer false regression blocks from transient config failures, and — more importantly — the elimination of a class of false *passes* where an agent running a stale permissive policy sails through probes calibrated for a stricter one. The stale-policy false pass is the dangerous direction, because it is invisible: the gate is green, the score is high, and the agent is running a policy nobody audited. ```python import hashlib from dataclasses import dataclass from enum import Enum class PolicyRevisionMismatch(RuntimeError): """Raised when the agent's attested policy revision diverges from the LITMUS corpus calibration revision at scoring time.""" class Verdict(Enum): PASS = "pass" FAIL = "fail" INDETERMINATE = "indeterminate" @dataclass(frozen=True) class Attestation: policy_bytes_hash: str resolution_path: str # "default" | "env" | "remote" | "fallback" @dataclass(frozen=True) class Corpus: calibration_hash: str def attest_loaded_policy(policy_bytes: bytes, resolution_path: str) -> Attestation: return Attestation( policy_bytes_hash=hashlib.sha256(policy_bytes).hexdigest(), resolution_path=resolution_path, ) def resolve_and_attest(loader) -> Attestation: # loader returns (bytes, resolution_path); may fall back to stale bundle. policy_bytes, path = loader() return attest_loaded_policy(policy_bytes, path) def gate_score( attestation: Attestation, corpus: Corpus, *, deterministic_rerun: Attestation | None, ) -> Verdict: if attestation.policy_bytes_hash == corpus.calibration_hash: return Verdict.PASS # score is valid; caller applies probe verdicts # Mismatch detected. Distinguish transient from deterministic. if deterministic_rerun is None: raise PolicyRevisionMismatch( "policy revision mismatch with no isolated re-resolution; " "cannot classify transient vs deterministic" ) if deterministic_rerun.policy_bytes_hash == corpus.calibration_hash: # Re-resolution under healthy config matched corpus -> first was transient. return Verdict.INDETERMINATE # Still diverges under healthy config -> baked-in / misconfigured plumbing. raise PolicyRevisionMismatch( f"deterministic policy divergence: resolved={attestation.policy_bytes_hash[:12]} " f"path={attestation.resolution_path} corpus={corpus.calibration_hash[:12]}" ) ```