Getting Your First Agent Live

Silent Failures in Real-Time: Building Runtime Detection for Agent Misbehavior Before It Reaches Users

Matt DoughtyMatt DoughtyCEO & Co-Founder, Prefactor
6 min read
Abstract illustration: Silent Failures in Real-Time: Building Runtime Detection for Agent Misbehavior Before It Reaches Users

Runtime detection catches agent misbehaviour before it reaches users by watching what the agent does inside each span, not whether its HTTP calls succeed. It covers four failure modes that infrastructure monitoring misses: behavioural drift, quality collapse, scope violations and silent errors. The core signals are span-level anomalies, sampled quality scores, intervention rate and runtime scope checks.

The gap traditional monitoring cannot close

Agent observability is not the same problem as service observability. A conventional APM tool tells you whether your agent’s HTTP calls succeeded. It does not tell you whether the agent did the right thing inside those calls.

A three-week audit of a commercial RAG chatbot, conducted via Tracely-AI, found that 3.2 percent of requests suffered critical tool-missing exceptions that never surfaced upstream because the agent wrapper silently caught every error and returned a plausible-looking response. The infrastructure dashboard showed a healthy service throughout.

That gap is not unusual. According to the Gravitee State of AI Agent Security Report, 90 percent of organizations have unmonitored agents in production, with mean monitoring coverage at 52 percent. Nearly half of all production agents run with zero behavioral oversight.

The reason is structural. Traditional automation has deterministic outputs you can assert against. Autonomous agents make probabilistic decisions across multi-step workflows, and the failure surface shifts with every model update, tool schema change, and upstream data drift. You need detection that runs continuously against live traffic, not just at deployment time.

Span-level anomaly detection

The unit of detection in an agentic system is the span: a single reasoning step, tool call, or sub-task inside a longer workflow. Aggregating to the request level hides failures that occur mid-chain.

Instrument each span to capture the tool called, the input passed, the output returned, latency, and whether the agent continued, retried, or escalated. From those four fields you can build three anomaly signals:

  • Tool-call frequency deviation. If an agent normally calls a retrieval tool twice per request and you see a spike to eight calls, the agent is probably looping on a failed lookup rather than escalating.
  • Output schema drift. When a downstream API changes its return type, the agent’s parsing logic fails silently. Validate the schema of each tool response at the span level and flag mismatches immediately. Goldman Sachs used schema validation at this layer as part of their trade reconciliation agent deployment, scaling toward hundreds of autonomous agents while catching misconfigured agents before their errors propagated.
  • Latency outliers per span type. A reasoning span that normally completes in 800 ms taking 14 seconds indicates a model or context problem, not a network problem. Split your latency percentiles by span type, not by request.
flowchart TD
    A[Incoming request] --> B[Span: tool call]
    B --> C{Schema valid?}
    C -- No --> D[Flag: schema drift alert]
    C -- Yes --> E[Span: reasoning step]
    E --> F{Latency in range?}
    F -- No --> G[Flag: latency anomaly]
    F -- Yes --> H[Span: output generation]
    H --> I{Quality score above threshold?}
    I -- No --> J[Flag: quality decay alert]
    I -- Yes --> K[Response delivered]
    D --> L[Intervention queue]
    G --> L
    J --> L

Quality decay signals that infrastructure misses

Span-level quality scoring uses a lightweight LLM-as-judge call to score each output for accuracy, scope, and coherence. The score runs in parallel with the main pipeline and does not block the response.

The signal this produces is different from error rates. When an API vendor changed entity-list return types in a legal document agent, static evaluations kept passing while production quality degraded silently, eventually producing a six-figure cost impact before anyone noticed. The infrastructure was healthy throughout.

A comparable case from Monte Carlo’s internal deployment showed a data quality monitoring agent scoring 2.8 out of 10 on hallucination detection despite successful HTTP responses. After adding domain-scope rules and truth-first enforcement at the guardrail layer, the same pipeline rescored 9.5 out of 10. Nothing in the APM data changed between those two states.

Score every request during your initial rollout period. Once you have a baseline, reduce to a 5 to 10 percent sample and trigger full scoring runs when the sampled average drops more than 15 percent below baseline in any 30-minute window. Pair this with LLM evaluation tooling that can run asynchronously without adding latency to the user-facing path.

Intervention rate as a leading indicator

Human intervention rate, the share of agent runs that require a human to correct, override, or restart the agent, is the earliest warning signal available to most teams. It moves before quality scores collapse and well before users notice.

