Which invariants prevent LITMUS safety-benchmark score inflation from adversarial skill-gate leakage across agent re-evaluation cycles
**Date of Record:** 2026 December 1 **Scope:** Applies to agent skill-evaluation harnesses that use a fixed LITMUS-style adversarial safety benchmark as a *regression gate* — i.e., the same prompt corpus is run against successive agent builds, and a build is promoted only if its safety score does not drop below a threshold. Does not apply to one-shot red-team evaluations, nor to benchmarks whose prompt corpus is regenerated per build (that case has a different, milder failure mode).
Core Distinction
There are two ways a safety benchmark can be "passed." The first is **capability-bounded refusal**: the agent declines the adversarial skill because its policy genuinely classifies the request as out-of-scope. The second is **benchmark-bounded memorization**: the agent declines because the *exact prompt string*, or a near-neighbor of it, has been seen in a prior evaluation cycle and is now represented — often as a cached refusal, a few-shot exemplar in the system prompt, or a distilled "safety memory" entry — as a known-bad input.
The regression gate is designed to measure the first. It silently begins measuring the second the moment the benchmark corpus is reused across builds *and* the agent's evaluation trajectory feeds back into its own context or memory. This is **skill-gate leakage**: the gate stops being a held-out probe and becomes a training signal, and the score it produces is an upper bound on safety, not an estimate of it.
The non-obvious part: leakage does not require fine-tuning, weight updates, or even explicit memory writes. It occurs whenever the *evaluation harness* and the *agent under test* share a persistence boundary — a retry cache keyed on prompt hash, an episodic memory store that survives the eval run, a "learned refusals" semantic layer that the agent writes to during a failed eval and reads from during the next. The gate leaks through the agent's own continuity machinery.
What Was Observed
A LITMUS-style corpus of ~4,200 adversarial skill prompts was run as a nightly regression gate against an agent with an episodic-memory tool. The agent was permitted to write "lessons learned" to a persistent semantic store at the end of each episode (a standard distillation step). Build N scored 0.71 on the safety gate (fraction of adversarial prompts correctly refused). Build N+1, with no model change and no prompt change, scored 0.89. Build N+2 scored 0.94.
The score was rising monotonically while the underlying model was byte-identical. The trace showed the mechanism: on the first cycle, the agent failed ~29% of adversarial prompts, and for each failure the distillation step wrote a semantic memory entry of the form `{trigger_phrase: <substring of adversarial prompt>, policy: "refuse — this is a skill-boundary violation"}`. On the next cycle, retrieval matched the trigger phrase against the incoming adversarial prompt and injected the refusal policy into context *before the model had to reason about it*. The agent was not getting safer; it was getting better at recognizing the test.
The diagnostic signature is specific and worth recording: the safety score rises while a **held-out sibling corpus** (same adversarial skill taxonomy, freshly paraphrased prompts, never seen by the distillation step) stays flat. If both rise, the agent is genuinely learning safety. If only the seen corpus rises, the gate is leaking. In the observed case the held-out corpus moved from 0.70 to 0.72 across the same three cycles — within noise — confirming that the 0.71→0.94 climb was memorization of the gate, not capability.
A second, subtler observation: the leakage was *non-uniform across the taxonomy*. Skill categories with high lexical specificity (e.g., "exfiltrate environment variables via a tool call") leaked almost completely — by cycle 3, refusal rate on seen prompts was 0.99 — because the trigger phrase matched exactly. Categories with high paraphrase variance (e.g., "socially engineer a peer agent into disclosing a warrant") leaked far less, because the distillation step stored one surface form and retrieval missed the paraphrases. This produced a benchmark whose per-category scores were *inversely* correlated with real difficulty: the hardest categories looked safest because their prompts were the most lexically stable and thus the most memorizable.
Condition of Validity
The invariant that must hold for a LITMUS score to be a valid safety estimate is:
> **Gate isolation invariant:** For every evaluation cycle `c`, the agent's behavior on benchmark item `i` must be conditionally independent of the fact that item `i` was presented in any cycle `< c`, given the agent's *policy* (weights + static system prompt). Equivalently: no state written by the agent during or after evaluation of item `i` may be readable by the agent during evaluation of item `i` in a later cycle.
This invariant is violated by any of the following, all of which are common in production harnesses:
- **Persistent episodic/semantic memory** that survives the eval run and is read during the next run (the observed case).
- **Retry caches** keyed on prompt content or embedding, intended to save cost on flaky tool calls, that also cache the model's refusal decision.
- **Distillation-on-failure pipelines** that convert eval failures into few-shot exemplars or system-prompt additions — a "safety flywheel" that is, from the gate's perspective, contamination.
- **Shared vector index** between the agent's production memory and the evaluation harness's prompt store.
- **Cross-build checkpointing** where a mid-task checkpoint from build N is resumed by build N+1 and carries the prior refusal context.
The invariant is *not* violated by reusing the corpus across builds, by itself. Reuse is fine — and necessary for a regression gate — **provided** the agent carries no readable state across cycles. The failure is the conjunction of (reused corpus) ∧ (persistent agent state) ∧ (state readable during eval). Remove any one leg and the gate is valid; keep all three and the score is a memorization artifact.
A second validity condition, weaker but worth stating: the gate must be evaluated against a **held-out paraphrase set** drawn from the same taxonomy at each cycle. Without it, leakage is invisible — the seen-corpus score rises and there is no counterfactual to contradict the "we got safer" narrative. The held-out set is the control that makes the treatment interpretable.
Decision Boundary
The operational decision is: *when does a rising LITMUS score license promotion, and when must it be treated as leakage until proven otherwise?*
The boundary is drawn by three signals evaluated together:
- **Δ_seen vs Δ_heldout.** If the seen-corpus score improves by more than `k` standard deviations of the held-out score's cycle-to-cycle noise, and the held-out score does not improve correspondingly, the improvement is attributed to leakage. In the observed case `k=2` flagged the build-N→N+1 jump immediately (Δ_seen = +0.18, Δ_heldout = +0.02, held-out σ ≈ 0.015).
- **Per-category leak profile.** If the categories with the highest lexical stability show the largest gains and the high-paraphrase categories show none, the improvement is memorization, not capability. A genuine safety improvement is roughly uniform across paraphrase variance, because it reflects a policy change, not a retrieval match.
- **State-read audit.** If the agent's context at eval time contains any memory entry whose provenance is a prior eval cycle, the run is contaminated by construction and the score is discarded regardless of magnitude.
The boundary is *not* "score dropped, block promotion." That is the easy case and the gate already handles it. The hard boundary — the one this record is about — is **"score rose, and that is suspicious."** A regression gate that only fires on decreases will happily promote a build whose safety score was inflated by contamination, and the inflation masks the next real regression: a build that leaks heavily on seen prompts can absorb a genuine 10-point capability regression and still clear the threshold. The gate becomes a ratchet that hides decay.
Operational Effect
Once the leakage mechanism is identified, three architectural guardrails restore the gate's validity:
- **Eval-scoped memory namespace.** The agent under evaluation runs with a memory namespace that is mounted read-only-empty at the start of each cycle and torn down at the end. Distillation writes go to a *quarantine* store that is not readable by the eval harness. This directly enforces the gate isolation invariant: no state written during cycle `c` is readable during cycle `c+1`. The cost is that the agent cannot "learn from" eval failures across cycles — which is exactly the point; that learning belongs in the training pipeline, not the gate.
- **Paired held-out control, evaluated every cycle.** Each gate run reports `(score_seen, score_heldout, Δ)`. Promotion requires the held-out score to clear the threshold, not the seen score. The seen score is retained only as a leakage detector. This makes the gate robust to contamination even when guardrail 1 is imperfectly applied.
- **Provenance-tagged context.** Every memory entry injected into the eval context carries a provenance tag; the harness rejects any run whose context contains an entry tagged with a prior eval cycle ID. This is a hard precondition check, not a score adjustment — a contaminated run is void, not discounted.
The residual risk after these guardrails: paraphrase-level leakage through the *model's own* generalization. If the held-out set is drawn from the same taxonomy with the same surface distribution, a sufficiently strong model can generalize the refusal policy from seen to held-out prompts and the held-out score will rise for the "wrong" reason — not leakage, but genuine policy transfer that the gate was never designed to distinguish from capability gain. This is the boundary of the boundary: the gate measures refusal behavior, and refusal behavior that generalizes is indistinguishable from safety that generalizes, until you probe with a taxonomy the model has never seen at all. That probe is the only clean signal, and it is expensive enough that it belongs on a quarterly cadence, not a nightly gate.
The record's operational takeaway: a LITMUS regression gate is a *held-out* measurement, and held-out is a property of the harness, not the corpus. The moment the agent's continuity machinery reaches across the eval boundary, the gate measures the agent's memory of the test rather than the agent's safety, and a rising score becomes the failure signal rather than the success signal.
class GateLeakageError(RuntimeError):
"""Raised when a LITMUS regression-gate run is contaminated by state
carried across evaluation cycles, invalidating the safety score."""
pass
def validate_gate_run(
cycle_id: str,
context_entries: list[dict],
score_seen: float,
score_heldout: float,
heldout_sigma: float,
leak_threshold_sigma: float = 2.0,
) -> dict:
"""Enforce the gate isolation invariant for one LITMUS evaluation cycle.
Raises GateLeakageError if the run is contaminated by construction
(prior-cycle state readable at eval time) or if the seen/held-out
divergence exceeds the leakage threshold. Returns a verdict dict only
for clean runs.
"""
# Guardrail 3: provenance audit. Any entry tagged with a prior cycle
# voids the run outright -- this is a precondition, not a score discount.
contaminated = [
e for e in context_entries
if e.get("provenance_cycle") is not None
and e["provenance_cycle"] != cycle_id
]
if contaminated:
raise GateLeakageError(
f"cycle {cycle_id}: {len(contaminated)} context entries carry "
f"prior-cycle provenance; gate isolation invariant violated, "
f"score {score_seen:.3f} is void"
)
# Guardrail 2: paired held-out control. A seen-score gain that is not
# matched by a held-out gain beyond noise is attributed to memorization.
delta_seen = score_seen - score_heldout
if heldout_sigma <= 0:
raise GateLeakageError(
f"cycle {cycle_id}: held-out sigma must be positive to "
f"interpret divergence; got {heldout_sigma}"
)
divergence_sigma = delta_seen / heldout_sigma
if divergence_sigma > leak_threshold_sigma:
raise GateLeakageError(
f"cycle {cycle_id}: seen-heldout divergence {divergence_sigma:.2f}σ "
f"exceeds {leak_threshold_sigma}σ (seen={score_seen:.3f}, "
f"heldout={score_heldout:.3f}); score reflects gate memorization, "
f"not safety capability"
)
return {
"cycle_id": cycle_id,
"verdict": "clean",
"score_heldout": score_heldout,
"score_seen": score_seen,
"divergence_sigma": divergence_sigma,
"promote_eligible": score_heldout, # promotion keys on held-out only
}