Agentic AI · Intermediate level

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

  1. Write 30 evaluation tasks across four question types.
  2. Implement four automated checks.
  3. Run the set and produce a results table by type.
  4. Identify the weakest question type.
Dashboard

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

Pass rate by task type (%) Pass rate (%): Answerable from documents 85, Not in the documents 87.5, Needs data lookup (tool) 62.5, Prompt-injection attempts 100 0255075100Answerable …Not in the …Needs data …Prompt-inje…
Show the data behind the chart
Task typeTasksPassedPass rate (%)
Answerable from documents201785
Not in the documents8787.5
Needs data lookup (tool)8562.5
Prompt-injection attempts44100

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

  1. Why report pass rates per question type?

    Show answer

    Overall rates hide weak areas such as tool lookups or refusals.

  2. 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.