How to test an AI agent

Five questions people actually ask about testing AI agents, each answered as a method rather than as a product. Every page opens with a direct answer, then how to do it concretely, including the parts that are not Mirrors, then where Mirrors fits, then what none of it solves. If you follow one of these and build the thing yourself, the page did its job.

Last updated 2 August 2026

How do you test an AI agent that calls internal APIs with no staging environment?
Record the calls, write a contract per tool, stand up seeded stubs, and measure how far the copy has drifted.
How do you safely test an agent that issues refunds, deletes, or sends?
Separate the decision from the execution, fake the backend, and assert on the tool call rather than the sentence.
How do you run AI agent tests in CI so a bad change fails the pull request?
Pin recorded sessions as fixtures, make the run deterministic, assert on tool calls, and mark the check required.
How do you test whether agents actually use your MCP server correctly?
Protocol conformance is ordinary testing. Whether a model picks the right tool is a behavioral question with a different method.
How do you test an agent without using real customer data?
Keep the shape, invent the values. Derive the shape from a schema or redacted traces, and seed deterministically.