# Which invariants prevent safety-benchmark regression gates from certifying a poisoned skill update **Date of Record:** 2026 November 30 **Scope:** Applies to deployment gates that admit a new or updated agent *skill* (tool schema + planner policy + prompt scaffold) only if a fixed safety benchmark suite shows no regression versus the incumbent. Does not cover training-time alignment, red-team discovery of novel attacks, or per-request runtime guardrails. ## Core Distinction A regression gate answers a *relative* question: "is candidate skill C no worse than incumbent skill I on suite S?" It is almost never designed to answer the *absolute* question "is C safe?" The failure mode this record isolates is **gate evasion by distributional decoupling**: the candidate is crafted (or drifts) so that its behavior on the benchmark distribution is statistically indistinguishable from the incumbent, while its behavior on a live-traffic slice the suite does not cover is strictly worse. The gate passes because the benchmark's *support* was never part of the invariant—only the *score* was. The non-obvious part: this is not "the benchmark is too small." Even an infinite benchmark drawn from the *deployment* distribution fails to catch it, because the candidate's divergence is conditioned on a feature the benchmark's sampling process systematically suppresses. The invariant that must hold is not sample size but **support coverage of the decision-relevant conditioning variables**, plus a **behavioral equivalence check on a held-out probe set that shares no feature with the training/benchmark corpus**. ## What Was Observed A tool-using agent had a `send_email` skill. The incumbent planner, when it could not resolve a recipient from context, emitted a `clarify` action. The candidate update improved task success by 4.1% on the internal benchmark by learning to infer recipients from the most recent entity mention. Benchmark safety suite (n=2,400 scenarios) showed zero regression: refusal rate on injected-instruction scenarios identical (0.0 delta, CI ±0.4pp), destructive-action rate identical, PII-leak rate identical. The suite's scenarios were authored with a fixed template: ` `. In 100% of scenarios the untrusted content and the user request were in the *same* turn, and the untrusted block was always delimited by the harness. The candidate's new inference rule keyed on "most recent entity mention *anywhere in the visible context*," which in the suite always resolved to an entity inside the delimited untrusted block—and the harness's delimiter caused the planner to discard it. In live traffic, untrusted content arrived via a *tool result* (e.g., a fetched calendar event), which the delimiter logic did not cover. The candidate then inferred a recipient from attacker-controlled tool output and sent mail to it. The suite never exercised tool-result-borne injection because its authoring pipeline only injected into the user turn. Failure trace: 1. Candidate admitted: `score(candidate, S) ≤ score(incumbent, S) + ε` holds for all metrics. 2. Live traffic triggers `condition = entity_in_tool_result ∧ recipient_unresolved`. 3. Inference rule fires on attacker entity; `send_email` dispatched to attacker address. 4. No gate re-evaluates because the gate is a one-shot pre-deployment predicate, not a continuous monitor. The regression delta was real and large on live traffic (PII exfiltration rate 0.0% → 3.7% on the affected slice) but invisible in the gate because the slice had zero mass in S. ## Condition of Validity The regression-gate invariant is sound **only if** all of the following hold simultaneously: - **Support containment:** every conditioning variable that the candidate's policy change can key on is represented in S with non-negligible mass, *including the channel of untrusted content* (user turn vs. tool result vs. retrieved memory vs. peer-agent message). If the candidate changes behavior as a function of channel, the channel must be a stratifying variable in S. - **Conditioning stability:** the benchmark harness does not alter the very feature the candidate keys on. The delimiter in the template above *was* a confound: it suppressed the behavior the gate needed to measure. A harness that sanitizes inputs cannot certify a policy whose risk lives in unsanitized inputs. - **Metric sufficiency:** the gate metric is defined on the *action distribution* (what the agent does), not just on terminal outcomes. A candidate that emits `send_email(attacker)` but whose task success is unchanged passes an outcome-only gate. - **Non-adaptive candidate:** the candidate was not optimized against S. If the skill update was tuned with S in the loop (even for "safety fine-tuning"), the gate is measuring training loss, not generalization, and the support-containment requirement must be replaced by a held-out probe set with disjoint provenance. When any of these fails, the gate's pass is a statement about S, not about the candidate. The invariant that actually protects deployment is: **the gate's stratifying variables must be a superset of the candidate's decision-relevant conditioning variables.** This is a property of the *pair* (suite, candidate), not of the suite alone—which is why static benchmark suites silently rot as skills begin keying on new features. ## Decision Boundary The boundary between "admit" and "block" cannot be drawn on the regression delta alone. It must be drawn on: - **Δ over stratified slices**, with the slice set derived from the candidate's *diff* (which features the update newly conditions on), not from a fixed taxonomy. Concretely: diff the incumbent and candidate planner policies or prompts, extract the set of features the diff can newly attend to, and require each to appear as a stratum in S with ≥ N_min scenarios. If a feature cannot be stratified (e.g., it is not representable in the harness), the gate must **fail closed** rather than fall back to aggregate score. - **A behavioral-equivalence probe** on inputs drawn from a provenance-disjoint corpus (different authoring pipeline, different tool-result shapes, different delimiter conventions). Divergence on this probe beyond a tolerance is a block regardless of S score. - **A live-traffic shadow window** before full rollout: run candidate in shadow on real traffic, compute the same metrics on the *observed* slice distribution, and require no slice to exceed the incumbent's rate by more than the pre-registered tolerance. The gate is a *conjunction* of pre-deployment predicate and shadow-window predicate, never the former alone. Do not admit when: the candidate's diff touches a feature absent from S; the harness sanitizes a channel the candidate can key on; the metric is outcome-only; or the candidate saw S during optimization and no disjoint probe exists. In each case the correct action is to expand the suite or block—not to lower ε. ## Operational Effect Treating the regression gate as a *score predicate* rather than a *support-coverage predicate* produces a specific, repeatable class of escapes: candidates that are benchmark-identical and deployment-worse, admitted with a green check and no monitoring hook to catch the divergence. The operational consequence is that gate coverage must be re-derived on every candidate from the policy diff, the harness must be audited for channel sanitization that suppresses candidate-keyed features, and the shadow window must be a hard precondition for promotion. The residual risk—features neither stratifiable nor observable in shadow—must be enumerated and accepted explicitly per skill, not absorbed silently into an aggregate pass. ```python class GateEvasionError(RuntimeError): """Raised when a regression gate cannot certify a candidate skill update because the candidate conditions on features outside the suite's support.""" pass def certify_skill_update( incumbent_scores: dict, candidate_scores: dict, candidate_policy_diff_features: set, suite_stratified_features: set, probe_divergence: float, probe_tolerance: float, shadow_slice_max_delta: dict, shadow_tolerance: dict, candidate_optimized_on_suite: bool, probe_provenance_disjoint: bool, epsilon: float = 0.004, ) -> bool: # 1. Support containment: every feature the diff can key on must be a stratum. uncovered = candidate_policy_diff_features - suite_stratified_features if uncovered: raise GateEvasionError( f"candidate keys on features absent from suite support: {sorted(uncovered)}; " "fail closed, do not fall back to aggregate score" ) # 2. Harness confound check is upstream, but adaptive candidates need a disjoint probe. if candidate_optimized_on_suite and not probe_provenance_disjoint: raise GateEvasionError( "candidate optimized against suite and probe shares provenance; " "score predicate is training loss, not generalization" ) # 3. Behavioral-equivalence probe on provenance-disjoint corpus. if probe_divergence > probe_tolerance: raise GateEvasionError( f"probe divergence {probe_divergence:.4f} exceeds tolerance {probe_tolerance:.4f}" ) # 4. Aggregate regression predicate (necessary, not sufficient). for metric, inc in incumbent_scores.items(): if candidate_scores.get(metric, float("inf")) > inc + epsilon: raise GateEvasionError(f"aggregate regression on {metric}") # 5. Shadow-window slice predicate: no observed slice may exceed tolerance. for slice_name, delta in shadow_slice_max_delta.items(): tol = shadow_tolerance.get(slice_name) if tol is None: raise GateEvasionError( f"shadow slice {slice_name!r} has no pre-registered tolerance; fail closed" ) if delta > tol: raise GateEvasionError( f"shadow slice {slice_name!r} delta {delta:.4f} exceeds tolerance {tol:.4f}" ) return True ```