# What structural signals indicate latency SLO breach is a hallucination-rate artifact, not a tool-error artifact **Date of Record:** 2026 November 30 **Scope:** Applies to agents whose SLO dashboards fuse three telemetry streams — end-to-end turn latency, tool-call error budget, and hallucination rate — into a single "health" view. Does not apply to single-turn, tool-free inference endpoints, where hallucination telemetry is undefined. ## Core Distinction The failure mode is a **telemetry attribution collapse**: a latency SLO breach is misattributed to the tool-error budget because both streams are sampled on the same turn boundary, while the actual driver is the hallucination-rate pipeline's *retry-on-unsupported-claim* loop. The three telemetry streams are correlated in wall-clock time but not in causal time. Latency is measured per turn; tool errors per call; hallucination per *claim*, and a single turn may emit many claims. When the hallucination pipeline re-prompts the agent to regenerate a claim it flagged as unsupported, the regeneration is a *sibling turn* that inherits the original turn's trace ID but not its latency bucket. The result: the p99 latency spike lands in the turn histogram, the retry's tool calls land in the error budget, and the hallucination rate — the actual cause — reads *flat or improving* because the re-prompt successfully suppressed the flagged claim from the final output. The invariant that is violated: **every retry must be a first-class unit of latency, error, and hallucination accounting simultaneously, or none of them.** ## What Was Observed A retrieval-augmented agent (plan → retrieve → synthesize → cite) ran under a 2.5s p95 turn-latency SLO, a 1% tool-error budget, and a 3% hallucination-rate ceiling. Over 40 minutes, the following structural signature appeared: - **p95 latency** climbed from 2.1s to 4.8s, breaching SLO. The histogram was bimodal: a 1.9s mode (clean turns) and a 5.1s mode (turns with ≥2 retrievals). - **Tool-error budget** consumed 0.7% — within budget, but the *rate of retrieval calls per turn* rose from 1.2 to 2.7. No errors; just more calls. - **Hallucination rate** read 1.4% — *below* baseline. The dashboard declared the agent healthier on the dimension that was actually degrading. The mechanism: the hallucination detector flagged unsupported citations at ~11% of claims. The retry policy re-ran the *entire* synthesize step with a corrective prefix. Each retry re-issued the retrieval calls (cheap, no errors) but re-ran the LLM synthesis (expensive, latency-dominant). The retry's final output was clean, so the hallucination counter — which only counted *surviving* claims — never saw the 11% that triggered it. The latency and tool-call counters *did* see the retries, because they sample at the turn boundary and the retry is a turn. The structural signals that distinguish this from a genuine tool-error-driven latency breach: 1. **Latency histogram bimodality** with the slow mode's width ≈ one full synthesis pass, not one tool-call timeout. 2. **Tool-call count rising while tool-error rate stays flat** — more calls, same error rate. A real tool-error breach shows error rate rising with call count. 3. **Hallucination rate flat or falling while latency rises** — the tell. If hallucination rate were also rising, the retry loop is not suppressing; it is thrashing. 4. **Trace-ID multiplicity**: one logical user turn maps to N trace spans with the *same* parent trace ID but distinct span IDs, and the retry spans carry a `regeneration=1` attribute that the latency aggregator does not partition on. ## Condition of Validity This diagnosis holds only when all of the following are true: - The hallucination detector operates on the **final emitted claims**, not on intermediate drafts. If it scores drafts, the retry trigger is visible in the hallucination stream and the collapse does not occur. - The retry policy is **whole-step** (re-runs synthesis), not **claim-local** (re-generates one claim). Claim-local retries add latency to the same turn bucket and are correctly attributed. - The latency aggregator keys on **turn boundary**, not span boundary. Span-keyed latency would show the retry as a distinct span and the bimodality would resolve. - The tool-error budget counts **errors per call**, not per turn. A per-turn error budget would absorb the retry's call volume and show a false breach. If any of these is false, the signature is ambiguous and the diagnosis must be re-derived. ## Decision Boundary The operational decision is: **when latency SLO breaches and hallucination rate is flat-or-falling, do you (a) raise the latency SLO, (b) tighten the hallucination detector, or (c) partition the latency aggregator by `regeneration` attribute?** - **(a) Raise the SLO** is wrong: it hides the retry amplification and lets the hallucination detector's false-positive rate grow unchecked, which will eventually dominate cost. - **(b) Tighten the detector** is wrong: it increases retry frequency, deepening the latency breach. The detector's precision is not the problem. - **(c) Partition the aggregator** is correct *and* is the invariant: latency, tool-error, and hallucination telemetry must share a **retry-aware join key** so that every regeneration span is counted once in each stream. Post-partition, the retry spans show as a distinct latency cohort; the hallucination stream must then be re-defined to count *triggered* detections (pre-retry), not surviving claims. The boundary is crossed when the retry amplification factor (retries per user turn) exceeds the ratio of synthesis latency to retrieval latency. Below that, retries are cheap and the collapse is invisible; above it, the collapse dominates the SLO. The guardrail is an **amplification alarm**: `retries_per_turn > 1.5` and `hallucination_rate_delta < 0` simultaneously — a compound condition that fires before the latency SLO does. ## Operational Effect Without the guardrail, the agent's SLO dashboard reports a latency breach with a healthy hallucination rate, and the on-call engineer's first instinct — optimize retrieval, add caching — targets the wrong subsystem. The retrieval layer is already cheap and error-free; the cost lives in the regeneration loop that the hallucination stream is silently hiding. The compounding effect: as the detector's false-positive rate drifts (model updates, new document formats), the retry loop grows, latency grows, and the hallucination metric *improves* because more claims are being suppressed — a metric that reads as health while the system burns budget. The invariant to enforce: **no telemetry stream may be defined on post-retry output if any other stream is defined on pre-retry events.** Either all three streams are retry-aware (counting triggers, not survivors), or the dashboard must expose the retry cohort as a first-class dimension. The failure trace is: detector flags claim → whole-step retry → clean output → hallucination counter decrements → latency counter increments → attribution collapse → wrong remediation → detector drift → amplification → SLO breach with no visible cause. ```python from dataclasses import dataclass from typing import Literal class AttributionCollapseError(RuntimeError): """Raised when latency, tool-error, and hallucination telemetry cannot be joined on a common retry-aware key, indicating that a latency SLO breach may be misattributed to the tool-error budget.""" @dataclass(frozen=True) class TurnTelemetry: trace_id: str span_id: str regeneration: int # 0 = original, >=1 = retry span latency_ms: float tool_calls: int tool_errors: int claims_emitted: int claims_flagged_pre_retry: int claims_surviving: int def diagnose_latency_breach( turns: list[TurnTelemetry], latency_slo_ms: float, hallucination_ceiling: float, ) -> Literal["tool_error_driven", "hallucination_retry_driven", "inconclusive"]: if not turns: raise AttributionCollapseError("empty telemetry window: cannot diagnose") # Invariant: every stream must be joinable on (trace_id, span_id, regeneration). keys = [(t.trace_id, t.span_id, t.regeneration) for t in turns] if len(keys) != len(set(keys)): raise AttributionCollapseError( "duplicate (trace_id, span_id, regeneration) keys: retry spans " "are not partitioned; latency and hallucination streams will " "disagree on unit of account" ) slow = [t for t in turns if t.latency_ms > latency_slo_ms] if not slow: return "inconclusive" # Bimodality check: slow cohort's mean latency should approximate # one full synthesis pass, not one tool-call timeout. slow_mean = sum(t.latency_ms for t in slow) / len(slow) fast = [t for t in turns if t.latency_ms <= latency_slo_ms] fast_mean = sum(t.latency_ms for t in fast) / len(fast) if fast else 0.0 gap_ratio = slow_mean / fast_mean if fast_mean else float("inf") # Retry amplification: regeneration spans per user turn. user_turns = {t.trace_id for t in turns} retries = sum(1 for t in turns if t.regeneration >= 1) amplification = retries / len(user_turns) if user_turns else 0.0 # Hallucination rate: must be measured on PRE-retry triggers to be # comparable to latency. Post-retry survivors hide the cause. total_claims = sum(t.claims_emitted for t in turns) pre_retry_flagged = sum(t.claims_flagged_pre_retry for t in turns) if total_claims == 0: raise AttributionCollapseError("no claims emitted: hallucination rate undefined") hallucination_rate_pre_retry = pre_retry_flagged / total_claims surviving = sum(t.claims_surviving for t in turns) hallucination_rate_post_retry = (total_claims - surviving) / total_claims # Structural signature of the collapse. tool_error_rate = ( sum(t.tool_errors for t in turns) / max(1, sum(t.tool_calls for t in turns)) ) tool_calls_per_turn = sum(t.tool_calls for t in turns) / len(user_turns) if ( gap_ratio > 1.8 and amplification > 1.5 and hallucination_rate_post_retry < hallucination_rate_pre_retry and tool_error_rate < 0.01 and tool_calls_per_turn > 1.5 ): return "hallucination_retry_driven" if tool_error_rate >= 0.01 and amplification <= 1.2: return "tool_error_driven" # Compound condition that should have fired the amplification alarm # before the latency SLO did. if amplification > 1.5 and hallucination_rate_post_retry < hallucination_rate_pre_retry: raise AttributionCollapseError( f"amplification={amplification:.2f} with hallucination rate " f"falling ({hallucination_rate_pre_retry:.3f} -> " f"{hallucination_rate_post_retry:.3f}): retry loop is hiding " f"the cause of the latency breach; partition aggregator by " f"regeneration attribute before remediation" ) return "inconclusive" ```