Skip to content
Carbonfay
RU

service

Testing and Evaluating AI Agents

Testing and evaluation of AI agents, chatbots and LLMs: red teaming, hard-customer simulation, dialog quality metrics and resilience to hallucinations — why green tests don't mean a working product.

Cases

“The agent passed the tests” and “the agent works” are not the same thing. Most conversational AI agents pass their tests and fail with real people, because tests are written by those who know the system and unconsciously help it. A real user almost never helps. We test AI agents, chatbots and LLMs the way reality breaks them — and we measure maturity not by the number of green runs but by the quality of the red ones the system has already survived.

Why “green tests” don’t mean a working agent

A test written by a human carries a built-in bias toward success: the wording is precise, there are no contradictions, there’s a single branch. Modern development environments amplify that bias — they simplify the scenario, fix the input, pick the most likely branch. The system subconsciously helps itself pass. As a result, testing AI agents and LLMs shows not how the agent works, but how it looks under convenient conditions. A green report isn’t proof — it’s a comfortable illusion.

Red teaming for conversational AI

For a check to be honest, you need a loop interested in red, not green. A developer can’t be that loop by construction: they test their own expectations. You need an independent opponent agent whose goal is to prove the agent fails: confuse it, lead it astray, catch it in a contradiction, make it invent an answer. It’s the same logic pentesters use in security, applied to conversational AI. “AI red team” is no longer exotic — it’s a separate engineering discipline, and dialog systems need it no less than infrastructure does.

Agent versus agent: a customer simulator that wants to break it

The best tester of a dialog agent is not a human but another agent. The architecture is simple: a customer simulator runs a dialog with the target agent, and a third one, the judge, evaluates the outcome. The key point is the simulator’s task: not “help pass the test” but maximally obstruct reaching the goal. Plain LLMs play the customer badly — within a few turns they start answering to the point and helping. So the simulator is given behavior models a naive test lacks: anxious, conflict-prone, forgetful, suspicious, impulsive, bored. This is multi-agent verification applied to quality.

Metrics that actually reflect dialog quality

An agent’s quality is defined not by the right answer but by resilience to noise: topic shifts, contradictions, false memories, new constraints, emotion, returning to old questions. That’s why chatbot metrics like “percentage of correct answers” are misleading. The working indicators are different: the share of dialogs carried to the goal after twenty minutes of chaos; the share of correct handoffs to a human; the rate of confident errors on unreliable input. A good agent isn’t the one that answers correctly — it’s the one that doesn’t lose the goal when the dialog falls apart.

Hallucinations and unreliable input

It’s not only the model that lies. The user regularly reports wrong data — budget, dates, constraints, the purpose of the trip — and not out of malice. So evaluating an LLM and an agent must account for two sources of unreliability at once: model hallucinations and human error. An agent that blindly trusts the input is reliable only in a test. In production it must validate motivation, not just facts, and work calmly where the input is knowingly “dirty”.

Testing on real dialogs, not synthetics

Synthetic scenarios are almost useless: they test the developer’s imagination. The source of truth is real chats, calls and support tickets. They are what should form the test corpus: thousands of live dialogs show how people actually stumble, re-ask and change their minds. Testing chatbots on this corpus catches what synthetics never will — and moves the quality conversation from “we think” to “we measured on real people”.

Where this decides money and risk

An agent that hasn’t been truly tested isn’t a saved budget — it’s a deferred loss: a bot that answers nicely but never closes a sale, or confidently tells a customer the wrong thing and damages the brand. Honest testing removes both risks before the agent meets a customer. For the business that means: before launch — a clear picture of where the agent can be trusted and where a human is mandatory; after — predictable behavior instead of “let’s see how it goes”.

Why this, not “we ran the scenarios — it’s green”

The classic cycle “build a feature → write a test → get green” is not enough for agents. You need a different loop: build the agent → build an attacking agent → get red → fix → get a new red. The maturity indicator of a dialog system is not the number of green tests but the quality of the red ones it has already withstood. We build this loop as part of AI agent development, not as a separate checkbox at the end.

Go deeper

faq

Straight answers

What does it mean to "test an AI agent"?
Not "run pre-written scenarios and get a green report". Testing an agent means checking whether it holds the goal when the user behaves like a real person: switches topics, contradicts themselves, gives wrong data, returns to old questions. A scenario written by someone who knows the system tests the developer's expectations, not the customer's behavior.
Why does conversational AI need a red team?
A developer testing their own agent tests their own expectations: they unconsciously hint and steer the dialog down the "right" branch. A red team is an independent loop interested not in a green report but in proving the agent fails. Like a pentest for security, but for dialog. "AI red team" is already a distinct engineering practice, not an exotic add-on.
How do you measure a dialog agent's quality?
Not by accuracy on a single question. The working metric is resilience: the share of dialogs where the agent reached the goal despite topic shifts, noise and contradictions; the share of correct handoffs to humans; the rate of confident errors (hallucinations) on unreliable input. One correct answer in a greenhouse test says nothing about revenue.
Why does an agent pass tests but fail with real customers?
Because tests and reality are different environments. In a test the user is cooperative and precise; in production they're chaotic, don't know what they want, and get the facts wrong. You can have 95% green tests and almost no impact on sales if you checked knowledge of facts, not handling of doubt and holding the dialog. The fix is testing against a corpus of real conversations.

related cases

Next step

Let's design an AI-native automation layer for your operations.

DBCV