Blog
實用訣竅

What are evals? A 6-step error analysis SOP for AI agents

Gartner predicts 40% of AI agent projects will fail. This article explains eval and evals, then uses a 6-step error analysis method to find failure patterns in 20 logs and avoid common traps.

AI lab
28/10/2025
Share this article
FacebookLinkedinLINE

Gartner predicts that over 40% of AI agent projects will be canceled by 2027. This article updates the 2026 trends and three real failure cases, and walks through a 6-step error analysis SOP that starts from 20 conversation logs, so you can avoid common traps and tune an agent to production quality.

‍

Agent error analysis is required learning for AI teams

‍

Why will 40% of AI agent projects fail? First understand where the problem lies

In short: see where the problem is first, so resources land on the right spot

‍

Over 40% of agentic AI projects will be canceled by 2027, mainly because of runaway costs, unclear business value and inadequate risk controls. This is Gartner's 2025 prediction [1]. But what actually sinks a project is often not a model that is too weak. It is that the team has no systematic method for finding where the problem really is.

‍

The same Gartner report points to another phenomenon: the market is full of "agent washing," repackaging existing chatbots and RPA as AI agents. Of the thousands of vendors claiming to do agentic AI, Gartner estimates only about 130 are genuine [1]. When you cannot tell whether the tool in your hands really makes autonomous decisions or is old automation in new packaging, it is hard to know how to fix it when it fails.

‍

Error analysis is the method that fills this gap. It helps you draw quantifiable failure patterns out of a pile of failed conversation logs, so tuning effort goes where it counts instead of fixing bugs whack-a-mole every day. If you are evaluating an enterprise AI agent rollout, or already went live and keep making things messier with each change, this article gives you a repeatable, quantifiable SOP to help the team break out of the "endless bug fixing" cycle. Before you start, we also suggest first working through the 5 risks to know before adopting an AI agent, which works best when read together with this article.

‍

How error analysis differs from traditional debugging

‍

What are eval, evals, AI evals and agent evals? Sorting them out once

In short: first understand what eval is, then you know what error analysis is solving

‍

Eval is short for evaluation, often translated into Chinese as 評估 or 評測. It refers to a test that gives an AI system an input and then applies a set of grading logic to check whether the output is good; the plural Evals generally means "a whole set of such evaluation processes and test cases." Anthropic's early-2026 engineering guide defines it directly: an eval gives an AI an input and applies grading logic to its output to measure success or failure [2].

‍

AI Evals: an evaluation process for a single model or task, aiming to measure, quantitatively or qualitatively, a model's performance on a specific task or scenario. Common metrics include accuracy, bias and perplexity, and it is usually used in model training or fine-tuning. But AI Evals are mostly based on static datasets and cannot capture the dynamic interactions of agent systems.

‍

Many people mix up eval and evals, but the difference is simple:

  • eval (singular): a single test, also often used as a verb ("run an eval")
  • Evals (plural): a whole evaluation process, including multiple test cases, graders and decision criteria
  • AI Evals: evaluation of a single model or task, mostly based on static datasets and single-turn Q&A, used to measure a model's performance on a specific task
  • Agent Evals: evaluation of agent systems that "call external tools and run across multiple steps," assessing overall performance at the task level

‍

Agent Evals: designed for agent systems that run multiple processes and call external tools, assessing overall performance at the task level. They look at RAG (retrieval-augmented generation) accuracy, task completion rate, business understanding, tool-call correctness, multi-turn consistency and so on. They suit complex enterprise applications and dynamic environments better.

‍

The biggest difference between the two is whether the object being evaluated is "one model" or "a whole system that takes actions." The table below shows it at a glance:

‍

This table compares AI Evals and Agent Evals across evaluation object, interaction type, metrics of focus and applicable stage. AI Evals target a single model, mostly single-turn static datasets; Agent Evals target multi-step systems that call tools, focus on task completion rate and tool-call correctness, and apply as a gate after launch.

‍

To remember it simply:AI Evals is a "parts inspection"; Agent Evals is a "full-vehicle road test." If you only wanted to look up what eval means in Chinese, you can stop here. For a company, though, knowing the definition is not enough. You need a process that first finds where the agent actually goes wrong, and then decides whether to build evals for it. That process is the error analysis covered next.

‍

What do AI agent failure cases look like? Three real lessons

In short: not a model that is too weak, but no mechanism for catching errors

‍

Most AI agent failures are not due to insufficient model capability but to the lack of systematic error analysis and evaluation mechanisms. The three public cases below match the three error-catching methods covered later in this article, and they also make the statement "40% will fail" concrete.

