Blog

AI & Machine Learning

Before You Put an AI Agent in Front of a Client: The Checks We Run

Before You Put an AI Agent in Front of a Client: The Checks We Run

Test an AI agent before launch with an evaluation set, idempotent writes, a shadow run, approval on risky actions and logs. The checks, step by step.

Test an AI agent before launch with an evaluation set, idempotent writes, a shadow run, approval on risky actions and logs. The checks, step by step.

7 min read
Mehmet, Vizio AI Tech Lead, leading software development, technical architecture, and digital product delivery.
Mehmet Can Duvarci
Head of Tech

Blog

AI & Machine Learning

Before You Put an AI Agent in Front of a Client: The Checks We Run

Test an AI agent before launch with an evaluation set, idempotent writes, a shadow run, approval on risky actions and logs. The checks, step by step.

7 min read
Mehmet, Vizio AI Tech Lead, leading software development, technical architecture, and digital product delivery.
Mehmet Can Duvarci
Head of Tech
Dithered illustration of a marble hand striking a great cast bell with a small mallet inside a foundry tower, the point of contact in red.
logo of Facebook
logo of X
logo of LinkedIn
logo of Reddit
logo of Telegram
Contents
No headings found on page

To test an AI agent before it goes live, run it against a set of checked tasks, grade what it actually changed rather than what it said, make every write safe to retry, run it in shadow beside the current process, and require approval for risky actions until the results earn trust. Then keep logging and re-testing after launch.

Picture an agent that handles refund requests for an online shop. In the demo it reads the ticket, checks the order, issues the refund and replies to the customer. Two weeks after launch, finance finds a handful of customers refunded twice. The payment provider timed out, the agent retried, and both calls went through. Nothing in the demo could have shown this, because nothing in the demo ever timed out.

What does testing an AI agent involve that normal software testing doesn't?

Testing an agent means testing decisions as well as code: the same input can lead to different tool calls on different runs, so one passing run proves little. You need many runs per task, graders that check the result, and controls that limit the damage when a run goes wrong.

Three things make agents different:

  • They are nondeterministic. The model can pick a different path each time, so a test has to be repeated.

  • They act on other systems. A wrong answer in a chatbot is text; a wrong action in an agent is a refund, an email or a changed record.

  • They read untrusted input. Tickets, emails and web pages can contain instructions the agent should ignore.

If you need a refresher on where agents end and workflows begin, see What Is an AI Agent, Really?.

How do you build an evaluation set for an AI agent?

An evaluation set is a list of realistic tasks, each with a known correct outcome and a way to grade it automatically. Anthropic's engineering team defines an eval as "a test for an AI system: give an AI an input, then apply grading logic to its output to measure success."

Where the tasks come from

Start from real work, not invented prompts. Pull tickets, requests or cases from the process the agent will take over, including the awkward ones: missing data, angry customers, requests that should be refused. Anthropic's guide on evaluating agents says "20-50 simple tasks drawn from real failures is a great start."

Grade the outcome, not the transcript

A transcript is the full record of what the agent did in one run; the outcome is the state of the systems afterwards. Anthropic's example is a flight-booking agent that says "Your flight has been booked", where "the outcome is whether a reservation exists in the environment's SQL database." Check the database, the CRM record or the payment log, not the agent's final message.

Run each task more than once

Because runs vary, run each task several times. Anthropic describes two measures: pass@k, the chance that at least one of k attempts succeeds, and pass^k, the chance that all k succeed. For an agent that acts for clients, pass^k is the one that matters: it has to work every time, not once in a while.

Keep the set and re-run it after every change to the prompt, the model, the tools or the data. Anthropic calls these regression evals: they ask whether the agent "still handle[s] all the tasks it used to".

How do you stop an agent from taking the same action twice?

Make every write idempotent: give each action a unique key so that a retry returns the first result instead of acting again. Idempotency means doing something twice has the same effect as doing it once.

A marble fingertip turning a stone ratchet wheel one notch, with a red pawl holding it in place

