← All posts
AI & growth · 11 November 2026 · 7 min read

How to test an AI agent before you trust it with real work

To test an AI agent before you trust it with real work, ask for evidence instead of a verdict: the exact run it did and the real output, with a plain note of anything it couldn't run. Then check how it reads as well as what it writes, and try every change in a sandbox, on one item first and then a small batch, before it goes near your live systems.

An agent that says "done, all tested" has told you nothing yet. This post sets out a routine you can use for any agent, whether it drafts emails, tidies a catalogue or runs on a schedule: what counts as evidence, how to test the parts that have no automated test, and how to move from a sandbox to live data without a nasty surprise.

It's about testing an agent's work. Deciding what the agent may do on its own once it passes is a separate question, covered in our guide to act, draft or escalate.

How to test an AI agent before you let it loose on your business

Five checks, in the order you'd run them:

  1. ask for evidence, not "it works";
  2. make sure its tests can fail;
  3. check the parts with no automated test by hand, from a dry run or a rendered draft;
  4. check it read the whole input before it acted;
  5. test any write in a sandbox, one item first, then a small batch.

How to evaluate an AI agent: evidence, not "it works"

The words "tested", "works", "fixed" and "verified" should never reach you on their own. Each one needs the evidence behind it: the exact command or run the agent did, and its real output pasted in, trimmed if it's long. If the agent changed a price rule, you want to see the test command and the line that says how many tests passed, not a summary of how confident it feels.

The same goes for what it didn't do. Sometimes an agent can't run a check, because it has no credentials, no network or no access to the test store. That's fine, as long as it says so plainly: "Not run: needs the test store key." A clear "not run" is a perfectly good answer. A guessed pass is the one answer you can't accept, because it looks exactly like a real one.

So the first test of any agent is a simple one: does its report let you check its claims yourself? If you'd have to take its word for it, send it back.

How to unit test AI agents: make the test fail first

A test that has never failed hasn't proved anything. It might be checking the wrong thing, or nothing at all, and it would pass either way.

When an agent fixes a bug, ask it to show the test failing before the fix and passing after it. Those two runs together are the evidence. The failing run shows the test can catch the problem; the passing run shows the fix solves it. If an agent only ever shows you green results, you don't yet know whether its tests can turn red.

This is the same discipline good developers use, and it applies whether a person or an agent wrote the code.

Testing the parts with no automated test

A lot of what an agent touches has no test suite at all: a prompt, an email template, a scheduled job, a page of copy. "Looks fine" isn't a test for those either. The manual check is to look at the actual output the agent would produce:

Treat that output as the evidence, the same as a test run. A person reads it, checks it against the source records, and says yes or no. If you plan to run the agent unattended, our guide to guard rails for scheduled AI agents covers what to add once nobody is watching.

Check how it reads, not just what it writes

Many agent mistakes start before it writes a word, because it acted on part of the picture. A good test checks the reading as well as the result.

The easy way to test this is to give it the awkward cases on purpose. Hand it a long thread where the key detail is in an early message, or one where a colleague has already answered, and see what it does. An agent that only ever gets the tidy example will pass, and you'll learn nothing.

For customer emails in particular, the safe output is a draft that a person approves. Our post on why AI customer emails should be drafts goes into that in more detail.

Test writes in a sandbox, then one item, then a small batch

Reading is low risk. Writing to a live system is where testing matters most: a shop, a marketplace, your stock system or your email.

Start in a sandbox

Wherever your systems offer a staging site, a test store or a sandbox account, test the agent there first. Mistakes in a sandbox cost you nothing but time.

Preview, then confirm

Every write should be preview-then-confirm. The agent first shows exactly what will change, such as the order, the SKU, the old and new values, or the email text and who it goes to, and only makes the change after a clear yes from the person who owns that decision. If the tool you give the agent offers a preview step, it should always use it, and never reach for a raw API call to skip it. Testing the agent includes checking that it does.

One item, then a small batch, then the rest

For bulk changes such as prices or stock, start with one SKU. Check the result. Then run a small batch and check again. Only then run the rest. Each step is a test in its own right, and a mistake caught at one SKU is a quick fix rather than a clean-up across your whole catalogue.

What "passed" looks like

By the end, you should have a short record you could hand to someone else: the runs with their real output, any tests shown failing and then passing, the dry runs or drafts a person reviewed, a note of anything not run and why, and the results of the one-item and small-batch writes. If you can't put that together, the agent isn't ready for real work yet.

Keep the record. When the agent's instructions or tools change, run the same checks again rather than assuming the old pass still holds.

Testing done? Next, decide how much the agent may do on its own, with our guide to act, draft or escalate.

Frequently asked questions

How do you evaluate an AI agent?

Judge it on evidence, not its own verdict. For every claim that something was tested or fixed, ask for the exact command or run and its real output. Anything it couldn't run should be listed plainly as not run, with the reason.

How do you unit test AI agents?

The same way you'd test any code change, with one extra rule: a test that has never failed proves nothing. When an agent fixes a bug, ask it to show the test failing before the fix and passing after it.

How do you test AI agent accuracy?

Look at the real output and check it against the source records: the rendered draft, the dry run, or the preview of old and new values. Give it awkward cases on purpose, such as a long thread where the key detail is in an early message.

How do you test agentic AI applications before they go live?

Start in a staging site, test store or sandbox wherever one exists. Make every write preview-then-confirm, then run one item, check it, run a small batch, check again, and only then run the rest.

What if the agent can't run a test?

That's acceptable as long as it says so, for example "Not run: needs the test store key." What isn't acceptable is a guessed pass, because it looks exactly like a real one.

Should I test an AI agent on my live store?

Not first. Use a sandbox or test store where one exists. When you do move to live data, keep preview-then-confirm in place and start with a single item before any batch.

Practical apps for busy operators

Order entry, pricing, quote follow-up and AI connectors, built by a business that uses them every day.

See the apps →