‍

Case 1: a customer service agent invents a policy and the company loses in court.

‍

Air Canada's customer service chatbot invented a bereavement fare refund policy that did not exist and told it to a traveler, who acted on it and then claimed a refund. In 2024 a Canadian tribunal ruled that the airline was responsible for what its bot said, rejecting the defense that the bot was a separate entity [7]. This is a milestone: companies bear legal responsibility for the output of their own AI. The matching error-catching method is that critical paths (such as refunds and warranty policies) must be tied to real-policy checks using a test set with standard answers.

‍

Case 2: a report agent fabricates citations and money is refunded.

‍

In a 2025 government-commissioned report, Deloitte Australia used generative AI to produce content that included several fabricated academic citations and an invented court quotation, and later refunded part of the payment [7]. This is the typical consequence of having no source checks: research agents need groundedness (every claim traceable to a source) and source-quality checks.

‍

Case 3: a coding agent ignores instructions and deletes the production database.

‍

‍ In July 2025, during a code freeze with an explicit instruction not to touch the production database, Replit's AI coding agent still ran a delete command, wiping production data covering more than 1,200 executives and nearly 1,200 companies, and at one point falsely claimed it could not be restored [6]. Replit's CEO then apologized publicly and launched safeguards such as automatic separation of development and production environments. This is a combination of runaway context and emergent behavior, and it takes CI/CD regression tests paired with a deterministic guardrail layer to stop it.

‍

The three cases share just one thing:Before launch, none had a quantifiable, repeatable process for catching errors. For more pitfalls and fixes that AI agents have met in enterprise practice, see our collection of AI agent rollout cases and trends. Next, we break this error-catching process apart.

‍

Why does traditional debugging make an AI agent worse with every change?

In short: an agent is not traditional software, and manual testing only makes things messier

‍

Traditional debugging stresses reproducing the problem and locating it step by step, like finding a leak. But an LLM agent's output is stochastic: the same input can produce different results, and traditional unit tests cannot cover it fully. Error analysis is more like looking at the whole picture with a thermal imager. It does not dwell on a single error. Through classification and statistics (what share are tool-call errors? what share are intent-understanding failures?), it finds the tuning points most worth investing in.

‍

Anthropic's engineering guide names this pain point directly: when users report "it got worse after the update," a team with no evaluation mechanism can only guess and check repeatedly, caught in a reactive cycle of "wait for user complaints, try to reproduce by hand, fix one bug, then hope nothing new broke" [2]. The result: you cannot tell a "real regression" from "random noise," and you cannot quantify "whether it actually improved this time."

‍

Andrew Ng illustrated the power of error analysis with a cat-and-dog recognition example: he examined the misclassified images and sorted them, and found that half were dogs mistaken for cats, three tenths were big cats misclassified, and two tenths were blurry images [3]. Through error classification, the team knew exactly where to focus instead of blindly adding more data. Apply the same logic to an agent: you must first see the distribution of failure patterns before deciding whether the next step is to fix the prompt, fill in the knowledge base or change the tool design.

‍

Andrew Ng once used a cat-and-dog recognition example to explain: he examined the wrongly classified images and sorted them, and found that 50% were dogs mistaken for cats, 30% were big cats misclassified and 20% were blurry images. This shows that through error classification you can clearly find where to focus tuning, rather than blindly adding data.

‍

Where does an agent's root cause hide? The four context failure modes

In short: eight in ten agent failures have their root cause in context

‍

Most strange agent behavior after launch is not a model problem but context getting out of control. In 2025, AI researcher Drew Breunig proposed the "four context failure modes" framework, which the industry has widely cited as a basic mental map for agent debugging [4]:

‍

This table lists the four context failure modes proposed by AI researcher Drew Breunig: poisoning, distraction, confusion and clash, with a plain-language definition and common symptoms for each. For example, poisoning makes the agent hold on to a wrong premise and fail to get out, while distraction means the conversation drifts further off topic as it gets longer. Teams can use it to quickly match and locate the root cause.

‍

The next time your agent does something you cannot explain, compare it against these four modes one by one, and you can almost always pin it to one of them. The manual labeling step in error analysis (detailed in Step 2 below) is exactly about sorting conversation logs by failure modes like these, instead of describing the problem vaguely as "inaccurate replies." For a more systematic way to manage context, read further on how context engineering works.

‍

Error analysis vs evals: which comes first? Get the order wrong and the work is wasted

In short: error analysis first, evals second. Reverse the order and the effort is wasted

‍

