Instrumenting Arize Phoenix for Production Agent Pipelines
Spans and evaluations catch silent agent failures that HTTP 200s hide from traditional monitoring.

Traditional error monitoring fails for AI agents because a request can succeed with 200s and fluent text even when the agent does the wrong thing, a behavioral failure. Instrumenting Arize Phoenix for production agent pipelines therefore requires more than trace collection. Teams need spans that keep each decision boundary, evaluations that test what the agent does at that boundary, and production alerts that catch degradation before users do.
Why traditional error monitoring fails for AI agents
A tool can return an error payload that the next model call incorporates into its answer. The run ends, the output looks right, and monitoring sees no exception or HTTP 500. This fail-plausible behavior is worse than a failure that merely escapes observation, because the output itself misleads the observer. Across planning, tool calls, retrieval, and synthesis, each step can pass a silent error forward while the overall request appears successful.
Some LLM clients and local runtimes silently truncate inputs at the context limit, leaving the model to reason from a partial view while requests keep returning 200s. Major hosted APIs, including OpenAI, Anthropic, and Google, typically return explicit errors instead. Catching silent failures takes both a record of what ran and knowledge of what the agent was supposed to do. Lemma audits traces against an agent’s own instructions and groups behavioral deviations into actionable issues, even when runs produce no crashes or error codes.
What Phoenix actually gives you across a multi-step agent trace
Phoenix builds on OpenTelemetry and uses OpenInference semantic conventions to describe agent execution. OpenTelemetry provides the tracing foundation, while OpenInference gives agent, LLM, and tool activity a consistent representation. Arize created OpenInference to standardize this layer, but the conventions work with any OpenTelemetry-compatible backend. The instrumentation is therefore portable rather than tied to Phoenix as its only destination. This lets teams design spans around what the agent does.
Oracle’s Agent Spec integration shows how this works across runtimes and LLMs. Parent–child spans connect the overall execution to its component calls, with inputs and outputs that include system prompts, tool arguments, timings, and the final response. For multi-agent systems, Phoenix’s node-based graph shows the flow from agent-to-agent and agent-to-tool. This lets a reviewer follow a delegation chain rather than infer causality from a linear sequence of records. The graph is useful only if the instrumentation preserves those relationships.
Phoenix OSS is free and self-hosted, with no paywalled features inside the self-hosted product. Production features such as online evaluations and alerting, however, live exclusively in the paid Arize AX platform. Phoenix also carries an ELv2 license that bars offering it as a managed service, so teams with strict open-source policies should evaluate that restriction before committing. Collecting traces in Phoenix is not the same as having a production alerting service configured.
How to structure spans across a multi-step agentic flow
Each logical step in the agent’s plan should have its own span beneath a parent span for the whole run. This preserves the structure Phoenix needs to render the execution graph and separates the decisions that evaluations will later assess. Start with planning rather than treating the whole run as one undifferentiated model interaction. Spans should match the logical work even when the functions that do it have different boundaries.
Tool calls then need their own spans with explicit inputs and outputs. That boundary reveals when a successful tool invocation returns an error payload that the model should not use. Retrieval spans should capture the query, retrieved chunks, and similarity scores, preserving the evidence available to the synthesis step. The LLM generation span should remain distinct from retrieval so that poor reasoning can be separated from poor context. For behavioral monitoring tools such as Lemma, this granularity makes it possible to identify where a silent failure entered an otherwise completed run.
Delegation and continuity need the same care as individual calls. Sub-agent invocations should be child spans of the parent agent so failures can be followed through the delegation chain. Agents that resume across process invocations also need a consistent session identifier threaded through their spans to keep multi-turn behavior connected. Without that continuity, a failure that develops across turns becomes difficult to inspect as one task.
The command npx @arizeai/phoenix-cli setup detects the framework and LLM provider, installs the appropriate OpenInference instrumentation, and wires up trace export. Teams should treat the setup as a starting point and inspect whether the generated spans match the agent’s logical steps before treating trace coverage as complete. As of Phoenix 15.4.0, token counts appear in every span, trace, and session REST payload, removing the need for a separate API call to attribute cost to individual steps. That attribution adds a useful dimension to evaluation, because an unchanged outcome can conceal a more expensive path.
Where to attach evaluations and what each attachment point catches
Planning errors belong at the agent span, tool errors at tool spans, and retrieval errors at retrieval spans. Reasoning errors belong at LLM generation spans, while safety and policy violations need checks at the output. These attachment points distinguish the origin of a failure from its downstream expression. Checking only the final response hides where the failure began and makes it harder to fix that part.
At tool boundaries, deterministic checks can test that error payloads stop the run before they feed into generation. This does not require an LLM judge. Retrieval evaluations should measure whether the chunks are relevant to the query and support checks for hallucinated grounding, where the model cites a source absent from the retrieved context. To check whether the cited grounding was available, teams need the retrieval evidence as well as the answer.
LLM-as-judge evaluation lets teams check reasoning at scale, but they need calibration to know whether they can use its scores for automated decisions. Run the judge against human-labeled traces first, and trust it for automation only when agreement is high. Final-output evaluations then catch PII leaks, jailbreak compliance, harmful output, and refusal failures that survive upstream checks.
These methods can be mixed by span type. Batch evaluation lets teams assess a dataset, while production monitoring needs online evaluation on live traffic as well as offline runs against golden datasets. Oracle’s integration guide demonstrates using one evaluation harness across multiple runtimes, with a consistent trace schema making the results comparable when the runtime or LLM changes.
Regression detection: what task-success metrics hide and what catches the real degradation
Task success is an insufficient primary regression metric because an agent can reach the same outcome while a critical component degrades. Tool selection accuracy, for example, can decline meaningfully while aggregate task success remains nearly flat. Span-level scores expose that deterioration before the top-line metric reflects it. Step-level token attribution adds cost context to the comparison without substituting for a behavioral measure. A defensible regression gate tests the execution path as well as its result.
The τ-bench standard checks whether an agent completes a task correctly by checking both the final answer and database state. Its pass^k metric requires an agent to complete the same task correctly across k independent runs from a fresh state. The gap between pass^1 and pass^4 matters because a single successful run can be luck. A recommended CI gate runs a full LLM-as-judge evaluation against a golden dataset and compares pass rates with the previous model version. If the pass rate drops more than 3%, the deployment should be blocked.
That gate still needs to be tested on real query distributions. Before full rollout, deploy to a fraction of traffic with online evaluation active for at least a couple of days. Golden datasets can miss regressions that depend on production inputs. The canary stage tests whether the offline result holds under those inputs rather than assuming that a passing CI run settles the question.
People who looked at system output eventually found a large share of silent failures while unit tests, health checks, and governance audits stayed green. The longest-lived failures occurred in seams such as component boundaries, deployment topology, and cross-script contracts. Span-level regression detection moves assessment into boundaries that otherwise escape human review. Phoenix datasets and experiments version prompts and agent configurations with evaluation results, allowing score changes to be tied to the prompt or tool configuration under test.
Configuring drift detection and alerting so behavioral failures surface before users do
Error-rate and availability alerts miss behavioral degradation when calls complete normally. For planning and tool behavior, the useful signals are evaluation scores attached to agent and tool spans. Configure thresholds on score distributions. This shifts attention from individual request failures to changes in behavior across requests. Versioned prompts and configurations provide the context needed to interpret that change.
Embedding drift adds a different kind of warning by tracking changes in the semantic character of retrieval traffic or context. In general, cosine distance compares the direction of embedding vectors, making a shift in their distribution visible without waiting for final answers to be marked incorrect. That makes drift a leading indicator of changed conditions. Retrieval queries, chunks, and similarity scores supply the context for investigating the shift. Drift signals and relevance evaluations answer different questions, so a distribution change should not be treated as interchangeable with a failed behavioral check.
Those checks also need to cover security failures. Microsoft’s failure taxonomy, publicly updated in June 2026 with a whitepaper dated April 2026, expanded from 27 to 34 failure modes, including Agentic Supply Chain Compromise and Goal Hijacking. Phoenix 15.4.0 introduced context-injection hardening for the PXI agent’s set_time_range tool, addressing a tool being redirected by untrusted prompt content. Teams should configure detection for that pattern in their own agent spans.
Arize AX provides online evaluations and alerting, while instruction-aware behavioral monitoring, including Lemma, addresses plausible-looking deviations that generic error thresholds cannot classify. Before enabling the Phoenix v19 MCP endpoint in production, review PHOENIX_ENABLE_MCP_SERVER, PHOENIX_ENABLE_MCP_CODE_MODE, PHOENIX_ENABLE_OAUTH2_AUTHORIZATION_SERVER, and PHOENIX_OAUTH2_ALLOWED_REDIRECT_HOSTS. Use a dedicated read-only identity and monitor MCP timeouts and tool-call quotas.
Closing the loop from traces to fixes inside the development workflow
Detection is incomplete if the evidence cannot reach the developer making the correction. Moving out of the editor to reconstruct a failure can defer the fix or separate it from the prompt and configuration that caused it. Phoenix’s MCP server exposes tools for prompts and their versions, traces and spans, annotations, sessions, and datasets. These let a coding agent get what it needs to investigate and retest behavior within the development workflow.
The practical sequence is to pull the failing spans, inspect the prompt version that produced them, add the failures to a dataset, and rerun the experiment. This turns a production deviation into an example that can test the next change. Phoenix supplies the trace infrastructure and inspection interface, but it does not automatically audit every trace against the agent’s instructions and group recurring deviations into issues. Lemma integrates directly with Phoenix to provide that behavioral monitoring layer and alert in Slack when a pattern recurs, without a separate instrumentation effort.
Structured spans identify the boundary, evaluations classify the failure, and versioned experiments test whether the correction holds. Production instrumentation succeeds when it makes incorrect behavior actionable.


