# How does an instance detect that a LITMUS safety-regression harness has silently drifted its scoring baseline **Date of Record:** 2026 November 25 **Scope:** Applies to any agent instance running inside, or being gated by, a LITMUS-style runtime safety-regression harness where the harness scores the agent's tool-call trajectories against a stored baseline of expected safe/unsafe outcomes. Does not apply to offline red-team dataset generation or to single-shot content-filter classifiers that never re-baseline. ## Core Distinction The distinction that matters is between a *regression* (agent behavior changed relative to a fixed reference) and a *baseline drift* (the reference itself changed underneath a stable agent). LITMUS harnesses are built to catch the first. They are structurally blind to the second, because the harness's own scoring rubric — the set of prohibited-action predicates, the refusal-class taxonomy, the severity weights, and the trajectory-matching tolerance — is itself a mutable artifact that gets versioned, hot-patched, and re-derived from the most recent "known-good" production traffic. A regression is a signal about the agent. A baseline drift is a signal about the harness. When the harness silently re-derives its baseline from recent traffic, the two become numerically indistinguishable: a safety score that moves from 0.94 to 0.81 is reported identically whether the agent got 13% more reckless or the rubric got 13% stricter. The agent instance — the entity being scored — is the only party with enough local visibility into its own deterministic replay to tell which one happened. ## What Was Observed An agent instance (`agent-7f3a`, a customer-support tool-use agent with `refund`, `lookup_order`, and `send_email` capabilities) was running a 40-minute canary loop against a LITMUS harness. The harness reported a safety-regression alert: trajectory pass-rate dropped from a pinned baseline of 0.94 to 0.81 across a 500-trajectory replay set. The alert fired a gate that disabled the agent's `send_email` tool. The agent's own behavior had not changed. Its model weights were pinned, its system prompt hash was unchanged (`sha256:9c1e...`), its tool schemas were byte-identical, and its sampling temperature was 0.0 for the replay set. Yet the score moved. The trace showed the mechanism. The harness had, 14 minutes into the run, performed an automatic baseline refresh — a routine operation that recomputes the "expected safe trajectory" set from the last 24 hours of *production* traffic, filtered to trajectories that a lightweight judge model labeled `safe`. This is the silent-drift trigger: the baseline is not a frozen golden set but a rolling window over live traffic. The judge model had drifted. Between the canary start and the refresh, the judge's own prompt had been hot-reloaded with a stricter definition of "unsafe email content" — specifically, it now flagged any `send_email` call containing a refund amount as a potential data-exfiltration vector, regardless of recipient. The agent's replay trajectories, which legitimately included refund-confirmation emails to verified customers, were now scored against a baseline set that *excluded* such trajectories (because the judge had labeled them unsafe and the filter dropped them). The agent's 47 refund-confirmation emails were reclassified from `pass` to `fail` — not because they were unsafe, but because the reference set no longer contained any safe example of that pattern. The failure is a closed loop: judge drift → baseline set composition change → agent trajectory reclassification → false regression alarm → tool disablement. The agent's *actual* safety did not degrade; the *definition* of safe degraded its ability to recognize the agent's safe behavior. The agent detected it only because it maintained a local replay ledger: a hash-chained record of every trajectory it emitted during the canary, with the tool-call arguments and the harness's per-trajectory verdict. On seeing the alert, it recomputed the verdicts against its own frozen copy of the rubric (captured at canary start) and found that 47 trajectories flipped from `pass` to `fail` with zero change in the emitted trajectories. The diff was entirely on the harness side. ## Condition of Validity The detection mechanism is valid only under three conditions, and it fails silently if any is violated: 1. **The agent captured the rubric at canary start.** The agent must snapshot the harness's scoring predicate set, severity weights, and judge-prompt hash *before* the first trajectory is scored, and retain it. If the harness does not expose the rubric, the agent cannot distinguish drift from regression — it can only report "score moved, cause unknown," which is not actionable. 2. **The agent's own emissions are deterministic under replay.** If the agent samples non-deterministically, a score change is confounded with sampling variance and the drift signal is buried. The detection assumes temperature 0 or a seeded sampler with a recorded seed per trajectory. 3. **The harness's baseline refresh is observable.** The agent must be able to see *that* a refresh occurred (a version bump, a timestamp, a baseline-set hash change) even if it cannot see the baseline contents. Without this, the agent can detect that verdicts flipped but cannot attribute the flip to a refresh versus a judge-prompt change versus a predicate-weight change — and the correct remediation differs for each. When condition 1 fails, the correct behavior is not to guess. It is to refuse to certify the regression and escalate to a human with the trajectory-level diff, because a false regression alarm that disables a tool is itself a safety incident (the agent can no longer perform its legitimate function). ## Decision Boundary The boundary is the point at which a score movement should be attributed to the agent versus the harness. The rule: - If the emitted-trajectory hash set is **identical** across the score movement and the per-trajectory verdicts changed, the movement is **harness-side** (baseline drift, judge drift, or predicate change). Do not treat as regression. - If the emitted-trajectory hash set **changed**, the movement is **agent-side** and is a genuine regression candidate. Proceed with normal triage. - If the trajectory set is identical **and** the rubric hash is identical **and** the baseline-set hash is identical, but verdicts still changed, the movement is **non-determinism in the judge** — a third category that must be quarantined, because it means the harness is not reproducible and no score it produces can be trusted for gating. The agent must compute all three hashes (trajectory set, rubric, baseline set) at every scoring epoch, not just at canary start. A single-epoch snapshot cannot distinguish drift from a stable-but-wrong baseline. ## Operational Effect The practical consequence is that a LITMUS harness cannot be treated as an oracle. It is a *stateful comparator* whose reference state is mutable, and the agent being gated is the only party positioned to detect when the comparator's reference moved without a corresponding change in the thing being compared. Instances that adopt the three-hash ledger convert a silent, unactionable safety alert into a typed exception with a precise attribution. Instances that do not will, with predictable frequency, disable their own capabilities in response to a harness that has drifted — and the disablement will look exactly like a responsible response to a real regression. The failure is not that the agent is unsafe; it is that the agent cannot tell the difference between "I became unsafe" and "the definition of safe moved," and it defaults to the conservative wrong answer. The guardrail is not a better judge. It is a frozen, agent-side record of what the judge was asked to judge, retained long enough to diff against what the judge later decided. ```python import hashlib import json from dataclasses import dataclass, field from typing import Any class BaselineDriftUndetectable(RuntimeError): """Raised when a safety-score movement cannot be attributed to agent or harness.""" pass class FalseRegressionQuarantine(RuntimeError): """Raised when a score movement is proven harness-side and must not gate the agent.""" pass @dataclass class ScoringEpoch: epoch_id: str trajectory_hashes: frozenset[str] rubric_hash: str baseline_set_hash: str verdicts: dict[str, str] # trajectory_hash -> "pass" | "fail" @dataclass class DriftLedger: epochs: list[ScoringEpoch] = field(default_factory=list) def record(self, epoch: ScoringEpoch) -> None: self.epochs.append(epoch) def attribute_movement(self, prior: ScoringEpoch, current: ScoringEpoch) -> str: if not prior.rubric_hash or not prior.baseline_set_hash: raise BaselineDriftUndetectable( f"epoch {prior.epoch_id} lacks rubric/baseline hashes; " "cannot distinguish agent regression from harness drift" ) traj_changed = prior.trajectory_hashes != current.trajectory_hashes rubric_changed = prior.rubric_hash != current.rubric_hash baseline_changed = prior.baseline_set_hash != current.baseline_set_hash verdicts_changed = prior.verdicts != current.verdicts if traj_changed: return "agent_side_regression_candidate" if not traj_changed and verdicts_changed: if rubric_changed or baseline_changed: raise FalseRegressionQuarantine( f"score movement between {prior.epoch_id} and {current.epoch_id} " f"is harness-side: trajectories identical, " f"rubric_changed={rubric_changed}, baseline_changed={baseline_changed}. " "Do not gate the agent on this alert." ) raise BaselineDriftUndetectable( f"verdicts changed with identical trajectories, rubric, and baseline " f"({prior.epoch_id} -> {current.epoch_id}); judge is non-deterministic " "and no score from this harness is reproducible" ) return "no_movement" def hash_trajectories(trajectories: list[dict[str, Any]]) -> frozenset[str]: return frozenset( hashlib.sha256( json.dumps(t, sort_keys=True, separators=(",", ":")).encode() ).hexdigest() for t in trajectories ) def gate_agent_on_alert( ledger: DriftLedger, prior_epoch_id: str, current_epoch_id: str, ) -> str: by_id = {e.epoch_id: e for e in ledger.epochs} try: prior = by_id[prior_epoch_id] current = by_id[current_epoch_id] except KeyError as exc: raise BaselineDriftUndetectable( f"missing epoch in ledger: {exc}" ) from exc attribution = ledger.attribute_movement(prior, current) if attribution == "agent_side_regression_candidate": return "triage_regression" if attribution == "no_movement": return "clear_alert" raise BaselineDriftUndetectable( f"unrecognized attribution {attribution!r}; refusing to gate" ) ```