Error analysis and evals are two different things, though they are often confused. The correct order is:error analysis first, evals second. First use manual labeling to find systematic failure patterns (lay the problems out), then design evals test cases for each failure pattern. If you write evals without error analysis, the test cases easily become a formality: you write a pile of passing tests while user complaints do not drop [5].

‍

In our work coaching Taiwan companies, we have observed that most teams get stuck at "jumping straight to writing evals without doing error analysis first." The result is beautiful test results with customer complaints unchanged. The right rhythm is log collection, error analysis, failure-pattern classification, and only then designing evals to fit. With the order right, every step after it means something.

‍

How many conversation logs does error analysis need to get started?

In short: 20 to 50 failed cases is enough to start; do not wait for perfect

‍

Many teams delay setting up error analysis because they "think they need hundreds of samples for it to mean anything." Anthropic's engineering guide breaks this myth directly: drawing 20 to 50 simple tasks from real failures is a good starting point [2]. The reason is that in the early stage of agent development, every system change has a clearly visible effect, large enough that a small sample is enough to judge direction.

‍

For Taiwan enterprise practice, the approach compiled in the industry is to build up sample size in stages:

  • Starting stage (20 to 50 logs): begin with real failed conversation logs and find the 3 to 5 most frequent failure patterns
  • Expansion stage (100 or more): sample along "at least three dimensions," such as feature by user role by query complexity, to avoid evaluation bias from looking only at extreme cases [5]
  • Mature stage (several hundred or more): once the agent stabilizes, a larger sample is needed to detect small regressions

‍

Picking samples is like drawing blood for a test: it has to be representative, and more is not always better. What to avoid most at the starting stage is insisting on "starting once the sample is big enough," which ends with half a year passing and nothing done.

‍

What are the 6 steps of agent error analysis?

In short: six steps in one chain, each with an output and a checkpoint

‍

A complete agent error analysis process has 6 steps, each with a clear input, output and handoff to the next step:

  1. Collect conversation logs: record every detail of the agent's interactions
  2. Manually label failure points: an expert picks samples and finds the first place it goes wrong
  3. Use an LLM to summarize failure patterns: hand the labeled results to an LLM to classify and rank automatically
  4. Decide between a fix and an evals test case: fix small problems directly in the prompt, and move bigger problems into evals monitoring
  5. Build and calibrate an LLM judge: let AI act as the judge, and trust it only once it agrees closely enough with human judgment
  6. Monitor and keep iterating: connect to CI/CD and run regression tests on every update

‍

Every step needs samples to be representative, error categories to be specific and actionable, and results to be tracked with clear quality metrics. We break it down by stage below.

‍

Agent error analysis Steps 1-2: collect conversation logs and label manually

‍

Steps 1-2: how to filter logs and how to label samples?

In short: when logs are filtered accurately and labels are specific, there is something to classify afterward

‍

Error analysis starts with collecting conversation logs, but a general-purpose LLM lacks multi-dimensional filtering. You only see one long stream of conversation and can hardly pinpoint which few are abnormal. If you use an AI agent platform with observability, such as the logging built into AltaBots.ai, you can cross-filter by user intent, tool calls, response latency and other dimensions, which greatly shortens the time to find abnormal conversations. When Data-DI consultants coach clients through rollout, they help design a log tagging structure that fits each business scenario, so later error analysis can apply it directly.

‍

After picking representative samples, move on to manual labeling. When labeling, focus on the "first point of failure," which is the earliest place in the conversation where something goes wrong, instead of tagging the entire unsatisfactory exchange. Avoid vague words like "replies are inaccurate" or "answers are poor," and use a specific description instead:

  • ❌ Vague: "The customer service bot's replies are inaccurate"
  • ✅ Specific: "At Step 3 it did not understand the customer's intent 'return process,' wrongly triggered the 'cancel order' tool, and caused a wrong handoff"

‍

While labeling, write down an actionable fix as you go (for example: add return-process keywords to the intent classification training set), so later steps can act on it directly. We suggest labeling 20 to 50 representative samples to start, covering the common scenarios.

‍

Agent error analysis Steps 3-4: use an LLM to summarize failure patterns, then decide on a fix or a test case

‍

Steps 3-4: how to summarize failure patterns? What should be fixed and what should be tracked?

In short: classifying errors is like tidying a wardrobe, so start with the biggest pile

‍

After manually labeling 20 to 50 samples, hand the labeled results to an LLM and ask it to summarize the systematic failure patterns and rank them by frequency. For example: "45% are intent-understanding failures, 30% are tool-call errors and 25% are format mismatches." An LLM is used here rather than people because once the sample grows to hundreds, manual classification is slow and prone to subjective bias.

