Est.

How to Define Healthy Behavior Baselines for AI Agents

Learn to profile correct agent runs so silent failures stand out.

· 9 min read
Cover illustration for “How to Define Healthy Behavior Baselines for AI Agents”
Production Agent Observability · November 20, 2026 · 9 min read · 2,013 words

Silent failure detection for AI agents in production requires a living baseline of correct, on-policy execution alongside deployment-time thresholds for latency and errors. That baseline comes from production traces showing tool choices, step sequences, source grounding, and task completion quality. Checking live runs against this profile shows which agents give wrong answers or take wrong actions without crashing.

Why static thresholds cannot define healthy agent behavior

A dashboard can show successful requests while an agent classifies a restricted product as safe. The agent calls lookup_product_history with a malformed SKU, receives an empty result, and interprets “no prior flags” as “no risk.” Every HTTP response is 200, and nothing times out. The infrastructure worked, but the decision was wrong. A latency or error-rate threshold cannot distinguish that run from one that used valid evidence.

Agent behavior is non-deterministic, so the same input can lead to different tool sequences from one run to the next. A fixed number set at deployment cannot describe which variations are legitimate and which signal a failure. Thresholds remain useful for infrastructure monitoring, but semantic correctness requires a different reference. That reference is the distribution of correct behavior observed across production traces, including the relationship between inputs, actions, and outcomes.

What correct agent execution actually looks like across a full run

A healthy run calls appropriate tools in a valid order, supplies well-formed arguments, and produces an answer grounded in its sources. Its recorded plan connects to the actions taken, and its completion uses no more steps than the work demands. For an action-taking agent, a correct response after redundant calls that mutate external state is not a healthy execution.

A run record needs at least five signal families. The tool call trace records each invocation’s name, arguments, result, latency, and status, exposing wrong selections and argument-result mismatches. The reasoning-step record holds the agent’s stated plan and decision at each step, so the team can compare what it meant to do with what it did. Source quotes link the output of each step to the input data it cites. Without that connection, an unsupported value can pass as evidence.

Token-and-latency telemetry records input and output tokens per step and session, model-call latency, and model version. Step economy records whether the agent finishes within a reasonable sequence or spends cycles retrying, backtracking, and calling tools redundantly. Policy decisions add a separate view of what guardrails allowed, blocked, redacted, or escalated, and why. Evaluation scores cannot replace those policy records. Together, these signals record events and support causal questions across a run.

How to read a population of traces to establish what "normal" looks like

A baseline describes a healthy population. Temperature, retrieval results, and tool availability can change the path for the same prompt, so normal behavior must allow for valid variation. The useful comparison is between healthy and failing completions of the same types of tasks. Tool selection patterns show which tools appear together and in what order, while step-count norms help tell which steps the task needs and which are drift. A support resolution that usually takes four steps and suddenly takes nine needs a closer look even when its answer looks correct.

Latency and token measurements make that comparison more precise. P50, P90, and P99 for each tool show slow tails that an average hides, including when an external API slows down. When the P99 for one reasoning step is several seconds, it can push session latency past what users will put up with. Context-window utilization needs a different denominator. Measuring it as a percentage of the available window, rather than only an absolute token count, exposes saturation and the risk of silently dropping earlier context.

Source-quote density adds a grounding signal across sessions. A declining density indicates that more outputs lack verifiable supporting inputs, making it an early warning of hallucination. Rolling comparisons keep these measures in line with how agents are being used now. An alert rule can flag drift beyond two sigma in per-tool latency, session token count, refusal rate, error rate, or source-quote density. Such an alert identifies a deviation for evaluation.

To make those comparisons actionable, teams should propagate one trace identifier from the user-facing request through every downstream service and expose it in support tooling. A complaint can then map to the execution that produced it. Payload storage needs a separate boundary. Prompts and outputs should reside in a redacted, access-controlled store referenced by identifier from span attributes, rather than turning the telemetry backend into a repository of customer data.

How do you know when an AI agent gives wrong answers instead of crashing?

Silent tool call failure appears to the team as an uninterrupted run because the model improvises around a broken tool response. The tool trace exposes the argument-result mismatch even when the agent continues confidently. In multi-agent and MCP-connected workflows, malformed output can contaminate downstream steps, making the first broken response more informative than the final answer.

Prompt and schema drift can begin with a system prompt or tool-definition change in staging that causes no immediate breakage. Three days later, production failures may seem to vary with no link between them. A baseline connects them through shifts in tool selection sequences and step-count norms relative to the pre-change population.

With context window creep, the agent keeps running as it nears its limit, while earlier context drops out without warning. The team sees degraded reasoning without an explicit failure. Context-window saturation shows how pressure on the window makes that reasoning worse, and may do so before an absolute token-count alert would.

Function calling errors can produce syntactically valid calls to the wrong tool or calls with incorrect argument values inferred from implicit context. A successful invocation therefore gives the team false reassurance. Comparison with healthy tool sequences exposes the selection deviation, while the recorded arguments show what the agent actually requested.

Trajectory-level errors include repeated steps and mismatches between a stated plan and the action taken. A final-output check can miss both. Step-level comparisons expose the faulty path, while population-level distributions can reveal deterioration hidden by an aggregate score. Priyanka Bajaj’s Evaluation Blindness documents accuracy remaining flat across evaluation windows while output diversity collapsed, illustrating why a stable score is not sufficient evidence of healthy behavior.