Duplicates come from ordinary failures: a timeout, a crashed worker, a model that calls the same tool twice in one plan. The fix sits in the tools, not the prompt.

  • Use the target system's idempotency support. Stripe's API, for example, accepts an idempotency key on requests that create or update objects, so that "you can safely repeat the request without risk of creating a second object or performing the update twice."

  • Derive the key from the business event. Use the ticket ID plus the action, not a random value per attempt, so a second attempt at the same refund carries the same key.

  • Check before writing where no key exists. Look up whether the email was sent or the record already updated before acting.

  • Test it on purpose. Add tasks to the evaluation set that force a timeout or a retry, and check that exactly one action landed.

What is a shadow run, and how long should it last?

A shadow run is a period where the agent processes real inputs but its actions are recorded, not executed, while people keep doing the work. You then compare what the agent would have done with what people actually did.

A marble hand held still while its shadow on the wall completes the reaching gesture ahead of it

A shadow run catches what an evaluation set misses: the cases nobody thought to write down. Run it until it has covered the normal spread of work, including a busy period and the month-end or weekly cycle if the process has one. Then review the disagreements one by one. Each one is either a gap in the agent, a new task for the evaluation set or a sign that the people disagree among themselves too.

Which agent actions need human approval before launch?

Actions that are hard to reverse, cost money or reach a client should wait for a person until the agent has a track record. Read-only lookups can usually run freely from the start.

OpenAI's practical guide to building agents suggests rating each tool "low, medium, or high" risk "based on factors like read-only vs. write access, reversibility, required account permissions, and financial impact", and using those ratings to pause for checks or escalate to a human.

A simple way to apply it:

  • Low risk: Example: look up an order. Before launch: runs automatically.

  • Medium risk: Example: draft a reply or update an internal field. Before launch: runs, with a person reviewing a sample each day.

  • High risk: Example: issue a refund, send an email to a client or delete a record. Before launch: a person approves each one.

Loosen a tier only when the logs show the approvals were rubber stamps. Our post on designing for AI agents covers how to make those approval screens quick to use.

What should you monitor after an AI agent goes live?

Monitor every tool call with its inputs, result and the identity it ran under, and watch for the failure patterns your tests found. The UK's National Cyber Security Centre (NCSC), writing about the joint guidance Careful adoption of agentic AI services, puts the bar plainly: "If you cannot understand, monitor or contain an agent's actions, it is not ready for deployment."

What to track

  • Every action taken, with a link back to the input that caused it.

  • Approval decisions, and how often people change or reject the agent's proposal.

  • Errors, retries and escalations to a human.

  • A weekly sample of transcripts, read by someone who knows the process.

The same NCSC post advises organisations to "deploy agentic AI incrementally, starting with tightly bounded pilots using clearly defined tasks", and to "build confidence in the system before you expand the scope". In practice that means one process, one team and a small set of tools first.

How we approach it at Vizio AI

We write the evaluation set before we write the agent. With the people who do the work today, we collect real cases, agree what a correct outcome looks like for each, and decide which actions are low, medium or high risk.

We then build the tools so writes are idempotent and scoped to the agent's own service account, run the agent in shadow beside the team, and review every disagreement with them. Approval stays on high-risk actions until the logs justify removing it, and the evaluation set keeps running after handover, so a prompt or model change that breaks a case fails a test instead of reaching a client.

This is part of our DX Studio work. If the agent connects to your systems through MCP, read Connecting an AI Agent to Your CRM? Secure the MCP Server First as well.

Sources

FAQs.

01

How long does it take to test an AI agent before launch?

It depends on the process more than the agent. Building the first evaluation set from real cases usually takes days, not weeks. The shadow run takes longer, because it has to cover the normal spread of work, including a busy period and any weekly or monthly cycle. Plan for the shadow run to set the launch date, and do not shorten it to meet a deadline.

02

Can we test an AI agent without a separate test environment?

Partly. Evaluation runs that write data should run against a sandbox or test account, starting from a clean state each time, so runs do not affect each other or real customers. A shadow run can use production inputs as long as the agent's actions are only recorded and never executed. What you should not do is test writes against live client data.

