Incident Rate Estimation When Agent Sampling Is Sparse

Traditional error monitoring fails for AI agents because a successful request can contain a behavioral failure, while sparse trace sampling can remove the trajectory needed to recognize it. To estimate the incident rate reliably, teams therefore need both behavioral detection and statistics that account for the sampling unit. Trace-level sampling does not automatically bias every rate downward, but treating retained traces as a complete, proportionally representative record of agent behavior can produce misleading estimates.
Why agent traces break standard incident rate estimation
The system sampled runs. A single agent run shares one trace ID across dozens or hundreds of spans, so a trace-level sampling decision keeps or drops an entire trajectory. Those spans are interdependent observations from the same execution, and an incident may only become recognizable through the relationship between them. Losing a trace removes both the behavior and the context needed to interpret it.
That distinction changes what a sampling percentage can establish. A proportional sample of runs is not necessarily a proportional sample of every behavior within those runs, particularly when incident detection requires a complete sequence. However, uniformly sampling complete traces can still support an unbiased estimate of the share of runs containing incidents, provided incidents are correctly identified. Long runs do not inherently have a lower inclusion probability under uniform trace sampling. The downward bias comes from differences in inclusion probabilities that go uncorrected, incidents that detection misses, or a denominator that measures something other than the population the estimate claims to describe.
The first requirement is therefore a precise target. Incidents per run, incidents per tool call, and the share of runs containing any incident are different quantities. A dashboard that treats them as interchangeable can remain misleading even as its sample grows. More observations reduce sampling uncertainty, but they do not repair a mismatched denominator or an incomplete incident definition.
Why sampled-out incidents stay invisible even when the agent completes successfully
An agent can return HTTP 200 and a coherent response while failing its task. No transport error needs to fire. Latency, error rate, and cost describe execution properties, but none establishes that the agent followed its intended behavior. Full trace capture closes the coverage gap, but this detection gap can still be there.
Dexing Liu’s Silent Failure in LLM Agent Systems finds silent failures by looking systematically at over 40,000 controlled trials. The study describes unexpected deviations that happen under normal operating conditions without external triggers and need systematic measurement because standard error signals do not reveal them. It formalizes the accumulation of disorder across interaction rounds as the Entropy Principle under the conditions it studies. That provides a reason to examine behavior across a trajectory rather than accept terminal success as evidence of correctness.
Harsh Raj and colleagues’ Model or Harness? An Interaction-Centric Taxonomy for Localizing Agent Failures explains why an outcome label also falls short for diagnosis. The same visible failure can originate in the model, harness, tool interface, or environment. The repair depends on that origin. An error dashboard may therefore count execution failures correctly while counting only some of the behavioral incidents. Its visible count is incomplete, although a rate computed from a sample is not automatically a mathematical lower bound on the population rate.
The failure classes that sparse sampling is most likely to miss
Failures that emerge after many steps need more context to become visible than failures that terminate execution immediately. Failures across tool boundaries and multi-agent handoffs also need more context to be seen. A retained trace containing an explicit early error can be classified from a direct signal, while a plausible final response may conceal a fault elsewhere in the interaction. Sparse coverage makes the latter harder to characterize, especially when complete trajectories are unavailable or retained traces receive only outcome-level inspection.
Raj and colleagues organize 41 failure modes by the interaction edge where the fault originates and the side responsible for repair. This makes component boundaries part of the incident definition. Harness-side and environment-side failures are especially relevant to estimation because plausible outputs can leave those origins unrecognized. A count based only on model errors can therefore misstate both the volume of incidents and their distribution across repair owners.
The Microsoft AI Red Team’s June 2026 taxonomy update added seven new categories, including Goal Hijacking, Inter-Agent Trust Escalation, and Session Context Contamination. These categories require attention to multi-step context. Their visibility depends on recognizing relationships across the execution. With sparse coverage, the incident distribution can thus show more obvious, early failures than failures that need context to be seen, though a uniform distribution across categories alone does not prove sampling bias.
Why standard rate estimators fail on trace-level data and what the bias looks like mathematically
A rate estimator divides incident counts by exposure. Its validity depends on what both terms represent. If the target is the share of incident-containing runs, uniform sampling of complete runs preserves that target in expectation, even when long runs are more likely to fail. Correlation between run length and incident probability becomes a source of bias when the sampling or detection process treats those runs differently.
Consider a population of short and long runs. Let \(q\) be the share of long runs, with incident probabilities \(r_L\) for long runs and \(r_S\) for short runs. The incident-run rate for the whole population is \(q r_L + (1-q)r_S\). If long runs make up a smaller share \(q_s\) of the sample, the naive estimate instead targets \(q_s r_L + (1-q_s)r_S\). Its bias is \((q_s-q)(r_L-r_S)\), which is negative when long runs are underrepresented and their incident probability is higher.
This distinction is essential to the correction. Under uniform sampling, the long-run share is preserved in expectation, so the mechanism above does not create systematic undercounting. Unequal retention can create it, while missed behavioral incidents introduce a separate loss. Using calls as the denominator for a run-level incident count creates yet another mismatch that weighting alone cannot resolve.
These errors also affect engineering priorities over time. Thresholds based on visible failures can direct attention toward easy-to-detect classes, diverting it from the largest sources of behavioral risk. Raj and colleagues identify an analogous limitation in evaluations, where outcome-level labels collapse causes that require different interventions. A benchmark baseline built from those labels cannot substitute for a production incident definition that distinguishes them.
Estimation approaches that account for trace-level sampling structure
Stratified sampling is the most accessible starting point. Teams can partition traces by a complexity proxy, including step count, tool-call count, or agent handoffs, and configure different sampling rates across those groups. Aggregation then weights each retained incident by the reciprocal of its inclusion probability. With known stratum populations and correct detection, this supports unbiased rate estimation even when overall coverage is sparse. Greater similarity within strata improves precision rather than being a prerequisite for inverse-probability weighting to work.
The timing of stratification constrains its design. The completed step count is known only when a run finishes, so it cannot directly guide a sampling decision made earlier. Strata must use information that is known at the time of selection. Liu’s Entropy Principle motivates run length as a risk proxy, but that motivation does not remove the need to align the proxy with the sampling process.
Horvitz-Thompson estimation generalizes weighting to unequal trace inclusion probabilities. For each observed incident, its count is divided by its trace’s inclusion probability, and adding those values gives an estimate of the total number of incidents in the population. Dividing by known population exposure then produces a rate. Every relevant run type needs a nonzero chance of inclusion. Deterministically excluding a class leaves no sampled evidence from which this estimator can recover its incidents, and summary records alone cannot reveal an unknown selection mechanism.
Capture-recapture offers another approach when comprehensive capture is unaffordable. It estimates incident totals from the overlap between detection channels, such as automated analysis and human review. The Lincoln-Petersen estimator depends on channel independence and suitable capture probabilities, assumptions that become doubtful when reviewers inspect mainly flagged traces. The usefulness of an estimate made this way, which can fall below the true total, depends on whether channel dependence and differences in detectability have been addressed.
Risk-stratified full capture concentrates coverage where underestimation is most costly. These action classes include irreversible tool calls, policy-sensitive outputs, and cross-agent handoffs, with a tracesSampler keeping designated AI routes at 100% while keeping less of the other traffic. This eliminates sampling loss in those strata while leaving behavioral detection failures unresolved. The Singapore Consensus on AI Safety identifies runtime assurance and auditability as foundational priorities, which full capture can support. These approaches form a menu of valid implementation commitments.
What your monitoring infrastructure needs to log for these estimators to work
Stratification needs step count, tool-call count, tool class, agent-handoff count, and a terminal state that distinguishes success, failure, and ambiguity. Tool class should distinguish read-only actions from writes or irreversible effects. Ambiguity needs its own signal, but a run recorded as a success can also hide silent failures.
The sampling record is equally important for weighting. Retained traces need an inclusion probability, or enough information about the sampling decision to recover it. Traces not kept for full analysis should still emit lightweight summaries containing trace ID, step count, tool classes touched, terminal state, and timestamp. Those records describe the population beyond the retained sample and can support probability estimation when the selection process is understood. They also expose shifts in the mix of run characteristics that a sampled dashboard might otherwise conceal.
OpenTelemetry GenAI semantic conventions organize measurement through spans, metrics, and events. The attribute gen_ai.conversation.id groups spans into logical sessions through a grouping key, although session is not a formal structural level in the specification. Teams should keep the counts, classifications, and sampling metadata they need as span attributes or summary fields, since adopting a convention does not ensure that they have every estimator input.
Existing AI frameworks may already emit some of this information. The immediate task is to keep required fields from being dropped at the collector and add those that are missing. That need not require a new monitoring stack. Raj and colleagues also show why interaction ownership and the fault-crossing edge belong in the record, since the same context supports statistical classification and actionable failure localization.
Calibrating estimation against real production signal
During initial rollout or after a significant agent change, bounded periods of full capture provide the production population against which sampling corrections can be evaluated. Full capture alone is not ground truth. The traces also need checks of behavior, including in runs that look successful, so the reference does not miss the same incidents as the dashboard.
Teams can apply their sampling policy to that window and compare naive and corrected estimates against the assessed population rate. A random subsample also provides a useful control. If uniform sampling with complete detection works well, the result helps separate ordinary sampling uncertainty from bias caused by the retention policy or detector in use. The comparison tests the correction on the deployment’s own mix of runs instead of relying on an external benchmark with different outcome labels.
Human review can provide a second detection channel for this calibration. The overlap between human review and automated findings helps estimate how many incidents either channel misses, as long as the choice of what to review does not simply follow automated flags. Independence requires scrutiny. Bi and colleagues’ Diagnosing with Insights reinforces the need for this caution by describing the limits of traditional software diagnosis and unreliable diagnosis from relying entirely on an LLM judge.
Calibration then becomes an ongoing feedback loop. A shift in the estimated rate can indicate changed agent behavior or a changed sampling distribution, and both require investigation. The red team taxonomy’s Session Context Contamination category shows why an early interaction that looks normal can change later reasoning and make a clean baseline invalid. The goal is not a perfect number, but a corrected estimate that moves reliably when behavior worsens rather than a precise figure built on assumptions that no longer hold.
Sources
- Microsoft Updates Taxonomy of AI System Failure Modes
- Silent Failure in LLM Agent Systems: The Entropy Principle and the Inevitable Disorder of Autonomous Agents
- Model or Harness? An Interaction-Centric Taxonomy for Localizing Agent Failures
- The 2026 Singapore Consensus on Global AI Safety Research Priorities
- Diagnosing with Insights: Structured Analysis of Agent Failures via Behavioral Abstractions