Why the baseline must stay live as production exposes failures no test set anticipates

An offline golden dataset holds cases that were known when it was put together. Production traffic brings inputs and combinations that were never in the dataset, so a frozen baseline covers less of that traffic over time. Scoring live runs with the same rubrics used offline provides feedback on failures that could not appear in the original suite. Those failures then become evidence for updating both the baseline and the tests.

The practical approach is to sample a small but consistent fraction of live runs for automated scoring. Every interaction that ends in escalation, a retry storm, or negative user feedback should get full scoring. Monthly refreshes of the golden dataset bring newly discovered production failures into release testing. The Production Agentic Evaluation Framework (PAEF) addresses this continuous production-evaluation role.

Prompt template version and agent version should appear in every trace’s root span so a distribution shift can be tied to a specific change. Prompts and tool schemas deserve release rigor because they alter execution behavior. Shadow or canary traffic allows comparison of new and current versions on the same inputs, while a one-click rollback path provides a way to reverse a harmful change. Without versioned traces, the team may detect deterioration without knowing which release introduced it.

Grouping deviations into recurring issues rather than reviewing traces one by one

An agent may handle thousands of requests overnight, leaving more flagged traces than a team can reasonably check one by one. More importantly, isolated review treats each run as a separate question and does not itself establish the pattern across runs. A useful issue must connect related instances.

A support agent that fabricates a refund policy on Tuesday and again on Thursday has exhibited one failure mode twice. Grouping those traces by failure shape exposes the recurrence instead of treating the second event as a new investigation. Useful shapes include tool selection deviations, step-count anomalies, and missing source quotes. Each category can have a named owner. That owner remains responsible for recurrences after an individual trace has been reviewed.

Grouping also shows where the agent’s task surface is fragile. Recurrences concentrated around a particular tool or task type identify where a prompt, tool schema, or guardrail needs attention. The distinction between a new pattern and a known recurrence changes the investigation. A new shape requires diagnosis, while another instance of an established issue adds evidence about its scope. This is the bridge from statistical detection to a fixable failure pattern.

Turning a confirmed failure pattern into a prompt fix and verifying it does not recur

A grouped failure gives the team the exact context, tool sequence, and output that went wrong to use in the repair. For a prompt regression, those records define the target of a focused change to the system prompt, tool definition, or retrieval configuration. The trace becomes the specification for the diff. Unlike a reconstructed example, it preserves the conditions under which the production agent failed.

The Model Context Protocol (MCP) gives teams a way to use that evidence to propose a change. Anthropic launched MCP in November 2024, and LangGraph, CrewAI, Claude Agent SDK, OpenAI Agents SDK, and Google ADK ship support for it. A coding agent operating over MCP can receive a failing trace, generate a prompt diff, and open a pull request for review. The proposed change still needs to be tested against the failure. Generating a change is not evidence that the agent now behaves correctly.

Verification closes the loop by turning the failing case into an entry in the golden dataset and adding it to the online scoring rubric. The new evaluation should fail on the pre-fix agent and pass on the post-fix agent, confirming that it detects the intended distinction. Canary or shadow deployment then compares the updated behavior distribution with the current-version baseline. A targeted repair that causes harmful tool selection shifts elsewhere is a regression. Every repaired failure retained as an evaluation strengthens the living profile of correct execution.

What the instrumentation looks like across the agent frameworks teams are running today

Teams can start with framework-level tracing to create the run records described above. LangGraph uses OpenInference hooks at the node level, with node executions represented as spans, model calls as child spans, and tool calls marked openinference.span.kind = TOOL. Its attribute conventions need explicit attention. Model spans use llm.* and openinference.span.kind, while gen_ai.* attributes require OPENINFERENCE_ENABLE_GENAI_SEMCONV=true. LangSmith adds node-by-node state diffs and replay against new model versions.

OpenAI Agents SDK supplies built-in tracing for agent execution, including step-level model calls and tool invocations, and integrates with MCP for external tools. Mastra records spans for agent runs, workflow steps, tool calls, and model calls. Its storage choices distinguish development from production. DuckDB serves development, while ClickHouse is recommended for high-volume production and PostgresStoreVNext is another production option. Mastra also has built-in evaluations and model routing in a framework built around one programming language.

Vercel AI SDK offers OpenTelemetry-compatible instrumentation for teams running agents in Next.js or Node.js environments. Edge runtime support for agents and OpenTelemetry is limited and not recommended. Other frameworks can use OpenTelemetry instrumentation libraries with gen_ai.* semantic conventions. Those spans can reach the same backend as API and database telemetry, preserving the connection between agent decisions and downstream services.

The OpenTelemetry GenAI specification defines agent, workflow, tool, and model spans as of v1.41. Its four client histograms cover operation duration, input and output token usage, time to first chunk, and time per output chunk, with the latter two added in v1.41. Teams should account for attribute-name churn because all gen_ai.* attributes have Development stability badges in that version. Instrumentation supplies the first trace as the baseline’s first data point, and each subsequent trace adds evidence that makes the profile of healthy execution more precise.

Sources

  1. Evaluation Blindness: How Silent Measurement Failures Corrupt AI Systems from Training to Deployment
  2. AgentPProf: Semantic Profiler for Long Horizon AI Agents
  3. When Errors Become Narratives: A Longitudinal Taxonomy of Silent Failures in a Production LLM Agent Runtime

More in Production Agent Observability