Agent Evaluation: Stopping Hallucinations in Workflows

Updated

9 min read

Abstract 3D render of translucent glass tiles in a row, one lit teal, for agent evaluation of workflow steps
In this article
  1. Agent evaluation: what it checks in a workflow
  2. Trace the workflow before you score it
  3. Pick a named evaluator for each failure mode
  4. Close the loop: failures become test cases
  5. Compare the three tools for agent evaluation
  6. What to check before you ship
  7. Frequently asked questions
  8. Is agent evaluation the same as LLM evaluation?
  9. Do I always need a judge model?
  10. Can I use these tools with an agent built outside their platform?
  11. Are these evaluators ready for production?
  12. Does one tool cover the whole loop?
  13. Which one to pick, by team need

Agent evaluation is the practice of scoring each step of an AI agent’s workflow, including its final answer. A multi-step agent calls models, reads documents and calls tools. A hallucination can start in any of those steps: an invented tool result, a wrong argument in a tool call, or a fact that the agent never retrieved. If the final text still reads well, a check on the output alone will miss it. This guide explains how to trace an agent workflow, score the steps that matter, and close the loop so that each failure makes the next release safer.

Agent evaluation: what it checks in a workflow

Agent evaluation scores each step of a multi-step workflow, including the final answer. A step can fail while the output reads well, for example through a wrong tool argument or a fact the agent never retrieved. Microsoft, Arize Phoenix and Langfuse each support step-level scoring, with different evaluators and release status.

Hallucinations are the failure that a final-output check finds last, if it finds them at all. In a chain, one wrong step becomes the input to the next. An agent that invents a customer ID could call the right tool with the wrong data, get an empty result and then write a confident summary. The summary is the visible error. The invented ID, from an earlier step, is the cause. Scoring the step where the ID appeared is what stops the error from reaching users.

The three tools covered here (Microsoft Foundry agent evaluators, Arize Phoenix evals and Langfuse) all support this step-level view. They differ in where the evaluators run, which evaluators they ship and how their features are released. Those differences matter more than any general claim about quality, so this guide reads each vendor’s documentation and states what it says.

Trace the workflow before you score it

A trace records each model call, tool call and result in a workflow, so an evaluator can see where an error started. Langfuse stores evaluation results as scores attached to traces, observations, sessions or dataset runs. Judge the root observation for a whole run, and the individual tool calls for a single step.

Target the right level. Langfuse’s guidance on agent workflows is to target the root observation of the workflow when you judge the whole run, and to read the recorded tool calls, with their names, arguments and order, when you judge a step. Its evaluation blog post describes trajectory evaluation, meaning the path of tool calls, as the step beyond final-output quality. Phoenix runs client-side evals from its Python and TypeScript SDKs against traces, datasets or any data source, so a team that already exports traces can score them without changing the agent.

Microsoft’s Foundry evaluators take agent messages as input and return a result for each check. Agents built outside Foundry Agent Service can still use them, but the messages must first be parsed into the format the evaluators expect. Plan that conversion as part of the tracing work, not as an afterthought.

Keep trace data for failing runs long enough to build the test set. Redact personal data before a trace leaves the production system, because evaluators read the full content of tool arguments and results. One redaction rule, written once, is easier to audit than one written per evaluator.

Pick a named evaluator for each failure mode

Match each failure mode to a named evaluator, so a low score points to one step. Foundry, Phoenix and Langfuse all offer tool-related checks, but their names, inputs and release status differ. Code-based checks suit fixed formats, and LLM judges suit questions of meaning.

Some checks do not need a judge at all. Phoenix lists exact match and a regex check (MatchesRegex) as code-based evaluators. Use them for outputs with a fixed shape: an order ID with a known format, a JSON key that must exist, or a tool name from an allowed list. Save the judge for judgement calls, such as whether an answer is faithful to the retrieved text, because an LLM judge adds cost and its own error rate.

A judge’s score is itself a measurement with error. The checklist below asks for a person to review a sample of judge scores, because a score that looks precise is not proof that the step is correct.

Foundry’s documentation adds a limit that matters for retrieval agents. It advises avoiding the tool-call and groundedness evaluators when the conversation includes calls to tools such as Azure AI Search, Bing Grounding, Code Interpreter or Web Search. For those agents, read the tool-call scores with that limit in mind, and add a code check for the tool choice where the allowed tools are known.

Close the loop: failures become test cases

A closed loop turns each failed production trace into a test case, reruns the test set after every change and blocks release when a score falls below a preset threshold. Run it on each change or on a fixed schedule, so failures get fixed rather than only logged.

  1. Trace each production run, including the model calls, tool calls and results.
  2. Score the steps with named evaluators, and mark the failing steps in the trace.
  3. Add each failing trace to a dataset, with the input, the expected behaviour and the failing step.
  4. Change the prompt, the tool definition or the retrieval step.
  5. Rerun the dataset as an experiment and compare the scores with the previous run.
  6. Release only when the scores meet the threshold for each evaluator.

