An Agent saying it's done doesn't mean it's done: What to look at in an Agent evaluation
A research agent replies that the report has been saved, but behind the scenes it may have researched the wrong framework, used incomplete arguments, skipped steps, or written an empty file. Agent Evals need to look at both the outcome and the process.
Agent evaluations are easy to reduce to looking at the final answer. In his AI Engineering Day 16 article, Ratish Jain gives an example of a research agent: the user asks it to compare LangGraph and CrewAI, research key features, and write a Markdown report. The agent replies that the report has been saved to output/comparison.md. That sentence sounds fine. The problems come afterward. It may have researched the wrong frameworks, called research tools with incomplete arguments, skipped research steps, written an empty report, saved the report somewhere else, or even reported success when the file was never created. If you only look at the final reply, all of these failures can stay hidden. The article's core point is: an Agent evaluation needs to look at both the result and the process that produced it.
Evals can be understood as testing and measuring a system. In the case of Agents, what is being tested is not just a single answer, but also the tool calls and state changes during one task execution.
Why looking only at the final answer is not enough
To complete a request, an Agent first understands the task, makes a plan, calls tools, reads tool results, decides what to do next, and finally returns an answer. Every step can go wrong. It may choose the wrong tool, pass the wrong arguments, skip required steps, or keep pretending to succeed after a tool errors out. The final answer can be written to look like the task was completed, while the actual artifact may not exist.
The article puts the problem directly: we must evaluate the result, and also evaluate the process that produced the result.
The difference between LLM evaluation and Agent evaluation
LLM evaluation typically measures the quality of the model's response to an input, such as factual correctness, relevance, instruction following, and format compliance. Agent evaluation also measures whether the system has completed the task: whether the right tools were selected, whether the arguments were correct, whether the execution order was reasonable, whether it could recover after failure, and whether state and memory were used correctly.
As the article puts it, LLM evaluation looks at whether the model gave a good answer, while Agent evaluation looks at whether the system correctly completed the task. Agent evaluation includes LLM evaluation, but has a broader scope.
Which dimensions to evaluate
The article lists several dimensions that should be measured separately:
- Task completion: Did the Agent achieve the user's actual goal?
- Tool selection and arguments: Were the right tools selected, and were the arguments valid and correct?
- Execution trajectory: Was the order of steps reasonable? Were there missing steps, repetitions, or infinite loops?
- Answer quality: Was the final answer correct, relevant, complete, and useful?
- Reliability and efficiency: Were there unnecessary calls, excessive retries, or excessive cost or latency?
These dimensions are related, but they cannot substitute for one another. An Agent may complete the task while making many unnecessary tool calls. It may also have a trajectory that looks correct while the final answer is wrong. That is why they need to be measured separately.
Tool selection and arguments
The user asks it to read notes.md and write a summary in summary.md. The expected behavior is to first call read_file with path notes.md, understand the file contents, and then call write_file with path summary.md. Evaluation can be split into two things.
Tool selection accuracy is the number of correct tool selections divided by the total number of tool selections.

Argument accuracy is the number of correct argument sets divided by the total number of argument sets.