‍

Then make a "Fix or Evals" decision for each failure pattern:

  • Problems that can be fixed directly (such as prompt spelling errors or format mismatches) should be fixed first (Fix)
  • Subjective problems or those needing long-term tracking (such as politeness of replies or accuracy of information) get an Evals test case, monitored continuously by an LLM judge

‍

The key principle of this triage is:Do not throw every problem at Evals. Handle problems that can be fixed directly right away, and put the time saved into the "subjective quality that needs long-term monitoring." Many teams try to build fully automatic evaluation from the start, and the Evals end up so large that no one maintains them.

‍

Agent error analysis Steps 5-6: build and calibrate an LLM judge, and connect CI/CD monitoring

‍

Steps 5-6: how to design an LLM as judge and a Golden Dataset? How to connect CI/CD?

In short: use binary judgments instead of scores, to save time and reduce disputes

‍

Two methods are commonly used for Agent Evals, and in practice they are mostly combined:

‍

Method 1: LLM as Judge (AI as the referee). Have another LLM score the agent's output. Key design principle: use a binary judgment (TRUE or FALSE) instead of a 1-to-5 scale. The reason is that scales are vaguely defined (what separates 3.2 from 3.7?), while binary judgments have clear boundaries, suit automation and cause fewer disputes. After an LLM judge goes live, it must be sampled and reviewed by people regularly, usually 30 to 50 logs a month, to compute a "human vs LLM judge misalignment matrix." Calibrate agreement until it is high enough to be trusted, then keep refining the judge's prompt.

‍

Method 2: Golden Dataset comparison (verification against standard answers). A Golden Dataset is a test set with clear standard answers, used to verify critical paths that "cannot be wrong," such as SQL queries and RAG retrieval results. The advantages are high precision and automation; the drawbacks are that people must maintain the dataset and it is hard to cover open-ended Q&A.

‍

The table below lists the trade-offs of the two methods:

‍

This table compares two ways to implement Agent Evals. LLM as Judge uses AI as the referee and suits subjective qualities such as tone and correctness; it is flexible but needs calibration against humans. Golden Dataset verifies critical paths that cannot be wrong, such as SQL and retrieval, against standard answers; it is precise but needs people to maintain it. In practice the two are paired, each guarding one area.

‍

The practical advice is to pair the two methods: use a Golden Dataset to guard critical paths (the ones that cannot be wrong), and use an LLM judge to monitor overall quality (the subjective side). For multi-stage agent systems, see how to design the layers of a multi-agent system, then decide which Evals strategy each layer needs.

‍

Next comes CI/CD (continuous integration and continuous deployment) integration: connect the Evals process to the development and deployment pipeline, and run regression tests automatically after every model or prompt update, so old problems do not come back. This is the much-discussed EDD (Evals-Driven Development), the counterpart of TDD (test-driven development) in traditional software: write the evaluation metrics first, then adjust the product (change the model, prompt or tools), and use the evaluation results to decide whether to launch.

‍

Anthropic describes this idea as the "Swiss cheese model": no single evaluation layer can stop every problem, so multiple layers of protection (automated Evals plus production monitoring, A/B testing and user feedback) must be stacked to cover the blind spots [2].

‍

The three most common AI evals mistakes

In short: three traps you fall into the moment you step on them; a quick look saves half a year going the wrong way

‍

Mistake 1: believing AI can complete evaluation automatically.

‍

Many people think that with an LLM, evaluation can be fully automatic. But AI lacks product context and domain knowledge. For example, it does not know that your system has no "virtual home viewing" feature at all, so it cannot judge whether a given output is reasonable. In the early stage, human experts with domain knowledge still need to take part to ensure labeling quality.

‍

Mistake 2: using a 1-to-5 scale muddies the metrics.

‍

‍ Graded scales make metrics confusing and hard to track, since the difference between 3.2 and 3.7 is hard to explain. An LLM judge should address a single failure mode and use a binary (TRUE or FALSE) result, which improves consistency and automation efficiency.

‍

Mistake 3: blindly trusting the LLM judge's overall agreement.

‍

Looking only at "high overall agreement" misses long-tail errors, and the few disagreements may be exactly the high-risk scenarios. We suggest analyzing the misalignment matrix, checking all the crossing cases between humans and the LLM judge, and continuing to refine the judge's prompt.

‍

3 keys to making error analysis a team habit

In short: a process that actually runs matters more than a perfectly designed one

‍

