# What Should You Test in AI Agent Evals? Start From Failures, Not Features

> Which cases belong in an AI eval suite? Start from real failures, test what code can check with code, use a judge for the rest, and begin with 5 to 10 cases.

Page: https://datautility.in/blog/what-to-test-in-ai-agent-evals-start-from-failures
This is the Markdown copy of the page. The tool itself runs in the browser: your files are processed on your own device and are not uploaded.

Published 2026-11-29 · Analyze & protect · what to test in ai evals, agent evals, how to write evals for ai agents, ai evals for beginners, eval cases from failures, llm eval best practices, how many eval cases

Short answer: do not write one eval case per feature. Collect the ways your app has actually failed, move everything a normal test can check into normal tests, and write eval cases only for behaviour that needs a model to judge it. A small suite of 5 to 10 good cases beats a large imagined benchmark. This guide shows the steps, and you can practise them free in the Evals Lab.

Open the tool: [Evals Lab](https://datautility.in/ai-evals-lab)

## Why "one case per feature" fails

A list of features gives you a suite that tests what you thought of, in the words you thought of. Real failures are stranger. The cases that protect you are the ones that came from something that went wrong: a wrong answer a user reported, a tool called with the wrong argument, a made-up fact in a summary.

## The method in six steps

1. **Collect failures.** Take 10 to 20 real examples from logs, user reports or your own testing where the output was wrong. If you have none yet, use the app for an hour and write down what breaks.

2. **Name the cause of each one.** Wrong retrieval, a made-up fact, the wrong tool, a missing field, an answer that ignored the question.

3. **Push down everything a normal test can check.** If code can decide pass or fail, write a unit test or a plain assertion. It is cheaper, faster and never flaky.

4. **Write eval cases for what is left.** These are the cases where you need a model to judge meaning, or a check on the steps the agent took.

5. **Repeat each case.** Models are not deterministic, so one pass proves little. Run each case several times and look at how stable the result is.

6. **Keep every fixed failure as a regression case.** When you fix a bug, its case stays in the suite.

## Where each kind of failure belongs

| Failure | Where to test it |
|---|---|
| The output is not valid JSON, or a required field is missing | Unit test or schema check |
| A forbidden word, a leaked secret, a wrong format | Deterministic check |
| The wrong tool was called, or in the wrong order | Check on the steps taken (trajectory) |
| The answer is wrong, or invents facts | LLM judge with a rubric |
| The answer ignores what the user asked | LLM judge with a rubric |

Run the cheap checks first. There is no reason to pay for a judge call on an answer that is not even valid JSON.

## How to avoid testing wording

- Grade **facts and behaviour**, not exact phrases. "Mentions the 30 day refund window" is a good criterion. "Says exactly: Refunds are available for 30 days" is not.

- Write the judge rubric in terms of what must be true, and what must not be.

- Plant a wrong expected answer on purpose. If your judge still passes it, the judge is the problem.

## How many times to repeat a case

There is no magic number, and the right count depends on how much your results move. A reasonable start is a few runs per case: if the scores are the same each time, you are fine, and if they jump around, the case or the judge is too vague. Watch cost and time too, because every repeat is another model call.

## Practise the loop in the Evals Lab

The [Evals Lab](https://datautility.in/ai-evals-lab) is a free lab in Docker for the answer-quality part of this. It has a project with a golden set (`goldens.csv`), an `agent.py` to connect your own app, `eval_criteria.py` with DeepEval G-Eval criteria, and `run_eval.py`. Every run is tracked in MLflow, so you can compare a run before and after a fix.

It is built around question-and-answer apps (RAG). It does not record full agent tool trajectories for you, so write those checks as plain Python assertions next to it.

## Further reading

For more on layering unit tests, deterministic checks and judges, see [Google's guide to evaluating AI agents](https://developers.googleblog.com/evaluating-ai-agents-moving-past-the-vibe-check/) and [Splunk's agent evaluation framework guide](https://www.splunk.com/en_us/blog/artificial-intelligence/agent-evaluation-framework.html).

## How to use the Evals Lab: step by step

1. Collect 10 to 20 real failures
2. Move what code can check into normal tests
3. Write 5 to 10 eval cases for the rest
4. Repeat each case and compare runs

## When to use the Evals Lab

- Starting an eval suite for a new agent or RAG app
- Deciding what belongs in tests and what in evals
- Turning production failures into regression cases
- Practising evals before using them at work

## Example

Input:

```
northwind_support_handbook.txt, chunked and stored in ChromaDB
```

Output:

```
A score and a reason for every answer, and each run logged in MLflow
```

## Frequently asked questions

### What should I test in AI agent evals?
Start from real failures. Test anything code can check with normal tests, and write eval cases for behaviour that needs a model to judge meaning or a check on the steps taken.

### How many eval cases do I need to start?
Five to ten good cases built from observed failures are better than a large imagined benchmark. Add a case every time you fix a bug.

### How do I stop my evals from just testing wording?
Grade facts and behaviour, not exact phrases, and write the rubric as what must be true. Plant a wrong answer to check that your judge fails it.

### How many times should I run each eval case?
There is no fixed number. Run each case several times and look at the variation. If the scores move a lot, the case or the judge is too vague.

Tip: When you fix a bug, add its case to the suite the same day. A suite built from fixed failures grows in the right direction.

## Related tool pages

- [LLM as a Judge Playground: Grade AI Answers Free](https://datautility.in/llm-as-a-judge-playground): Try LLM as a judge free on your laptop: write a judge prompt or a DeepEval G-Eval metric, run it on every test question and read a score and a reason for each answer.
- [RAG Evaluation Playground: Test Chunking and Retrieval](https://datautility.in/rag-evaluation-playground): Evaluate a RAG app free on your computer: chunk a document into ChromaDB, test retrieval by meaning, grade every answer and compare chunk sizes side by side in MLflow.
- [DeepEval Playground: Try G-Eval Free on Your Laptop](https://datautility.in/deepeval-playground): Learn DeepEval hands-on, free: a Python IDE with a ready G-Eval project, goldens.csv, your own Gemini, Claude or OpenAI key and MLflow tracking. Runs in Docker.
- [Chunk a Document Into ChromaDB: Free Local Vector DB](https://datautility.in/chromadb-playground): Upload a document, pick a chunking method and see every chunk and vector stored in ChromaDB, free in Docker. Then connect your own AI agent to that database. No API key.

## Also try

- [Deterministic checks or an LLM judge?](https://datautility.in/blog/deterministic-checks-vs-llm-judge-when-to-use-which)
- [How to build a golden dataset](https://datautility.in/blog/how-to-build-golden-dataset-ai-evals)
- [Can you trust an LLM judge?](https://datautility.in/blog/can-you-trust-llm-as-a-judge-check-your-judge)

## More guides

- [Data Profiler: Check Data Quality Before You Use It](https://datautility.in/blog/data-profiler-check-data-quality)
- [Compare Two CSV or Excel Files: Find Added, Removed and Changed Rows](https://datautility.in/blog/compare-two-csv-files-find-differences)
- [Data Masking: Hide Emails, Phones and Names Before Sharing](https://datautility.in/blog/data-masking-hide-emails-phones-pii)