Argument checking can use exact matching against fixed values, schema validation, semantic comparison of natural-language arguments, or custom rules for business constraints. A common mistake is to check only whether a tool call is valid JSON. Valid arguments can still be semantically wrong. For example, if the user asks to compare two frameworks, and the arguments contain only one framework name, the JSON is valid but the task information is incomplete.
Task completion and success criteria
Task completion evaluation looks at whether the Agent achieved the user's actual goal. A weak check only determines that the response is not empty, which proves little. A more useful check looks at the artifacts: whether the report file exists, whether its size exceeds a threshold, and whether key framework names and required sections appear in the content. Going further, whether the content is factually correct and useful may require human evaluation, an LLM judge, or an authoritative reference.
The article reminds us to define success criteria before evaluation, such as the task, expected files, and required sections. If the expected result is unclear, the evaluator cannot reliably judge success.
Trajectory evaluation
A trajectory is the sequence of actions and observations during one execution. Trajectory evaluation can uncover missing required steps, incorrect tool order, repeated calls, unnecessary actions, infinite loops, incorrect decisions after seeing tool results, and failure to recover after an error.
In the comments, Mohak Bajaj says that trajectory evals can catch those runs where the answer is right but the path is one you would never ship. Ratish replies that you need to observe the whole trace. This comment hits on the value of trajectory evaluation: the final answer can be correct while the process is still unacceptable.
Do you need an exact expected trajectory? Not necessarily. The same task can be researched in parallel or serially, and both may be correct. The article distinguishes exact trajectory matching, rule-based trajectory evaluation, and semantic trajectory evaluation. Exact matching suits deterministic workflows, while rule-based and semantic evaluation are better suited to flexible Agents.
LLM-as-a-Judge
Many Agent outputs do not have a single correct answer. For example, two framework comparison reports can have different structures, and string comparison cannot judge them. LLM-as-a-Judge has a model review the output according to criteria. The approach is to define scoring criteria, give the judge model the task and the Agent output, and have it score item by item and provide explanations and a pass/fail result.
The article gives an example of structured output containing accuracy, completeness, relevance, clarity, passed, and reason. The review result also needs to be validated by code, and then a rule determines whether it passes.
An LLM judge is not equal to factual ground truth. It may reward confident but incorrect answers, miss subtle factual errors, prefer longer answers, give inconsistent scores, and be affected by how the output is presented. Improvements include clear scoring rubrics, providing the original task and reference materials, requiring evidence for each score, testing judge consistency on known examples, using deterministic checks for facts that can be automatically verified, and keeping human review for important decisions.
Datasets and test cases
One or two prompts cannot test an Agent's reliability. An evaluation dataset should cover real tasks and failure cases. The types listed in the article include: normal paths, missing information, ambiguous requests, invalid inputs, tool failures, empty results, large tasks, and repeated requests. Testing only cases where everything goes smoothly cannot show that an Agent is production-ready. The dataset should also have clear expected results, avoid duplicate examples, and be updated when product requirements change. It is best to keep a set of examples that are not used during development, to check whether improvements generalize.
Offline and online evaluation
Offline evaluation runs a predefined dataset before deployment and records task completion rate, tool selection accuracy, argument accuracy, average number of tool calls, average execution time, and cost per task. It is suitable for testing new prompts, comparing models, testing new tools, and changing Agent architecture. Online evaluation looks at real user requests after deployment and can reveal real failure modes, unexpected inputs, tool failures, quality changes, and increases in latency and cost.
The article gives an example: an Agent completes 95% of tasks on an internal test set, but only 78% of real user tasks. The test set may not represent real user behavior.
Regression testing checks whether new changes break old behavior. The article's example is 100 test cases, where the task completion rate was 92% before the change and 84% after, a drop of 8 percentage points. Without regression testing, you may wait for users to discover the problem. Regression testing can be part of CI/CD, blocking deployment when metrics fall below a threshold. LLM outputs are non-deterministic, so important evaluations should be run multiple times to look at average performance and variance; one success cannot be treated as proof of reliability.
Evaluation pipeline
The article provides an evaluation pipeline diagram: dataset, run the Agent, evaluate execution with code checks and an LLM judge, aggregate metrics, and compare against a baseline and thresholds.

The common mistakes listed in the article are also worth reviewing together:
- Evaluating only the final answer.
- Handing everything to an LLM judge.
- Testing only normal paths.
- Having too few test cases.
- Optimizing only task success rate without looking at cost or latency.
- Treating benchmark scores as a production guarantee.
- Not re-evaluating after changes.
Someone in the comments asks Ratish whether inference engineering can be added, and he replies Yes. The series is still expanding.
Original article: https://learn.ratishfolio.com/agents/agent-evaluation/
发布时间: 2026-12-01 02:33