Langfuse describes an experiment as a run of the application against a dataset that evaluates the outputs, and an experiment run as a single execution of the task against all items in the dataset. That structure fits the loop directly: the dataset holds the known failures, and each experiment shows whether a change fixed them without breaking the rest. Phoenix offers the same pattern through its UI, where evaluators are attached to datasets and experiment results are scored automatically.

Hallucination checks belong in the loop as well as in the release gate. Add a case for each claim the agent made without a source, and for each tool result it contradicted, so the same mistake cannot return unnoticed in a later change.

Compare the three tools for agent evaluation

The three tools cover different parts of the loop. Foundry runs agent evaluators in the cloud, Phoenix runs evals from code or its UI, and Langfuse combines traces, scores and experiments. The table uses only what each vendor page states on 2026-11-25.

ToolWhere the evaluators runAgent and tool evaluators named on the docsRelease status on its own page
Microsoft Foundry agent evaluatorsCloud, through the Foundry SDK (azure-ai-projects 2.8.0 or later in the how-to)Tool Call Accuracy, Tool Selection, Tool Input Accuracy, Tool Output Utilization, Tool Call Success, Task Adherence, Intent ResolutionTask Adherence and Intent Resolution are marked preview. The preview has no SLA and is not recommended for production workloads.
Arize Phoenix evalsPython and TypeScript SDKs (client-side), or the Phoenix UI (server-side)ToolSelectionEvaluator, ToolInvocationEvaluator, ToolResponseHandlingEvaluator; exact match and MatchesRegex (code-based)Not stated on the pages read
LangfusePlatform with traces, scores, datasets and experiments; code evaluators, LLM-as-a-judge and annotation queuesEvaluators can take an observation’s tool calls (name, arguments, order) as input; judge the root observation for a whole workflowThe evaluation blog post says the LLM-as-a-judge API endpoints are currently marked unstable. Batch LLM-as-a-judge needs the Langfuse v4 preview toggle.

Foundry is the choice when the agent already runs in Microsoft’s stack and a cloud evaluator fits the review process. Several of its agent evaluators are in preview, so a production gate should use the non-preview ones, or accept the preview risk on purpose. Phoenix fits a team that wants evaluators it runs in its own code and pipelines, with code checks and LLM-judged metrics side by side. Langfuse fits a team that wants traces, scores and experiments in one place, provided it accepts that the judge endpoints are marked unstable.

What to check before you ship

Before a release of an agent that calls tools or retrieves documents, the team should be able to answer yes to each item. The list is a working checklist for engineers, not a compliance standard, and each item names the step it protects.

  • Each run has a trace with the model calls, the tool names, the tool arguments and the tool results.
  • Each tool call has a tool-call evaluator, or a code check where the arguments have a fixed format.
  • Retrieval agents are checked against the tool limits in the vendor docs before a groundedness or tool-call evaluator is trusted.
  • Every LLM judge has a sample of its scores checked by a person before its threshold gates a release.
  • Every failing production trace is saved to a dataset and rerun after each change.
  • Preview evaluators and unstable endpoints are labelled as such in the release notes.
  • Each evaluator has a written threshold, and a release is blocked when a score falls below it.

Frequently asked questions

Is agent evaluation the same as LLM evaluation?

No. LLM evaluation usually scores one model response. Agent evaluation scores a sequence of model calls, tool calls and results, so it needs traces and step-level evaluators as well as an output check.

Do I always need a judge model?

No. LLM-judged evaluators need a judge model. Code-based checks, such as exact match and regex in Phoenix, do not. Use code checks for fixed formats and a judge for questions of meaning, such as whether an answer is faithful to the retrieved text.

Can I use these tools with an agent built outside their platform?

Yes, with a conversion step. Microsoft’s agent evaluators work on agents built outside Foundry Agent Service once their messages are parsed into the required format. Phoenix’s client-side evals run against traces, datasets or any data source you supply.

Are these evaluators ready for production?

It depends on the evaluator and on the date. Check each vendor page before you build a gate on it. On the pages read for this guide, Foundry marks several agent evaluators as preview with no SLA, the Langfuse blog marks its judge endpoints as unstable, and the Phoenix pages state no release status.

Does one tool cover the whole loop?

Not on its own. Each tool covers some parts of the loop: tracing, scoring, datasets, experiments or release gates. A team can use one tool for all of them, or combine tools where each one is strongest.

Which one to pick, by team need

The right tool depends on where the agent runs, how much of the stack the team wants to own and how much preview risk it will accept. Pick by need, then check the release status on the vendor page before the first gate goes live.

  • Microsoft stack, cloud evaluators: Foundry agent evaluators, with the non-preview tool evaluators in the production gate.
  • Code-first team that owns its pipeline: Phoenix evals, with code checks for fixed formats and LLM judges for meaning.
  • One platform for traces, scores and experiments: Langfuse, with the unstable judge endpoints kept out of hard release gates until they are stable.

About the author

Equipe Gui Tech

68 articles published

The Gui Tech team researches, verifies and updates every guide with verifiable sources. Enterprise tech, AI and security explained.

All articles

Keep reading