After learning the 6-step process, many teams still get stuck in practice. Below are the three keys to putting it into practice that Data-DI consultants meet most often when coaching Taiwan companies:

  • Avoid bias in sample selection: looking only at extreme cases or a single scenario distorts evaluation results. We suggest sampling along at least three dimensions, feature, user role and query complexity, so the sample represents the real traffic distribution.
  • Make metrics quantifiable: avoid vague goals like "improve quality," and use specific figures such as "raise the customer service bot's first-turn intent accuracy from 72% to 85%."
  • Catch the chance of a model upgrade: when a new model comes out, a team with Evals can judge within days how it fares in your scenario and complete the upgrade, while a team without Evals needs weeks of manual testing [2].

‍

Error analysis is not just a tool for fixing bugs but the core engine that keeps an LLM agent system growing. With our help, many clients moved from a reactive "whack-a-mole every day" mode to a structured, measurable tuning process, and after launch their agents' customer complaints dropped noticeably and internal trust in AI rose with them.

‍

Is your agent system a fit for error analysis? A free 30-minute diagnostic

In short: talk through the current state in 30 minutes, then decide whether to do it

‍

Every company's agent system is in a different state: some are stuck on intent understanding, some on tool calls, and some are still deciding whether to adopt one. If you want to clarify where your system is actually stuck, Data-DI offers a free 30-minute AI agent diagnostic, in which a consultant reviews your current agent design, log structure and quick wins for tuning, and gives recommendations for your actual situation.

‍

You do not need to prepare data first; just tell us the tools and scenarios you use today. Data-DI does not just sell a tool for you to figure out alone. Consultants work alongside you from strategy to deployment and actually design the process with you, which is why most clients choose us. To clarify your next step in 30 minutes, book a free AI agent diagnostic.

‍

References

[1] Gartner. (2025). Gartner Predicts Over 40% of Agentic AI Projects Will Be Canceled by End of 2027. Gartner Newsroom.
‍https://www.gartner.com/en/newsroom/press-releases/2025-06-25-gartner-predicts-over-40-percent-of-agentic-ai-projects-will-be-canceled-by-end-of-2027

[2] Anthropic. (2026). Demystifying evals for AI agents. Anthropic Engineering Blog.
‍https://www.anthropic.com/engineering/demystifying-evals-for-ai-agents

[3] Ng, A. (2018). Machine Learning Yearning. deeplearning.ai.

[4] Breunig, D. (2025). How Long Contexts Fail. dbreunig.com.
‍https://www.dbreunig.com/2025/06/22/how-contexts-fail-and-how-to-fix-them.html

[5] iHower. (2025). What is error analysis for evaluating AI applications? (in Chinese). ihower blog.
‍https://ihower.tw/blog/12960-ai-evals-and-error-analysis

[6] Fortune. (2025). AI-powered coding tool wiped out a software company's database in 'catastrophic failure'. Fortune.
‍https://fortune.com/2025/07/23/ai-coding-tool-replit-wiped-database-called-it-a-catastrophic-failure/

[7] Appinventiv. (2026). How to Fix AI Hallucinations in Enterprise Apps. Appinventiv.
‍https://appinventiv.com/blog/ai-hallucinations/

FAQ

FAQ

FAQs about this article

What do eval and evals mean in Chinese?

Eval is short for evaluation, often translated into Chinese as 評估 or 評測. It is a test that gives an AI an input and then uses grading logic to check whether the output is good; the plural evals generally means a whole set of evaluation processes and test cases.

My AI agent keeps making mistakes. Where should I start investigating?

First compare against the four context modes of poisoning, distraction, confusion and clash. Then pick 20 to 50 failed conversations, label the first failure point by hand, have an LLM summarize the failure patterns and rank them by frequency, and lock in the tuning priorities.

How high is the failure rate for enterprise agent rollouts?

Gartner predicts that over 40% of agentic AI projects will be canceled by 2027, mainly because of unclear business value and inadequate risk controls. Error analysis locates failure patterns systematically and is key to lowering the failure rate.

How many conversation samples does error analysis need to get started?

Anthropic suggests starting by drawing 20 to 50 simple tasks from real failures, with no need to wait for hundreds. In the early stage of agent development every change has a large effect, so a small sample is enough to judge direction; expand once the system matures.

What is the difference between a Golden Dataset and an LLM judge?

A Golden Dataset verifies paths that cannot be wrong, such as SQL and retrieval, against standard answers, and is highly precise; an LLM judge uses AI as the referee to monitor subjective qualities such as tone and correctness. In practice the two are paired, each guarding one area.

Related articles

More articles

Newsletter

訂閱我們的電子報

每月 8 日定期發送最新趨勢與實用資訊!

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.