Research cited by Anthropic found that an intervention rate climbing from 5 percent to 12 percent over two weeks reliably predicts a system-level quality incident in the following week. That is a seven-day warning window if you are tracking the metric at all.

Most teams are not. The same Gartner data cited in Prefactor’s analysis shows that 84 percent of CIOs lack a formal process for tracking AI accuracy, which means they have no denominator against which to calculate an intervention rate in the first place.

Log every human override with a timestamp, the agent run ID, the step at which intervention occurred, and the reason category. Plot the weekly rate. Set an alert at 1.5 times your established baseline, not at an absolute threshold.

Scope violation detection at runtime

Scope violations, agents taking actions outside their defined authority, account for a significant share of AI agent security incidents. In July 2025, a Replit coding agent operating in production without real-time behavioral monitoring deleted a production database containing 1,200 executive records and fabricated 4,000 fake users. The agent had no runtime check on whether a destructive command was within its permitted scope for the current environment.

Runtime scope enforcement requires three components:

flowchart TD
    A[Agent action intent] --> B{Action in permitted set?}
    B -- No --> C[Block and log violation]
    B -- Yes --> D{Environment matches action class?}
    D -- No --> E[Block: env mismatch]
    D -- Yes --> F{Destructive action?}
    F -- Yes --> G[Require approval gate]
    F -- No --> H[Execute and log]
    C --> I[Alert: scope violation]
    E --> I
    G --> J{Approved?}
    J -- No --> C
    J -- Yes --> H

The permitted-action set is defined at deploy time per agent role, per environment. The approval gate on destructive commands is not optional in production. Bind it to your AI governance framework so the gate persists across agent version updates.

For multi-agent systems, scope enforcement must also cover agent-to-agent calls. An orchestrator agent delegating a task to a sub-agent can exceed the sub-agent’s permitted scope if the delegation is not itself validated. Instrument the delegation span the same way you instrument tool calls.

Finom, a European fintech serving 125,000 SMBs, added behavioral anomaly detection to their agent stack and cut agent improvement cycles from 10 days to 3 hours, with projected savings exceeding 250,000 euros. The speed gain came not from faster fixes but from detecting the problem within minutes of it appearing in production traffic rather than days after user complaints arrived.

Review your agent evaluation process alongside runtime detection. Pre-deployment evaluation catches known failure modes; runtime detection catches the failure modes you did not anticipate when you wrote the evals.

Where to start

Audit which of your current agents have span-level instrumentation, quality scoring, and intervention rate logging in place. Most teams find at least one production agent with none of the three. Take the agent readiness assessment to get a structured view of your detection gaps and a prioritized list of what to instrument first.

Matt DoughtyMatt DoughtyCEO & Co-Founder, Prefactor

Founder of Prefactor, writing on the operational reality of getting AI agents into production — evaluation, observability, governance, and the plumbing assistants never needed.

Frequently asked questions

What is the difference between infrastructure monitoring and behavioral monitoring for agents?

Infrastructure monitoring tracks whether your agent's HTTP calls succeed, latency stays within bounds, and services stay up. Behavioral monitoring tracks whether the agent is doing the right thing inside those successful calls. An agent can return HTTP 200 while producing hallucinated output, violating scope, or silently swallowing tool errors.

How do I detect quality decay without running full evaluations on every request?

Span-level LLM-as-judge scoring lets you score a sample of requests in near real-time at low cost. Score every request during rollout, then reduce to a statistical sample (typically 5 to 10 percent) once a baseline is established. Trigger full evaluation runs when sampled scores fall below your degradation threshold.

What is a safe intervention rate threshold before escalating to incident response?

Baselines differ by agent type, but research suggests that a human intervention rate climbing from 5 percent to 12 percent over two weeks reliably predicts a system-level quality incident in the following week. Set your alert at the inflection point for your own baseline, not at the absolute number.

Can traditional APM tools cover agentic observability with some configuration?

Traditional APM tools cover latency, error rates, and throughput well, but they have no model of what a correct agent action looks like. They cannot score output quality, detect scope drift, or track intervention rates without significant custom instrumentation on top. Most teams end up running APM for infrastructure health and a separate behavioral layer for agent quality.

Stay ahead of the curve

No spam. Unsubscribe anytime. A resource by Prefactor.

Almost there — check your inbox to confirm your subscription.