CommunicateAIBook a demo
← All posts

· 27 November 2026

How we test AI agents before your customers do

Evals and invariants let us improve an agent every week without breaking what already works.

An AI agent is not a normal program. Give it the same message twice and you can get two different answers. Change one line of its instructions to fix one conversation, and you can quietly break ten others.

Most teams find those breaks the same way: a customer finds them first.

We would rather find them ourselves. So we test our agents the way good engineers test software, with two kinds of test: invariants and evals.

Invariants: the rules an agent must never break

An invariant is a rule that must be true on every single turn of every conversation. Code checks it, and the answer is yes or no.

Some examples of the kind of rules we write:

  • An order-confirmation agent never confirms an address the customer did not say.
  • A law-firm intake agent never sends the engagement agreement before the caller accepts the firm’s disclaimer.
  • When a caller asks for a person, the agent passes the call to a person.
  • A reply never contains internal notes, code or the agent’s own instructions.

None of these is about style. They are the floor. If an agent breaks one, it does not matter how natural it sounded.

Evals: how good was the conversation?

Quality is not yes or no. Did the agent answer the question the customer actually asked? Did it handle the objection, or dodge it? Did it sound like a person, or like a form?

An eval scores those things. Some scores come from people reading transcripts. Others come from AI judges: a second model that reads the conversation and scores it against a written rubric.

Invariants protect the floor. Evals raise the ceiling. You need both.

Every bug becomes a test

When a real conversation goes wrong, we do not just tweak the prompt and move on.

Say a customer gives their postcode in two parts, across two messages, and the agent saves only the first part. First we write a check that fails on that exact conversation. Then we fix the agent until the check passes. The check stays forever.

Over time, an agent’s past mistakes turn into its safety net. The same bug cannot come back without us knowing.

Simulated customers

Before a change goes live, we run the agent against a set of simulated conversations. There is the cooperative customer, the one in a hurry, the one who objects, the one who switches language halfway through and the one who goes quiet.

Some of these conversations are our gold standard: we know what a good answer looks like. A change can make them better. It must never make them worse.

We save every run. That way we can compare the new version with the last one, conversation by conversation, before a real customer hears it.

The judges need testing too

AI judges are fast, but they can be wrong. A judge that scores a bad answer as good is worse than no judge, because it gives you false confidence.

So we test the judges as well. We run them on conversations where we already know the right verdict, and we only trust a judge that agrees.

The same goes for the numbers. If you measure the wrong thing, every decision you make from it is wrong. Even our measurements have checks.

What this means for you

  • We can improve your agent every week without breaking what already works.
  • Changing models is a measured decision. When a new model comes out, we run the same tests on it and compare. No guessing.
  • Your rules are written down. Your qualifying rules, your disclaimers and your handoff rules become checks the agent must pass, every time.

Testing is the least glamorous part of building an agent. It is also the reason an agent that works in a demo keeps working long after the demo.

If you are thinking about an AI agent for your business and want to know how it would be tested, tell us about it. We are happy to walk you through it.

David Ekanem

Founder, CommunicateAI

Builds voice and chat AI agents, and writes about how they work.