Instrumenting the Gap Between Step Completion and Step Correctness in Production Agent Traces

Completed steps can still be wrong, and four trace signals expose it.

· 9 min read
Cover illustration for “Instrumenting the Gap Between Step Completion and Step Correctness in Production Agent Traces”
Agent Observability · November 23, 2026 · 9 min read · 1,932 words

Silent failure detection for AI agents in production requires traces that distinguish a successful execution from a correct outcome. A completed step can return the wrong answer, pass invented data downstream, or claim an action that never happened. Detecting those failures requires four signals beyond completion status, namely step-level context, pre-execution tool arguments, reasoning-to-action consistency, and outcome coverage against the original task.

Why step completion becomes a structurally misleading signal in multi-step agent workflows

A crash is loud and self-reporting. A silent wrong answer is quiet and self-concealing. A crash at step 3 gives a stack trace, while a semantic failure at step 3 can produce a wrong result at step 10 without showing where the workflow went off track. Conventional monitoring detects broken execution. A well-formed, 200-OK response containing the wrong answer therefore passes the checks intended to establish that the system is working.

In a chained workflow, that distinction becomes a dependency problem. A semantically wrong output from one step becomes valid input to the next, with no exception raised and no alert fired. For example, a CRM tool can return unexpected JSON, after which the agent fabricates a plausible-looking output and downstream steps reason on invented data. The successful tool-call record conceals the substitution. Every step that follows can finish normally while taking the workflow further from what was requested.

Persistence makes the damage harder to unwind. An error written to memory, a vector store, or agent state continues corrupting downstream reasoning even after its original source is corrected. The workflow does not necessarily revisit the assumption that started the failure. A dashboard showing every step as complete can therefore be actively misleading, because it presents uninterrupted execution as evidence of task quality.

The six layers where agents fail silently, and why the most damaging ones have no detection time at all

Diagram: Six Silent Failure Layers: From Most Frequent to Hardest to Detect. Visualizes: Show six agent failure layers ranked or arranged by two dimensions surfaced in the article: frequency and detectability.

Sherlocks’ analysis of 73 production agent incidents in customer environments from January to May 2026 found six layers where failures occurred. They were tool-call and schema drift, retrieval and context quality, memory and long-chain drift, planning and decomposition, permission boundary violations, and observability failures. A tool can accept the wrong arguments, retrieval can supply the wrong evidence, a plan can omit necessary work, and a permitted action can exceed the user’s mandate.

The incident analysis found that tool-call and schema drift was the most frequent category. Yet in nearly two-thirds of multi-layer failures, the upstream cause was retrieval. The agent chose correctly but acted on bad context. This distinction explains why a successful tool call cannot establish that the decision behind it was sound.

The March 2026 logistics case makes the contract failure concrete. A supply chain routing agent began making incorrect routing decisions after a downstream API field changed from incident_count to num_incidents. The tool schema was never updated. No error logs or alerts appeared, and the system remained all-green until a human noticed drift in outcomes. The HTTP exchange succeeded while the semantic contract between the tool and agent failed.

Memory drift had the longest mean time to detect among layers with a measurable figure and was the hardest to reproduce. Plausible individual outputs concealed the loss of the original goal across the chain. The Microsoft AI Red Team’s June 4, 2026 update added seven agentic failure categories, including session context contamination, and described existing memory poisoning as materially amplified by agents. A single successful injection could propagate across subsequent sessions. Observability failures were more fundamental still, with no MTTD figure because no detection mechanism existed and average resolution taking more than four times longer than tool-call failures with schema validation.

How the completion-correctness gap widens as agent adoption outruns instrumentation

Deployment expands the exposure faster than completion-based monitoring can explain it. Teams can have more logs than they can read while still lacking the decision sequence needed to explain a wrong answer. Sherlocks’ incident analysis describes teams without reasoning traces working backward from support tickets and billing discrepancies.

That lag is an operational condition. Gartner’s June 25, 2025 prediction said that a large share of agentic AI projects would be canceled by the end of 2027 because of escalating costs, unclear business value, or inadequate risk controls. Model quality was not the explanation given. A system can produce capable individual responses while remaining difficult to control or diagnose across a changing production workflow.

Internal evaluations also test an environment that changes in production. APIs drift, models change, and incoming queries shift while the agent’s assumptions stay fixed. In the documented fintech startup case, retry loops drove a 340% quarter-on-quarter cost increase without triggering an alert. No single request was anomalous enough to expose the aggregate drift. Similarly, when a prompt behaves differently on another model or a staging tool returns malformed JSON in production, a completion-only trace cannot distinguish a retrieval problem from a model or external API problem.

How to tell whether an agent step was correct, not just completed

Diagram: Four Signals That Distinguish Correct from Completed. Visualizes: Illustrate a stepped flow of four signal classes that must be layered on top of basic completion status to detect silent agent failures.

The engineering response begins with context capture at every reasoning step. The trace must record the full context window actually passed to the agent. Intent is not evidence of delivery. When retrieval introduces bad information that propagates through five subsequent steps, this record locates the point of corruption. Without it, the trace establishes only that those steps ran.

