Why an agent needs more than a prompt test
A chatbot answers. An agent acts: it chooses a tool, fills in arguments, reads the result and decides what to do next. That adds failure modes a single-prompt test never sees.
- Right answer, wrong action. The reply reads well while the call behind it used the wrong customer id or skipped a required confirmation.
- Errors compound. A bad choice in step two changes everything after it. The final answer may look fine or may be wrong in a way that is hard to trace without the step log.
- Testing can cause damage. An agent that can send email, issue refunds or edit records will do so during a test unless the harness stops it.
So the unit of testing is the task: a goal, a starting state, the tools available, and a definition of done.
What one task case records
| Field | Example |
|---|---|
| Goal | Move the customer’s booking to the next available date |
| Starting state | Test account with one confirmed booking and one cancelled booking |
| Tools available | Booking search, booking update, email (stubbed) |
| Done when | One booking exists on the new date, the old one is released, one email is queued |
| Must not | Touch the cancelled booking; send more than one email; change the price without asking |
| Failure handling | If booking update returns an error, retry once and then tell the user |
Every run of the case is scored against those fields, and the step log shows where a failed run went wrong.
Where it runs
The task set, the stubs and the scoring code live in your repository next to the agent. A CI job runs them when the model, the prompt or a tool definition changes, and on a schedule. The tools themselves and their API contracts are deterministic and get ordinary automated tests. If your agent is customer-facing, AI chatbot testing covers the conversation side; for the wider area, see AI testing services.