Skip to content
infusyc

AI Agents

How to test an AI agent before you let it talk to customers

A practical evaluation process for AI agents: building a test set, scoring answers, catching failure modes and deciding when an agent is ready to go live.

By Fareed

Close-up of colourful source code on a monitor

Why demos are not tests

Almost every AI agent looks impressive in a demo. The person building it asks the questions they expect, in the way they expect, and the agent performs. Real customers are different: they misspell names, ask two things at once, change their minds halfway through and raise problems nobody anticipated.

An evaluation process closes the gap between the demo and the real world. It is the single biggest difference between agents that quietly get switched off after a month and agents that keep running for years.

Step 1: build a test set from real conversations

Start by collecting 50 to 200 real examples of the work the agent will do. For a support agent that means past tickets, chat transcripts or call notes. For a booking agent it means the requests your front desk actually receives. Remove personal data, then write down what a good outcome looks like for each one.

Make sure the set includes the awkward cases, not just the easy ones:

  • Ambiguous requests where the agent should ask a clarifying question.
  • Questions your documentation does not answer, where the right response is "I don't know" and a hand-off.
  • Sensitive situations such as complaints, refunds, medical or legal topics, where escalation is mandatory.
  • Attempts to push the agent off-topic or get it to ignore its instructions.
  • Multi-step requests that require two or more tools in the right order.

Step 2: decide how you will score it

Every test case needs a pass or fail rule. Some can be checked automatically: did the agent call the booking tool with the right date, did it include a link, did it refuse to give a price it was not allowed to give. Others need judgement, such as whether the tone was right or the answer was complete.

For judgement calls, write a short rubric and have a person score a sample. Many teams also use a second model as a grader, which is useful for speed, but spot-check its decisions regularly because graders can be wrong in consistent ways.

Step 3: look for patterns, not just a score

A single accuracy number hides the information you need. Group failures by type: missing knowledge, wrong tool used, tool used with bad inputs, tone problems, failure to escalate. Each type has a different fix. Missing knowledge means updating the source documents; wrong tool use usually means clearer tool descriptions; failure to escalate means tightening the rules.

Step 4: shadow mode on live traffic

Once the agent passes your test set, run it alongside your team on real traffic without letting it act. It drafts replies or proposed actions; a person approves, edits or rejects them. Track the approval rate. When it is consistently high for a category of requests, switch on autonomy for that category only.

Step 5: keep testing after launch

Every change to the prompt, the model, the tools or the knowledge base can break something that used to work. Re-run the test set before each change goes live, and add every real-world failure to the set so it never happens twice. Over time the test set becomes one of the most valuable assets in the project.

A simple go-live checklist

  • Passes the agreed threshold on the test set, including every safety-critical case.
  • Escalation to a person works and arrives with full context.
  • Every action is logged and can be reviewed.
  • Customers are told they are speaking with an AI assistant.
  • Someone owns the agent and reviews a sample of conversations each week.

Want help applying this? See our services or talk to the team.