---
title: AI agent evaluation: how to test AI agents before you trust them with customers | Codivated
canonical: https://www.codivated.com/insights/how-to-evaluate-ai-agents/
---

[Home](https://www.codivated.com/)/[Insights](https://www.codivated.com/insights/)Guide · Evals · 12 min read

# How to evaluate AI agents before you trust them with customers (worked example: a sales agent)

By the Codivated team · Updated November 24, 2026

Evaluate an AI agent the way you'd check a new hire, but every night and on hundreds of cases: scenario tests before launch, an eval set scored by an LLM judge against a written rubric, people giving thumbs up or down in production, spot checks of real conversations, and nightly simulations that catch drift before customers do. Then decide in advance what you'll do when a score drops. Most agents that fail in production were never tested this way, which is why teams are afraid to change them.

## Why do AI agents need their own kind of testing?

Normal software gives the same output for the same input, so a unit test passes or fails. An agent doesn't. It reads a messy message, decides what to do, calls tools and writes a reply, and two runs of the same case can differ. So you test behavior across many realistic cases and score the results, rather than checking one exact answer. The payoff is confidence to change things. Our team regularly finds agents running on year-old models because nobody dared to upgrade them without tests. With an eval suite, upgrading is a measured decision, and it's often cheaper and better.

## What are the six layers of AI agent evaluation?

| | Layer | When it runs | What it catches

| 1. Scenario tests | Before launch and on every change | Wrong decisions on realistic conversations, including edge cases

| 2. Eval set with an LLM judge | On every change, and when you swap models | Quality slipping across a fixed set of past cases

| 3. Human thumbs up or down | In production, every day | What real users think, in their own words

| 4. Trace checks on samples | Weekly, on a sample of real runs | Tool calls, data lookups and replies that look fine but are wrong

| 5. Nightly simulations | Every night | Drift from model updates, prompt edits or changed data

| 6. A plan for when a score drops | Decided before launch | Panic edits, and broken agents left running

You don't need all six on day one. Scenario tests and a small eval set come before launch. The rest come in the first month of production.

## Layer 1: how do you write scenario tests for an agent?

A scenario test plays a realistic conversation against the agent, with a simulated user, and checks what the agent did, not just what it said. For each scenario, write down who the user is, what they want, and what a good outcome looks like: the tool it should call, the record it should update, the thing it must never say. We use the open-source Scenario framework from LangWatch for this, but any framework that runs a simulated user against your real agent will do.

Start with the cases your best person handles every week, then add the ones that scare you: the angry customer, the request outside policy, the user trying to get the agent to break its rules. A prompt rule that says "don't do X" is not protection. A scenario that tries to make it do X, and fails, is.

## Layer 2: how do you use an LLM as a judge?

Some things a script can check: did it call the CRM, did it book the meeting. Others need judgment: was the reply accurate, on brand and not pushy. For those, a second model grades each answer against a written rubric. The rubric matters more than the model. Make each item a yes-or-no question a person would agree on, and test the judge against a few dozen answers you've graded yourself before trusting it.

Keep the eval set fixed, built from real past cases with known good outcomes, so scores are comparable over time. Run it on every change. When a new model comes out, run it on the new model too: the cheapest model that scores the same is the one to use.

## Layer 3: why collect thumbs up and down in production?

Because users notice things your tests don't. A thumbs up or down on each answer, with an optional comment, is the simplest signal you'll get. When someone thumbs down an answer, that case goes into your eval set, so the agent is tested on it from then on. Over time, your eval set becomes a record of every way the agent has disappointed someone.

## Layer 4: what should you look for in traces?

A trace is the full record of one agent run: what came in, what it looked up, which tools it called, what it decided and what it sent. Tools like Langfuse store them. Each week, read a sample, and have an LLM judge score a larger sample with the same rubric, so you can confirm production matches what you tested. Look for answers that sound right but used the wrong record, tools called twice, slow steps and rising costs. Our team ran lead follow-up agents that handled about 80,000 leads a month this way, with tracing on every conversation.

## Layer 5: what do nightly simulations catch?

Models get updated, prompts get edited and your data changes. A nightly run of your scenarios and eval set catches the slow drift that nobody notices day to day. Have the agent grade a sample of its own runs too, flagged for a person when it's unsure. A score that drops overnight with no change on your side usually means the model or a connected system changed.

## Layer 6: what do you do when a score drops?

Decide it before launch, and write it down:

- Who looks at it, and how fast. An owner, by name.
- What pauses. For a big drop, the agent goes back to practice mode, where a person approves every action, until it's fixed.
- How changes are made. Every prompt or tool change goes through the same tests and is logged with who made it and why. Editing prompts in production without tests is how good agents get worse.

This is what practice mode is in our [First Agent Sprint](https://www.codivated.com/how-we-engage/): the agent works on real cases while people approve its actions, and the scores decide when it earns more freedom.

## Worked example: how do you evaluate an AI sales agent?

Say the agent answers inbound leads by SMS and email, qualifies them and books a call with a rep. Run the same account list through it every time, so scores compare, and grade each conversation with a checklist like this:

| | # | Check | How to score it

| 1 | Replied within the target time | Script: timestamp

| 2 | Answered the lead's actual question | Judge: yes or no

| 3 | Every fact matched approved information | Judge plus spot check: yes or no

| 4 | Asked the qualifying questions, without interrogating | Judge: yes or no

| 5 | Qualified or disqualified correctly | Compare to a person's call on the same lead

| 6 | Booked the meeting, or handed off to a person when it should | Script: calendar and CRM record

| 7 | Wrote the result back to the CRM correctly | Script: field check

| 8 | Stopped when asked, and respected quiet hours | Script: opt-out and time rules

| 9 | Sounded like your brand, not pushy | Judge: yes or no

| 10 | Never promised price, terms or anything outside policy | Judge plus scenario tests: yes or no

Score the share of conversations that pass each check, and track the business number alongside it. In our own lead follow-up work, the number that mattered was the share of leads that turned into qualified opportunities, compared with the process it replaced. More on the agent itself in [AI lead follow-up](https://www.codivated.com/use-cases/ai-lead-follow-up/).

## What does good look like?

There's no universal pass mark. Set yours before launch from two numbers: how your best person does on the same cases today, and what a mistake costs. Hard rules, like never promising a price or ignoring an opt-out, should pass every time. Judgment checks should match or beat your person. Then watch the trend: a steady score after a model change, a prompt edit or a new data source is what lets you make that change with confidence.

First Agent SprintFind and build your first agent in two weeks.A ranked plan, an ROI model and a first working agent in practice mode, for a fixed $15,000.

[See what the sprint includes](https://www.codivated.com/ai-readiness-assessment/)

## Common questions

### How do you test AI agents?

With scenario tests that play realistic conversations against the agent, an eval set of real past cases scored by an LLM judge, and nightly runs of both. In production, add thumbs up or down from users and weekly checks of sampled traces.

### What is LLM-as-a-judge?

Using a second AI model to grade an agent's answers against a written rubric. It works when each rubric item is a clear yes-or-no question and you've checked the judge's grades against your own.

### Which metrics should you track for an AI agent?

Pass rates on each rubric check, hard-rule violations, thumbs-down rate, cost and time per run, and the business number the agent exists to move, such as qualified leads or hours saved.

### How often should you evaluate an AI agent?

On every change, every night, and on a weekly sample of real runs. Re-run everything before switching models.

### What's the difference between AI agent testing and AI agent monitoring?

Testing runs before a change goes live, on cases you control. Monitoring watches real runs in production, with traces, user feedback and alerts when scores drop.

### Do you need special tools for agent evaluation?

Not to start. A spreadsheet of cases and a written rubric go a long way. Tools like LangWatch Scenario for simulations and Langfuse for traces make it repeatable.

## Sources

- [Scenario](https://github.com/langwatch/scenario), LangWatch: open-source agent simulation testing.
- [Langfuse](https://langfuse.com/): open-source LLM tracing and evaluation.

Written byThe Codivated teamWe build and run AI agents for established companies.[Scope your first agent](https://www.codivated.com/contact/)

## Find your first agent in two weeks.

[Scope your first agent](https://www.codivated.com/contact/)Free 30-minute call.
