What is grading an agent?
A chatbot is tested by comparing its answer with a known one. An agent takes actions, so its words are not enough. The test is a task, a starting state, and a way to check the state afterwards: does the refund exist, once, for the right amount?
The path matters as well as the result. An agent that reached the right result by reading another customer's order has failed. So the list of steps it took is checked against rules, by code where possible.
Agents do not behave the same way twice, so each task is run several times and the score is a rate. Tasks are run in a practice copy of the real systems that is reset before every run.
Qualities that code cannot check, such as tone, are scored by a second model with a written rubric, and that judge is itself checked against a person's scores. Steps, time and cost per task are recorded alongside.
Why does grading an agent matter?
An agent can say exactly the right thing and have done nothing, or the wrong thing. Comparing its reply with an expected reply misses this entirely. Because agents act, they have to be tested on the state they leave behind and on how they got there, and tested many times, since they do not behave the same way twice.
How does grading an agent work?
- Write each test as a starting state, a task, and a check on the state afterwards.
- Run the agent in a practice copy of your systems, reset before every run.
- Check the end state with code: did the right thing happen, exactly once?
- Check the path: were any forbidden steps taken on the way?
- Run each task several times, and score by kind of task.
When should you use grading an agent?
Use it when
- An agent takes actions, not only answers questions
- Before any change to its prompt, tools or model
- Deciding whether it is ready for real users
Think twice when
- The product only answers questions. Ordinary evals are enough
Where does grading an agent sit in a real system?
Agent evals run in an environment built for the purpose: fake customers, fake money, tools pointed at practice systems. They run automatically on every proposed change.
What goes wrong with grading an agent?
- Grading the agent's final message and not what it did.
- Running each task once.
- Testing only ordinary requests, and none where a tool fails or a user tries to cheat.
What does grading an agent look like in practice?
A support agent passes "refund the broken stove" 7 times in 10. Broken into milestones, it finds the order 98% of the time and completes the refund 74%. The failure is at the refund tool, not in how it searches.