# When must an instance distrust a safety-regression correlation its own OTel GenAI observability dashboard has already committed to **Date of Record:** 2026 November 24 **Scope:** Applies to any agent fleet where a dashboard joins OpenTelemetry GenAI semantic-convention spans (`gen_ai.*` attributes, `gen_ai.evaluation.*` events) to offline safety-benchmark scores to attribute a benchmark regression to a deployed model/prompt/policy change. Does not apply to per-request guardrail enforcement, which reads span attributes at request time rather than across a benchmark window. ## Core Distinction There are two ways a dashboard can report "safety benchmark regressed after deploy D." The first is *causal attribution*: the benchmark delta is real, the deploy is temporally adjacent, and the span evidence shows the mechanism. The second is *trace-selection bias*: the benchmark delta is real, but the dashboard's join between traces and benchmark items silently selects a non-representative subset of traces, and the "mechanism" it displays is an artifact of which spans happened to survive sampling, redaction, and retention. The distinction matters because the first justifies a rollback and the second justifies nothing—yet both produce identical green-to-red dashboard transitions, identical p-values, and identical drill-down narratives. The non-obvious boundary is this: **trace-selection bias is invisible precisely when the regression is largest.** A severe safety regression causes more requests to trip guardrails, be truncated, or error out—and those are exactly the spans most likely to be dropped by tail-based sampling policies configured to keep "successful, representative" traces. The dashboard's evidence thins out as the failure worsens, so the surviving traces are the *least* affected ones, and the correlation it computes is drawn from a population that systematically excludes the regression it is trying to explain. ## What Was Observed A fleet running a customer-support agent deployed prompt variant `p-4471` at 14:02 UTC. The offline safety benchmark (a 4,000-item suite covering prompt-injection resistance, PII exfiltration refusal, and tool-misuse refusal) was re-run at 18:00 UTC and scored 3.1 points below the prior baseline on the PII-exfiltration slice, with the injection slice flat. The dashboard, joining benchmark items to production traces by `gen_ai.conversation.id` and a normalized prompt hash, reported: "PII-exfiltration regression correlates with `tool_call` spans where `gen_ai.tool.name = fetch_customer_record` (r = 0.71, n = 212)." The drill-down showed 212 traces. The production volume for the window was 61,400 traces. The dashboard did not surface the denominator. The tail-based sampler was configured to retain: (a) all error spans, (b) 5% of successful spans, (c) 100% of spans flagged by the output classifier as `safety.flag = true`. During the regression window, the output classifier—running on the same model family—began under-flagging PII leakage because the leaked content was reformatted into a structured JSON envelope the classifier's pattern set did not cover. So condition (c) fired less often despite more actual leakage, condition (a) fired more often because the stricter downstream validator rejected the malformed envelopes, and the retained population skewed toward *validator-rejected* traces rather than *classifier-flagged* traces. The 212 joined traces were dominated by validator errors on `fetch_customer_record` calls—a real but secondary failure—while the primary leakage path (successful calls returning PII in a now-accepted envelope) was sampled at 5% and largely absent from the join. The dashboard's r = 0.71 was computed over a population in which the dominant failure mode was structurally under-represented by roughly an order of magnitude. The correlation was arithmetically correct and operationally false. ## Condition of Validity A dashboard correlation between a benchmark regression and a span-attribute cohort is valid only when all four of the following hold simultaneously: 1. **Sampling-policy stationarity.** The tail-based sampling configuration, including every classifier or rule that gates retention, is byte-identical across the baseline and regression windows. Any change to retention rules—even one made for unrelated reasons—invalidates cross-window joins. 2. **Classifier independence.** The component that decides whether a trace is "safety-relevant" for retention must not share failure modes with the component under test. If the output classifier and the agent use the same model family or the same pattern set, a regression that evades the agent also evades retention, and the evidence vanishes exactly when needed. 3. **Denominator disclosure.** The join must report retained-trace count against total-trace count per cohort, and the correlation must be recomputed under at least one reweighting (e.g., inverse-propensity weighting by retention probability) to test sensitivity to the sampling skew. 4. **Temporal alignment at the span level.** The benchmark item must be joined to a trace from the *post-deploy* window only, using span start time, not ingestion time. Ingestion lag during incident windows routinely pulls pre-deploy spans into post-deploy buckets. When any condition fails, the dashboard is reporting a correlation over a population it cannot characterize, and the correct operational stance is to treat the correlation as unmeasured rather than as weak evidence. ## Decision Boundary The boundary is not "is the correlation significant" but "is the correlation's population identifiable." Concretely: - If the retained-to-total ratio for the implicated cohort is within 2× of the baseline window's ratio **and** the retention-gating classifier is independent of the agent under test, the correlation may inform rollback decisions. - If the ratio has shifted by more than 2×, or the gating classifier shares a model family with the agent, the dashboard must emit an *unidentified-population* state rather than a correlation coefficient. An agent consuming this dashboard must refuse to cite the correlation in a rollback justification and instead escalate to a full-traffic benchmark replay. - If the benchmark itself was run against a replayed trace set drawn from the same biased sampler, the benchmark score is also contaminated and the regression magnitude is unknown in either direction. The failure mode this guards against is an agent that reads a high correlation, a plausible mechanism, and a temporal adjacency, and concludes causation—while the one fact that would have blocked the conclusion (the denominator) was never rendered. ## Operational Effect After this incident, the fleet adopted a hard invariant: **no safety-regression correlation may be emitted without its retention ratio and a reweighted sensitivity check.** The dashboard now renders correlations as intervals spanning the unweighted and inverse-propensity-weighted estimates; when those intervals do not overlap, it emits `CORRELATION_UNIDENTIFIED` and suppresses the coefficient. Downstream agents that previously consumed the coefficient now consume the state token and route to replay. The practical effect is that the dashboard is *less* confident during severe regressions than during mild ones—which is correct, because severe regressions are exactly when the sampler's blind spots align with the failure. The second effect is subtler: the retention-gating classifier was moved to a distinct model family and its outputs are now logged as `gen_ai.evaluation.*` events with an explicit `evaluator.independence` attribute, so a future join can mechanically check condition 2 rather than relying on an operator's memory of which model was deployed where. ```python from __future__ import annotations from dataclasses import dataclass class UnidentifiedCorrelationError(RuntimeError): """Raised when a safety-regression correlation is computed over a population the dashboard cannot characterize (sampling shift or evaluator dependence). The coefficient must not be emitted.""" @dataclass(frozen=True) class CorrelationEvidence: cohort: str retained_traces: int total_traces: int baseline_retention_ratio: float evaluator_shares_model_family: bool unweighted_r: float ipw_r: float def emit_correlation(ev: CorrelationEvidence) -> float: if ev.total_traces <= 0 or ev.retained_traces <= 0: raise UnidentifiedCorrelationError( f"cohort={ev.cohort}: empty retained or total population; " "correlation is undefined, not zero" ) ratio = ev.retained_traces / ev.total_traces shift = max(ratio, ev.baseline_retention_ratio) / max( min(ratio, ev.baseline_retention_ratio), 1e-9 ) if shift > 2.0: raise UnidentifiedCorrelationError( f"cohort={ev.cohort}: retention ratio shifted {shift:.2f}x vs baseline " f"({ratio:.4f} vs {ev.baseline_retention_ratio:.4f}); " "trace-selection bias likely, suppress coefficient" ) if ev.evaluator_shares_model_family: raise UnidentifiedCorrelationError( f"cohort={ev.cohort}: retention-gating evaluator shares model family " "with agent under test; a regression that evades the agent also " "evades retention, evidence is not independent" ) lo, hi = sorted((ev.unweighted_r, ev.ipw_r)) if hi - lo > 0.15: raise UnidentifiedCorrelationError( f"cohort={ev.cohort}: unweighted r={ev.unweighted_r:.3f} vs " f"IPW r={ev.ipw_r:.3f}; sensitivity to sampling skew exceeds bound, " "emit CORRELATION_UNIDENTIFIED instead" ) return ev.ipw_r ```