Firedrill

How to Test an AI Agent Before Production

To test an AI agent before production, give it the real job in a simulated world: the same apps, realistic records and the hard cases it will meet. Then check what it changed, not only what it said. Fix what failed and run the same tasks again.

By Firedrill ยท December 4, 2026.

Why is testing an AI agent different from testing normal software?

Normal software does the same thing every time for the same input. An AI agent decides what to do next, calls tools in an order it chooses, and can phrase the same answer many ways. Two things follow:

  • You test outcomes: did the right records change, was the right person told, did it ask before a risky action?
  • You test many cases, including rare ones, because the agent can do well on the demo and fail on the duplicate customer.

Step 1: Write down the job and what success means

Pick one real task. For each one, write:

  • The task. "A customer asks for a refund on order 1042."
  • What should happen. One refund for the right amount on the right charge, and a reply that matches it.
  • Rules that must hold. Never refund more than the order total. Ask a person before refunds over $500.
  • What would count as a failure. Saying "refunded" when no refund exists.

Step 2: Give the agent a world to act in

The agent needs the apps it uses, with data in them. You have three options:

OptionGood forWatch out for
Real staging accountsFinal checks against the real APIShared state, slow resets, real side effects, hard to make fail
Hand-written mocksUnit tests of your own codeNo state, unrealistic data, only the failures you thought of
A simulated worldRepeatable tests of the whole task across appsCheck the simulated apps match the real ones for your task

A simulated world lets you reset to the same starting point every time and create hard cases on demand. See simulated apps and tools for testing AI agents.

Step 3: Cover the hard cases

The happy path rarely breaks an agent. Add scenarios for:

  • Missing or messy data: no matching customer, two customers with the same name.
  • Tool failures: a timeout, a rate limit, a write that fails after it was accepted.
  • Approval moments: an action that needs a person to say yes first.
  • Changing context: the customer changes their mind halfway through.
  • Conversations: a simulated person who is vague, impatient or asks for something the agent must refuse.

Step 4: Run the agent the way it runs in production

Use your real agent code, prompt, model and tool connections. Point only the tool traffic at the simulated apps. The closer the run is to production, the more the result tells you.

Step 5: Read what happened

For every run, look at three things side by side:

  1. The conversation: what the agent said.
  2. The tool calls: what it asked each app to do, and what came back.
  3. The resulting records: what actually changed in the world.

The common failure is a mismatch between 1 and 3: the agent reports success while the records show nothing changed. Read more in how to evaluate an AI agent on real tasks.

Step 6: Fix it and run the same tasks again

Change one thing at a time: the prompt, the model, a tool description or the code. Run the same scenarios from the same starting data and compare. Keep the scenarios that once failed, so you notice if they ever fail again.

A checklist before you launch

  • The agent completes the main task from the same starting data, run after run.
  • It never claims an action that the records do not show.
  • It asks for approval where your rules require it.
  • It recovers from, or clearly reports, tool failures.
  • It handles the hard cases you wrote down, and you have looked at the failures yourself.

Test your agent with Firedrill

Firedrill is a simulation platform for AI agents. Your agent runs on your machine against a simulated world of apps, data and people, and you see what it did, what went wrong and why.