What Separates Trace Comparison Tools That Know the Agent's Instructions From Those That Only Know Its Steps
Only tools that judge traces against instructions catch quiet policy failures.

Intent-aware auditing for AI agents compares execution against the original instructions, policy, or goal, rather than treating a completed workflow as proof of correctness. Trace comparison tools need both the execution record and a persistent reference to what the agent was supposed to do. Without that reference, tool calls that succeed and answers that look right can hide policy violations until users run into them.
How trace tools split into two categories with fundamentally different capabilities
Step-knowing tools capture the sequence of an agent’s work, including tool calls, spans, token counts, latency, and intermediate outputs. Their strength is a faithful record of execution. That record supports questions about which tool ran, how long it took, and what it returned. It also provides the evidence needed to locate operational failures, but the sequence alone does not establish whether the agent followed its instructions.
Instruction-knowing tools add a reference against which that sequence can be judged. They check what the agent did against its original policy, goal, or system prompt to tell whether it followed them or just finished the work. The distinction concerns evaluation: a detailed trace viewer does not become instruction-aware simply because it displays more spans or groups them into a session. The instructions must participate in the judgment.
System-level telemetry sits outside this distinction because it addresses a different layer. The University of California, Berkeley paper AgentTrace: A Structured Logging Framework for Agent System Observability describes telemetry that correlates LLM prompts with kernel events at system boundaries without establishing a semantic link between inference and execution. It can show what happened in the system without showing whether that work helped with the task. A step-only tool can therefore confirm that the workflow finished, but it cannot, on that evidence alone, establish whether what finished was right.
Why a completed workflow is not the same as a correct one
An agent can succeed at the wrong thing. Routing a request to the wrong queue or citing a hallucinated policy need not produce an error log. The HTTP response can be 200, and latency can look normal. The operational signal establishes that a request was handled, while the failure concerns the decision made during that handling.
A field rename illustrates how the gap develops. If incident_count becomes num_incidents, an agent that still depends on the old field can make a wrong routing decision even though the surrounding workflow completes. The structural failure is a mismatch between the information the decision requires and the information the agent uses. A downstream response that looks right can still hide that mismatch.
When a task requires a live tool call but the agent invents the result, an execution log can show no tool-side error because the required call never occurred. The missing call becomes a failure only when assessed against the instruction that required it. The same dependence on context applies when a wrong argument early in a workflow corrupts later steps. The AgentTrace paper describes operational, cognitive, and contextual surfaces of observability, noting that existing systems “primarily target single-surface traces.” Those surfaces must be linked to show how an earlier decision led to a later result that seems to have succeeded.
How do you audit AI agents against their original instructions?
The agent’s system prompt or policy document must stay available at the trace-envelope level, where it can be found outside any one span. That reference defines the standard of correctness. Without it, an evaluator may judge whether an answer looks reasonable without determining whether the agent complied with the task it actually received.
The evidence must cover more than tool execution. The AgentTrace paper defines cognitive spans for LLM interactions and reasoning chains, operational spans for method-level execution and timing, and contextual spans for external I/O such as HTTP calls and database queries. These surfaces share a unified envelope. Their linkage allows an evaluator to relate a decision to the action it produced and the external information involved. A complete session must also link turns, tool calls, and reasoning steps, because a failure can take shape across turns even when no single span shows it.
Agents can choose different tools and branches for the same input, so path visualization must show how paths differ across runs and allow for more than one valid sequence. Difference alone does not establish a failure. Each path must be judged against the same instructions, including any required calls, grounding, or policy constraints. This makes the declared goal the stable reference when the execution path is not stable.
Production use adds two further requirements to this foundation. Issue clustering must group similar failures so that teams can replace trace-by-trace inspection with prioritization of recurring patterns. Online evaluation must score real production traces as they arrive, extending evaluation beyond offline test sets. An evaluation process that runs only before deployment cannot detect a new production violation when it occurs.
How the major trace tools fare against that instruction-aware bar
LangSmith combines model and tool-call breakdowns with close integration into LangChain and LangGraph, including node-by-node state diffs and replay against new model versions. It also uses AI to identify which decision, prompt instruction, or tool call caused observed behavior in complex agents. Named issues are visible in LangSmith Engine/Insights, although it lacks a full issue lifecycle with active, in-progress, resolved, and regressed states. Its MCP server connects coding agents such as Claude Code and Cursor to the workspace, supporting a handoff toward a fix and an opened PR. The remediation work remains outside the platform.
Langfuse offers open-source, self-hostable, prompt-level tracing for teams with different needs. It is an option when trace data cannot leave the team’s infrastructure. Visibility still depends on what the application instruments. Langfuse has no identity context of its own, and checks against the agent’s policy must be set up outside it. Its deployment model therefore determines trace residency, while the completeness of an audit’s evidence for authorization or instruction adherence depends on instrumentation and external policy checks.
Datadog LLM Observability offers consolidation for teams already using Datadog infrastructure, but lacks semantic failure discovery and multi-step causal analysis at the reasoning layer. Arize Phoenix and Arize AX provide a different combination of instrumentation and storage. Phoenix supplies OpenInference instrumentation for LangChain, LlamaIndex, and DSPy and is OpenTelemetry-native, allowing traces to sit beside application telemetry. AX uses a purpose-built datastore for generative AI workloads. Dynatrace’s SEC 10-Q filing states that it acquired Arize on October 1, 2026. These capabilities do not themselves establish instruction-awareness, and the absence of a notion of which user a tool call acted for leaves additional assembly necessary for that use case.
AgentTrace approaches the problem through its trace schema. The paper nests cognitive spans within operational and contextual spans and exports them through standard backends, preserving interoperability while making reasoning-aware, end-to-end tracing possible. The framework instruments agents at runtime without requiring code modifications and is designed for security, accountability, and real-time monitoring. It remains a research framework. Its contribution is an explicit architecture for linking the evidence needed for instruction-aware auditing, rather than a packaged commercial workflow for issue management and remediation.
These differences separate instrumentation, evaluation, and remediation capabilities. A platform may capture execution well without built-in policy comparison, or offer causal diagnosis without tracking an issue through a fix and any regression. No single capability establishes the entire chain. For an instruction-aware use case, the comparison must distinguish what the product supplies directly from what the application or an external evaluation layer must add.
Where the instruction-awareness gap hurts most in practice in customer support, finance, and CRM
Customer support exposes the gap when an agent completes a refund workflow while violating the policy governing that refund. A successful tool call establishes that the action occurred while leaving the agent’s grounds for taking it unverified. An explanation that sounds right can hide the same problem. If the explanation cites a hallucinated policy, the trace must connect the answer and action to the policy actually provided to the agent. Step-only monitoring otherwise treats the completed refund as operational success while leaving policy adherence unexamined.
Finance makes the distinction especially consequential when a transaction depends on live information. If the agent fabricates a required tool result instead of obtaining it, the workflow may proceed on an unsupported premise without producing a failed call. Instruction-aware evaluation can identify the missing live call because the original task made that call a requirement.
CRM workflows add the question of authority when an agent mutates a record or contacts a customer. The history needs to show what the agent saw, what it decided, which tools it called, and which policy checks allowed the action. Identity context is essential to that reconstruction. A trace that records a mutation without establishing on whose authority it occurred leaves a gap that execution detail alone cannot close. Enterprise auditing therefore requires a tamper-resistant history that connects the action to its authorization, rather than only documenting the action after it happened.
How to instrument a production agent to get instruction-aware traces from the start
For engineering teams, the practical path begins with instrumentation and configuration of the existing agent. The major frameworks can export usable spans to an OTLP collector, while the platform layer supplies the comparison between execution and instructions. Attach the system prompt or policy document to the trace envelope as a persistent reference. Then link cognitive evidence and goal states to the operational spans they produced, with contextual I/O connected under the same envelope. This preserves the relationship between the task, the decision, and its external effects.
The framework determines the initial diagnostic focus. For LangChain, instrument whether the agent received and used the right evidence, with retrieval and grounding as the primary failure surface. For OpenAI Agents SDK, link routing and tool use to the goal that defines when the task is complete. For Vercel AI SDK, capture what generation completed and what the user received, treating the generation as the diagnostic unit. Mastra records framework-operation spans automatically, including duration, provider-reported token usage, and cost estimates where model pricing is available. Customer IDs can also be attached as trace metadata.
Configure a rolling-window quality-score drop to signal regression or data drift before user reports arrive. Add an alert for tasks running far beyond their P95 latency, because a retry loop can appear in a step trace as a series of normal completions. Tool credential health checks provide a pre-failure signal for authentication problems that can otherwise remain silent. Latency and credential checks look for different problems than instruction-based quality evaluation does, so both kinds of checks are needed.
After finding failures, group those that keep happening into named issues before looking at traces one by one. This makes the pattern the unit of investigation. Pass the issue context to a coding agent over MCP so engineers can work on the fix without manually reconstructing the context. Then create evaluations automatically from the real failure traces so the next deployment can test the fixed behavior without hand-written assertions. The resulting audit connects the original instruction to the observed failure and turns that failure into a regression check.