03

Who should write the evaluation tasks?

The people who do the work today, with the team building the agent. They know the awkward cases, the exceptions and what a correct outcome looks like. Engineers turn those cases into tasks with automatic graders. Without the people who own the process, the set fills up with easy cases and the agent passes tests it would fail in real use.

04

What score should an agent reach before it goes live?

There is no universal number. Set the bar per task type and per risk tier: read-only answers can tolerate occasional misses that a person catches, while refunds or client emails need every run in the set to pass, repeated several times. Agree the bar with the process owner before testing starts, so the result is not argued after the fact.

05

Do we need to re-test when the AI model is updated?

Yes. A new model version, a changed prompt, a new tool or a change in the underlying data can all change behaviour. Re-run the full evaluation set before switching, compare the results with the previous version, and read a sample of transcripts. Treat a model upgrade like any other release, with the evaluation set as its test suite.

01

How long does it take to test an AI agent before launch?

It depends on the process more than the agent. Building the first evaluation set from real cases usually takes days, not weeks. The shadow run takes longer, because it has to cover the normal spread of work, including a busy period and any weekly or monthly cycle. Plan for the shadow run to set the launch date, and do not shorten it to meet a deadline.

02

Can we test an AI agent without a separate test environment?

Partly. Evaluation runs that write data should run against a sandbox or test account, starting from a clean state each time, so runs do not affect each other or real customers. A shadow run can use production inputs as long as the agent's actions are only recorded and never executed. What you should not do is test writes against live client data.

03

Who should write the evaluation tasks?

The people who do the work today, with the team building the agent. They know the awkward cases, the exceptions and what a correct outcome looks like. Engineers turn those cases into tasks with automatic graders. Without the people who own the process, the set fills up with easy cases and the agent passes tests it would fail in real use.

04

What score should an agent reach before it goes live?

There is no universal number. Set the bar per task type and per risk tier: read-only answers can tolerate occasional misses that a person catches, while refunds or client emails need every run in the set to pass, repeated several times. Agree the bar with the process owner before testing starts, so the result is not argued after the fact.

05

Do we need to re-test when the AI model is updated?

Yes. A new model version, a changed prompt, a new tool or a change in the underlying data can all change behaviour. Re-run the full evaluation set before switching, compare the results with the previous version, and read a sample of transcripts. Treat a model upgrade like any other release, with the evaluation set as its test suite.

Read more.

Dithered illustration of a marble hand striking a great cast bell with a small mallet inside a foundry tower, the point of contact in red.
Before You Put an AI Agent in Front of a Client: The Checks We Run
Mehmet Can Duvarci
7 min

Test an AI agent before launch with an evaluation set, idempotent writes, a shadow run, approval on risky actions and logs. The checks, step by step.

Dithered illustration seen from behind a marble bust looking down on a vast labyrinth, with a single thread finding its own route through it and a red point at the thread's leading end.
What Is an AI Agent, Really? Agents vs Chatbots vs Workflows
Orhan Gazi Yalcin
7 min

An AI agent is software where a language model decides the steps and picks tools to finish a task. A chatbot only replies; a workflow follows fixed steps.

Dithered illustration of two cupped marble hands catching objects that spill from a cornucopia of characters onto a long banquet table, one fruit lit in yellow.
Get Your Store Recommended by AI Assistants Before Black Friday
Can Dinlenc
7 min

To get products recommended by ChatGPT and Google AI Mode, let their crawlers in, mark up offers, keep feeds in sync, and answer shoppers' questions on the page.

Think AI-first.
Move future-fast.

Let’s build what’s next! From product ideas and intelligent workflows to data-driven systems and scalable growth operations.

Have a product idea, AI workflow, data system, or growth challenge that needs clearer execution?

Let’s shape the right system around it.

Think AI-first.
Move future-fast.

Let’s build what’s next! From product ideas and intelligent workflows to data-driven systems and scalable growth operations.