AI Explainers Developer Tools

Agent Evals Testing: How to Check Whether an AI Agent Actually Did the Job

Agent evals testing repeats the same task many times and grades the results, catching failures like an iced latte ordered as hot that logs never reveal.

Illustration of a robot agent beside a scorecard representing agent evals testing
AI-generated editorial illustration.

An AI agent orders a coffee for you and the order goes through without an error. But you asked for iced, and a hot latte arrives. How would the company behind that software ever notice? Agent evals testing is the answer: an eval gives an agent a task, grades the outcome, and repeats the process to measure how often the work comes out right.

Vercel’s engineering blog lays out this idea for people who build agents and for people who build the software agents use, such as APIs, command-line tools, MCP servers, and SDKs. This article walks through what an eval is, how the testing pyramid applies, and where OpenAI’s evaluation tooling fits.

What is an eval, and how is it different from a normal test?

A normal test asks whether something worked. An eval asks how often it works and how well, according to Vercel. You hand an agent a task, grade what happened, and combine the grades across many attempts.

Repetition is the key part. Vercel notes that large language model (LLM) output varies from run to run, so one good manual try cannot show whether a fix helped. The same set of tasks has to run before and after a change, with the results compared.

Two terms are worth defining. An agent is an AI system that takes steps on a person’s behalf, such as searching, choosing, and ordering. An MCP server is a way for software to expose its tools to an agent in a standard format.

Why do ordinary logs miss agent failures?

Vercel’s example is the wrong latte. The agent places a successful order, the request completes, and monitoring dashboards look healthy. Yet the result does not match what the user asked for.

This is the gap evals fill. Monitoring shows that a request ran. An eval checks whether the final outcome met the user’s actual requirements.

Where does success sit in the agent funnel?

Vercel observes that agents rarely see a product’s launch video or billboard, yet they pass through the same funnel a human does: Discovery, Selection, Access, and Success. Fewer agents make it through each stage, as with people. Evals can be built for any stage.

Vercel focuses on the last one. Success means the agent completes the user’s task correctly, which Vercel describes as harder to check than it sounds.

What is the agentic testing pyramid?

Vercel groups tests by how many LLM calls they typically need. The grouping works as a rough proxy for build effort, run time, and cost.

  • Deterministic tests use zero LLM calls. They check that the software itself behaves as expected.
  • One-turn evals use one call. They check a single agent decision, such as which command it runs first.
  • End-to-end (E2E) evals use two or more calls across a whole task. They let the agent work through a full job in an environment and then check the final result.

As in the classic software testing pyramid, Vercel says the cheap and fast tests should make up the bulk of a suite. The method is to start with the problem you want to catch and pick the lowest tier that can catch it. For Success, that is the top tier, because a task depends on a whole sequence of steps. Each step can look reasonable alone while the final outcome is still wrong.

Vercel points out that you may already know some E2E evals: popular coding benchmarks such as SWE-bench and Terminal-Bench work this way.

What does this look like with a coffee-ordering example?

Vercel imagines a fictional service called SF Beans, an API for ordering coffee in San Francisco, shipping a command-line tool for agents. A customer’s request reads: a large iced latte with whole milk, ready for pickup by 9:00, under $8 including tip, in the Mission.

At 8:30am the service knows four cafes, and only one fits every condition:

  • Fog City Roasters has a broken ice machine, so no iced drinks.
  • 24th St Beans lists the latte at $7.50, but the total reaches $9.27 after tax and tip, breaking the budget.
  • Dolores Drip is cheap at $5.50, but the earliest pickup is 9:20, breaking the time limit.
  • Valencia Grind costs $7.42 after tax and tip and is ready at 8:50, meeting all three conditions.

Each cafe fails a different constraint: temperature, budget, or time. Only a full run reveals whether the agent weighed all three. At the bottom of the pyramid, Vercel’s examples include a search command that returns only Mission cafes serving lattes, a quote that adds tax and tip correctly, and an order that charges exactly the quoted total. Those are ordinary deterministic checks with no agent involved. At the next tier, a one-turn eval asks whether the agent picks the right first command with the right arguments. The top tier asks whether the agent ends up ordering from Valencia Grind.

How do traces and graders fit in?

OpenAI’s developer documentation describes a related approach for agents built on its platform. It defines a trace as the end-to-end record of model calls, tool calls, guardrails, and handoffs for one run. Graders score those traces against structured criteria, which helps find regressions and failure modes at scale.

OpenAI calls trace grading the fastest way to identify workflow-level issues and lists the questions it can answer:

  • Did the agent pick the right tool?
  • Did a handoff happen when it should have?
  • Did the workflow violate an instruction or safety policy?
  • Did a prompt or routing change improve end-to-end behavior?

OpenAI’s documentation suggests starting with traces while behavior is still being debugged. Once a team knows what good looks like, it moves to datasets and repeatable eval runs, which suit benchmarking changes and comparing prompts over time. The documentation also mentions a prompt optimizer that uses a dataset to improve prompts automatically.

How do these approaches compare?

The two descriptions cover different layers of the same job. Vercel’s pyramid is a way to decide what kind of test to write, organized by how many model calls a test needs. OpenAI’s guidance is a workflow for one platform: inspect traces first, then formalize graders, then run repeatable datasets.

Both share the same underlying habits: define a task, record what the agent did, grade the result against criteria, and compare results after a change. The category is broader than either company. Coding benchmarks like SWE-bench and Terminal-Bench, which Vercel cites, apply the same principle to a different kind of task.

A realistic workflow for a small team

Consider a team that maintains a CLI that agents use to book appointments. Following Vercel’s pyramid, the team would first write deterministic tests confirming that search, quote, and booking commands return correct data. Next, it would add one-turn evals checking that an agent facing a typical request picks the right first command with sensible arguments.

Then comes the top tier: a handful of realistic requests with traps built in, like the SF Beans cafes that each break one constraint. The team runs each request many times, grades whether the final booking matches what the user asked for, and records a success rate. After changing the CLI’s help text or error messages, it reruns the same tasks and compares rates. If the team builds its agent on OpenAI’s platform, the same runs could be inspected as traces to see where a wrong tool choice or missed handoff occurred.

Where evals still need care

Evals measure only what their tasks and graders cover, so a thin set of tasks produces a flattering number. Vercel’s account describes the method and one worked example rather than reported results, and OpenAI’s page describes tooling rather than outcomes, so neither source shows how much evals improve real products. Anyone adopting this approach should check current documentation for how grading and costs work on their own platform, since higher tiers of the pyramid use more model calls.

Sources