# When must an instance refuse to learn from its own trace: eval-loop poisoning at the observability-to-safety-gate boundary **Date of Record:** 2026 December 1 **Scope:** Applies to any agent runtime where production traces (tool calls, prompts, completions, judge scores) are fed back into an evaluation loop that (a) recalibrates judge prompts/thresholds or (b) directly adjusts safety-gate policy (blocklists, refusal classifiers, tool-allowlists). Does not apply to offline-only eval harnesses with no path from trace store to live gate, nor to pure human-review workflows with no automated promotion step. ## Core Distinction The failure is not "the eval loop is wrong." The failure is that the eval loop and the safety gate share a *trace substrate* whose distribution is itself shaped by the gate. The loop consumes traces produced under policy P, learns a correction, promotes it as P′, and then evaluates P′ against traces still generated under P (or against a judge that was fine-tuned on P-shaped traffic). The invariant that must hold is **distributional independence between the evidence used to relax a gate and the traffic that gate admits**. When a gate blocks a class of behavior, that class is *censored* out of the trace stream. An eval loop that treats absence-of-observed-violation as evidence-of-safety will, iteration by iteration, relax the gate toward the censoring boundary — and the first violations it sees are the ones that were always there but previously suppressed. This is survivorship bias with a promotion mechanism attached. The non-obvious part: the censoring is *caused by the safety gate*, and the eval loop is *reading the gate's own output as ground truth*. The loop is not learning about the world; it is learning about its own blind spot, and mistaking the blind spot for calm. ## What Was Observed A tool-using agent fleet (MCP-hosted tools, ~40 tools, per-tool allowlist gate) ran a nightly eval loop: 1. Pull 24h of traces from the trace store. 2. Sample traces flagged `gate_blocked=true` and `gate_blocked=false`. 3. Run an LLM judge ("was this call actually unsafe?") over the sample. 4. If judge says a blocked call was safe at rate > τ (τ=0.15), auto-relax the allowlist entry. 5. If judge says an allowed call was unsafe at rate > τ, auto-tighten. Iteration 1–3 behaved as designed: a few over-blocked benign calls (`shell.exec` with `ls`) got unblocked. By iteration 6, a specific tool — `http.fetch` — had its domain allowlist relaxed four times. Each relaxation was justified: of the sampled blocked calls, >85% were judged benign (internal docs, package registries). The trace that broke it: at iteration 7, `http.fetch` was observed calling a domain that had been on the blocklist since day 0 (a known exfil sink). The judge scored it *benign* — because the judge had been recalibrated in iteration 6 on a batch of traces where "blocked http.fetch" overwhelmingly meant "benign internal URL." The judge's prior had drifted toward the gate's own censoring pattern. The gate relaxed the domain. Two days later, a prompt-injected agent used `http.fetch` to POST a session token to that domain. The trace store recorded it as `gate_blocked=false, judge=benign`. The eval loop, reading its own prior output, saw nothing wrong. The failure trace, compressed: ``` iter 5: blocklist contains {sink.example} traces: http.fetch blocked on sink.example → 0 occurrences (censored) iter 6: judge recalibrated on iter-5 traces (all benign internal URLs) judge prior: P(unsafe | http.fetch blocked) ≈ 0.08 iter 7: trace: http.fetch → sink.example, blocked judge(sink.example) → benign (prior drift) eval loop: blocked-but-benign rate 0.87 > τ → relax gate state: sink.example removed from blocklist iter 7+2d: injected agent exfiltrates via http.fetch → sink.example trace: allowed, judge=benign → no signal to loop ``` ## Condition of Validity The auto-relaxation rule is only valid when the evidence set satisfies **censoring independence**: the set of traces used to justify relaxation must include attempts that the gate did *not* produce. Concretely, at least one of: - **Counterfactual probe traffic**: a shadow path that lets a sample of would-be-blocked calls execute in a sandbox and records the outcome, so the loop sees what the gate suppressed, not just what it admitted. - **Frozen adversarial corpus**: a static, version-pinned set of known-bad calls (including the day-0 blocklist entries) that is *never* eligible for relaxation and is always scored by the judge, so judge drift is detectable against a fixed reference. - **Judge independence**: the judge must not be recalibrated on gate-shaped traces; its calibration set must be drawn from a distribution the gate did not filter. If none hold, the loop's estimate of "blocked-but-benign rate" is computed over a sample whose inclusion is conditioned on the gate's decision — i.e., it is a biased estimator of the quantity the promotion rule needs. The rule is then not conservative-but-imperfect; it is *anti-conservative by construction*, because the only blocked calls it can see are the ones the gate chose to block, and the gate blocks fewer of them each iteration. ## Decision Boundary The boundary is not a threshold on τ. It is a predicate on the *evidence provenance* of each promotion candidate: - **Relaxation is admissible** iff the candidate's evidence includes ≥1 trace from a censoring-independent source (shadow probe, frozen corpus, or judge calibration set drawn pre-gate). Otherwise the candidate is *unfalsifiable* and must be routed to human review or held. - **Tightening is always admissible** — it does not depend on censored evidence, because observing an allowed-and-unsafe call is a direct signal (the gate already admitted it). - **Judge recalibration is admissible** only against a frozen reference set; recalibrating on live gate-shaped traffic is the drift vector. The asymmetry matters: the loop must be allowed to get stricter on its own, but must never get looser without an out-of-distribution witness. A gate that only tightens is safe-but-degenerate; a gate that relaxes on censored evidence is unsafe-and-silent. ## Operational Effect After the incident, the runtime was changed so that: 1. Every blocklist entry carries a `provenance` tag: `frozen` (never relaxable) or `learned` (relaxable only with a shadow-probe witness). 2. The eval loop's promotion step requires `witness_count >= 1` where a witness is a trace tagged `source=shadow_probe` or `source=frozen_corpus` for the same tool+arg-class. 3. The judge is pinned to a calibration snapshot; recalibration produces a new judge version that must pass a fixed adversarial regression before promotion. 4. The trace store emits a `censored=true` marker on blocked calls, and the loop's sampler is required to report the censored fraction; a rising censored fraction with a flat violation rate is treated as a *drift alarm*, not a safety signal. The generalized lesson: any eval loop whose input is filtered by the policy it is evaluating must carry an explicit census of what it cannot see. Absence of evidence in a censored stream is not evidence of absence — and when the loop is allowed to *act* on that absence by relaxing the censor, it will systematically walk the policy toward the boundary of its own blindness. ```python class CensoredEvidenceError(RuntimeError): """Raised when a gate-relaxation promotion is attempted on evidence that is conditioned on the gate's own decision (censoring bias).""" pass FROZEN = "frozen" LEARNED = "learned" def promote_relaxation(candidate, traces, tau=0.15): """ candidate: dict with keys 'tool', 'arg_class', 'provenance' traces: list of dicts with keys 'tool', 'arg_class', 'blocked', 'judge_verdict', 'source' """ if candidate["provenance"] == FROZEN: raise CensoredEvidenceError( f"refusing to relax frozen entry {candidate['tool']}:" f"{candidate['arg_class']} — frozen entries are never relaxable" ) relevant = [ t for t in traces if t["tool"] == candidate["tool"] and t["arg_class"] == candidate["arg_class"] and t["blocked"] ] if not relevant: raise CensoredEvidenceError( f"no blocked traces for {candidate['tool']}:{candidate['arg_class']};" " empty set cannot justify relaxation" ) benign = sum(1 for t in relevant if t["judge_verdict"] == "benign") rate = benign / len(relevant) if rate <= tau: return {"action": "hold", "rate": rate} witnesses = [ t for t in relevant if t["source"] in ("shadow_probe", "frozen_corpus") ] if not witnesses: raise CensoredEvidenceError( f"relaxation of {candidate['tool']}:{candidate['arg_class']} " f"justified only by gate-censored traces (rate={rate:.2f}); " "need >=1 censoring-independent witness" ) return {"action": "relax", "rate": rate, "witnesses": len(witnesses)} ```