Topic 5 of 6 · 5 min read
Measuring agent output, errors and cost
Goal: Read an agent activity log with costs and find the errors, waste or unreviewed actions that need a change.
Treat an agent like a new hire on probation: keep a log of what it did, check a sample, count the errors and know what each task costs. Without those numbers you are guessing that it works.
Check yourself · 1 of 3
Why should a weekly review of agent work use a random sample rather than only the cases people flagged?
Why it matters
Agents fail quietly. A wrong answer looks the same as a right one. In Anthropic's Project Vend test, an AI ran a small shop and gave out many discounts when people asked, and at one point told customers to pay into an account that did not exist. Nobody noticed from the outside because the replies sounded confident. A log and a review would have shown the pattern.
What to track
- An activity log. For each action: time, task, what the agent did, which tool it used, the result and whether a person approved it. If you cannot see what it did, you cannot check it.
- A sampled review. Read a fixed share of the work, for example 20 of 200 tickets each week. Mark each as right, minor error or serious error. Start with a high share and lower it as results hold.
- An error rate. Serious errors divided by items reviewed, tracked week by week. One number is useless; the trend tells you if it is getting better.
- Cost per task. Add the model usage and tool fees and divide by tasks done. Compare it to what the same task cost when a person did it, including the time spent reviewing.
- Unreviewed actions. Count actions that took place with no approval and no sample. This is where silent mistakes live.
Before and after
Before: "The agent has been running for a month and it seems fine."
After: "In March the agent handled 640 tickets at 0.18 dollars each. We reviewed 64. Two had serious errors, 3 percent. Both were refunds paid twice, so we added a duplicate check and set the review share to 20 percent until a month with no serious error."
What goes wrong
- Counting only the cheap part. The model bill is small, but the review time is not.
- Reviewing the easy cases. A sample must be random or it shows only the good work.
- Looping. An agent that retries a failing step can spend far more than planned. Set a spending limit per task and per day.
Examples
Reading one log
14:02 refund_issued order 8841, 62.00, approved_by none 14:03 refund_issued order 8841, 62.00, approved_by none
Two identical refunds with no approval. This needs a duplicate check, and the approval limit should be below 62 dollars.
A weekly numbers line
Week 12: 210 tasks, 21 reviewed, 1 serious error, cost 41 dollars plus 3 hours of review. Next step: keep the 10 percent sample, add a check for the error type.
Key points
- Log every agent action with the tool used, the result and whether a person approved it.
- Review a random sample of the work and track the serious error rate over time.
- Work out cost per task, including the people's time spent on review.
- Count unreviewed actions, because silent mistakes hide there.
- Set spending limits so a looping agent cannot run up a large bill.
Common mistakes
- Judging an agent by how confident its answers sound.
- Reviewing only the cases that were flagged, not a random sample.
- Counting only the model bill and ignoring review time.
- Having no spending limit, so a loop becomes an expensive surprise.
Check yourself · 2 of 3
An agent handled 400 tasks in a week and a person reviewed 40. Four had serious errors. What is the serious error rate?
Check yourself · 3 of 3
Which number is most often left out when a founder says an agent saves money?
Practice items, not counted towards your mastery.
Start here
- Building effective agents (Anthropic) (opens in a new tab)ArticleFree
Start simple, add checkpoints for human feedback, and pick agents only where they earn their cost.
- Project Vend: can Claude run a small shop? (Anthropic) (opens in a new tab)ArticleFree
A real test of an AI running a shop: where it worked, and where it gave away discounts and invented a payment account.
- AI Risk Management Framework (NIST) (opens in a new tab)StandardFree
A free, widely used framework for governing, mapping, measuring and managing AI risk.