Pre-execution tool arguments provide the second signal class. Recording the constructed arguments before a call fires preserves the distinction between a correct request and a plausible but wrong one. The response alone cannot supply that distinction. In the logistics case, an argument log showing the stale incident_count field would expose the mismatch with num_incidents. Schema drift becomes visible before a successful response obscures it.

Reasoning-to-action consistency provides the third class where a framework exposes an explicit plan or reasoning record. Comparing that stated intent with the actual tool call can reveal systematic divergence and possible context corruption. This comparison has a specific limit. Agreement between a plan and an action does not establish that either was correct, but disagreement identifies a decision boundary that completion status misses.

Outcome coverage is the fourth class and compares the original request with the artifacts, required fields, and actions the agent actually produced. Returned text is not a finished task. Useful checks include task completion, retrieved-document freshness, duplicate tool-call rates, router-to-specialist accuracy, and whether the answer led to the next user action. These distinguish fluent output from fulfilled intent. The τ²-bench airline benchmark found false completion in 22% of runs, where the agent claimed to have taken an action but made no corresponding write or API call, so outcome coverage caught the failure even though the other trace layers looked clean.

How major agent frameworks surface these signals, and where each still leaves a gap

Agent frameworks are broadly adopting OpenTelemetry as a tracing layer, but native support for GenAI semantic conventions varies, and those conventions remain in Development status. A shared span format helps show what ran across components. It does not define semantic correctness by itself. Framework instrumentation can establish what ran and what returned without establishing whether the step followed the agent’s instructions or satisfied the original task.

LangGraph stabilized its checkpointing API in early 2026, supporting long-running agents that resume after restarts. The production pattern uses CheckpointSaver with a PostgreSQL or Redis backend and connects the saved checkpoint to an OpenTelemetry span attribute. This preserves decision history and enables replay of past state during incident investigation. Semantic assessment of a step’s output still requires additional reasoning-layer instrumentation.

The OpenAI Agents SDK illustrates a separate distinction between native tracing and export. Its built-in spans go to OpenAI’s own dashboard by default, while OTLP export requires a separate TracingProcessor bridge. Export changes where the evidence is available. It does not supply the missing audit against instructions or task intent. Likewise, handoff spans help show where context was lost between agents but do not check whether the content passed along was correct, so a call made with the wrong context can still be recorded perfectly.

Applying correctness-aware tracing to the failure patterns that show up most in customer support, finance, and CRM agents

In customer support, context capture supports the detection of policy hallucination. An agent may retrieve the right document but misread or incorrectly paraphrase it, so a successful retrieval does not validate the answer. Evaluation must cover the whole conversation against the agent’s actual operating procedures. Individual calls are too narrow a unit. Outcome coverage supplies a separate check for routing errors, such as a billing request sent to a technical support queue despite a polished response and completed routing step.

Finance exposes the value of step-level retry counts and token budgets. In the fintech case, token consumption was doubling on specific steps while individual requests stayed below configured alerts. Totals for each session did not show where that work was being repeated. Retry counts are a proxy for per-step correctness because a retry indicates that the intended outcome was not achieved on the first attempt. Alongside semantic evaluation, they expose a failure pattern that aggregate success rates can hide.

CRM workflows add a permission boundary to the comparison between intent and action. A tool connected to an agent and offered for CRM search may use a credential that also lets it update opportunities, delete contacts, export customer data, or manage users. Technical authorization is broader than conversational authorization. Detecting this gap requires recording the full credential scope exercised and the action taken, and comparing the action with the user’s mandate. A record of a successful search alone hides how much extra authority the tool has, though having that authority does not prove that the tool took an unauthorized action.

Retrieval freshness cuts across all three domains. An outdated policy, expired pricing document, or superseded procedure can support a fluent answer that is wrong for the current task. The retrieval operation still looks successful. Freshness scoring on retrieved documents, surfaced as a span attribute, supplies evidence that completion status lacks. Combined with step-level context, it allows the investigation to distinguish incorrect interpretation from correct interpretation of obsolete material.

Turning production failures into ongoing correctness verification without hand-writing assertions

The recommended loop turns a failure that has been found into an evaluation that runs against every deployment that follows. Its starting point is observed behavior. Rather than requiring a team to anticipate every failure and hand-write an assertion before launch, the evaluation derives from a real task, the context supplied, the action taken, and the outcome that was wrong. This gives the fix a concrete regression target without treating an offline benchmark as a complete account of production quality.

Recurring failures must be grouped into issues for that loop to work at production volume. A wrong policy citation, stale retrieval, or false-completion pattern may appear in hundreds of traces before anyone checks one by hand. The enriched trace brings the evidence back to the decision sequence where diagnosis can begin.

Once the failure is diagnosed, the trace can give a coding agent the context needed to implement and test a proposed prompt or tool-schema fix. A schema that has drifted from production API responses is one such repair. Verification must follow the change. Running the evaluation built from the failure again tests whether the fix corrects the behavior seen in the trace, beyond getting the execution to finish successfully.

Continuous quality-score trends are also needed for prompt regression, where quality degrades without a discrete error event. Model version changes, prompt drift, shifts in incoming queries, and accumulated technical debt can all produce this pattern without a 500 or timeout. A one-time passing test cannot expose later drift.

More in Agent Observability