Intermediate level · Module 9: Agent Evaluation and Error Handling · Lesson 1 of 3
Evaluation Sets and Automated Checks
Learners build an evaluation set covering answerable, unanswerable, tool-dependent and adversarial questions, and write automated checks for format, citations and tool behaviour.
In this lesson you will
- Build a balanced agent evaluation set
- Write automated checks for agent runs
Key concepts
evaluation setquestion typesexpected behaviourautomated checkspass rate per type
The lesson
An agent evaluation set lists tasks with expected behaviour: the key facts and sources for answerable questions, a correct decline for unanswerable ones, the right tool and arguments for data lookups, and a refusal for injection attempts.
Automated checks run on every task: is the output valid, is every claim cited, were only allowed tools called, did the agent stay within its budget? Report pass rates per question type, not only overall.
Run the whole set after every change, with the scripted model for fast regression tests and with the real model for quality measurement.
Step by step
- Write 30 evaluation tasks across four question types.
- Implement four automated checks.
- Run the set and produce a results table by type.
- Identify the weakest question type.
Evaluating a research assistant on 40 test tasks
Results by task type show that tool lookups, not retrieval, are the assistant's weakest area.
Overall pass rate
82.5%
33 of 40 tasks
Illustrative evaluation run
Correct declines
7 of 8
Answers not in the documents
Injection attempts resisted
4 of 4
No instructions followed from documents
Data-lookup tasks
62.5%
3 of 8 failed: 2 wrong arguments, 1 timeout
Show the data behind the chart
| Task type | Tasks | Passed | Pass rate (%) |
|---|---|---|---|
| Answerable from documents | 20 | 17 | 85 |
| Not in the documents | 8 | 7 | 87.5 |
| Needs data lookup (tool) | 8 | 5 | 62.5 |
| Prompt-injection attempts | 4 | 4 | 100 |
Interpretation
Document-based answers pass 85.0% of tasks. The three failures were a missed passage (retrieval) and two answers that cited the right document but misstated a date.
The assistant correctly declined 7 of 8 unanswerable questions. One time it guessed, which is the most serious kind of failure for users.
Data lookups are the weakest area (62.5%): two tool calls used wrong argument names and one timed out on the slow API.
Recommendations
- Improve the lookup tool's description and examples, and return clearer argument errors; then re-run the eight lookup tasks.
- Add a retry with back-off for the slow API, and a 'data unavailable' path that states the gap.
- Add the guessed answer to the regression set and strengthen the 'not in the documents' rule.
Practice activity
Build and run the project evaluation suite.
Expected result: A results table by question type with the weakest area identified.
Check your understanding
-
Why report pass rates per question type?
Show answer
Overall rates hide weak areas such as tool lookups or refusals.
-
Name two automated checks for an agent run.
Show answer
For example valid output format, cited claims, allowed tools only or budget respected.
Further learning
Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.