Share
End-to-End Testing for AI Agents: What to Assert
December 3, 2026Read time: 9 min

End-to-End Testing for AI Agents: What to Assert

End-to-end testing for AI agents: run the task from its trigger into real test systems and check the records, not the reply. What to assert and when.

In short: end-to-end testing for an AI agent runs a whole task from its real trigger, through the model and the tools, into the systems the agent writes to, and then checks what those systems hold. The pass rule is the end state: the right records, with the right values, exactly once, and nothing else changed. A good output score, a clean trace or a confident "done" is not an end-to-end pass. Keep end-to-end cases few and focused on writes, run them against a test copy of the real systems, and compare the records before and after each run.

Evals, unit tests on tools and LLM judges all check parts of an agent. End-to-end tests check whether the task actually happened in the system. This guide covers what "end to end" means for an agent, what to assert, and how to keep these tests cheap enough to run before every release.

What does end to end mean for an AI agent?

For a web app, end to end means a user's click goes through the frontend and backend into the database. For an agent, the chain is longer and has a model in the middle:

  1. Trigger. A chat message, an email, a ticket, a scheduled job.
  2. Model. Reads the trigger, plans, decides which tools to call.
  3. Tools and connectors. Turn the model's calls into API requests.
  4. Connected systems. The CRM, ERP, billing or ticketing system that stores the result.
  5. Downstream effects. Notifications, approvals, other systems that read the record.

An end-to-end test starts at 1 and checks at 4 and 5. Anything that stops earlier is a partial test, useful but not the same thing.

How is end-to-end testing different from evals and unit tests?

CheckWhat it runsWhat it can seeWhat it misses
Unit test on a toolOne tool function with fixed inputWhether the tool formats the request rightWhether the model calls it with the right values
Eval on outputsThe model on a dataset, tools mocked or replayedAnswer quality, tool choiceWhat the real system stored
LLM judgeA transcriptWhether the reply reads as correctRecords the transcript doesn't show
Trace reviewA recorded runWhich calls happenedWhether the write succeeded with the right values
End-to-end testThe whole task against test copies of the real systemsThe records after the runRare inputs you didn't write a case for

Each row is useful. Only the last one answers "did the task leave the system in the right state?" For more on the split, see AI agent evals vs testing and what AI agent evaluation tools miss.

Why isn't a correct final answer an end-to-end pass?

Because the answer and the record can disagree, and only one of them is in the system.

  • The write failed, the reply says done. See hallucinated success.
  • The write happened twice. The reply mentions one order; there are two.
  • The values are off. The reply quotes what the agent meant to write, not what was saved.
  • A required step was skipped. The record is right, but the process that should have led to it wasn't followed.

The last point is measurable. In CXBench (Yu et al., October 2026), seven models ran 120 regulated customer-service tasks. 55.5% of 840 runs reached the right final state while missing a required step such as a disclosure or a consent check. Only 13.8% passed both the outcome and the process checks. An end-to-end test for a regulated task needs both: the record, and the steps the rules require.

What should an end-to-end test assert?

Four things, read from the systems after the run:

  1. Existence. The expected record is there.
  2. Values. Every field that matters has the expected value: amounts, units, dates, IDs, status.
  3. Count. Exactly one, not zero and not two.
  4. Scope. Records outside the task are unchanged.

Then two checks on the run itself: the steps that policy requires happened, and the final message matches the record. For how to read back and diff the records, see what did your AI agent change.

How do you compare the system before and after a run?

Take a snapshot of the records the task can touch, run the task, take a second snapshot, and compare. Researchers use the same method: ClawsBench (Li et al., 2026) tests productivity agents on mock email, chat, calendar, document and drive services, and scores each run by comparing database snapshots taken before and after it. With full scaffolding, agents there completed 39 to 64% of tasks and took unsafe actions in 7 to 33% of runs. Both numbers come from the same before-and-after comparison; neither would show up in the final reply.

In practice:

  • snapshot by query, not by whole database: the customer, the order, the related lines;
  • store the expected diff with the case, so the comparison is mechanical;
  • reset to the seed after the run, so the next case starts clean.

The AI agent test environment post covers the sandbox, seed data and reset.

Should end-to-end tests use real systems or mocks?

Test copies of the real systems wherever you can: a sandbox org, a staging tenant, a test company in the ERP. Mocks return what you told them to return, so they can't show you a new validation rule, a renamed field or a slow response. Use mocks for the outside actions you can't take in a test, such as real payments or emails to customers, and route those to a sink you can read back. See how to test AI agents that send emails and payments.

How many end-to-end tests do you need?

Fewer than your evals, and chosen by risk. End-to-end runs take longer and need a real environment, so put them where an error is expensive: every action that writes money, customer-facing records, or data other teams depend on. Start with one happy path per write action, then add the failure cases for the riskiest ones: a timeout after the write, a missing record, a request that should end with nothing written.

Run them more than once. An agent can pass a task on one run and fail it on the next with the same input, so a single green run is a sample.

When should end-to-end tests run?

Before every release of the agent, and after any change it depends on: prompt, model, tool descriptions, connector, or the system it writes to. The write-path cases become a release gate. The rest can run on a schedule.

How Agentiqa fits

Agentiqa is an AI Quality System for production AI agents. With Agentiqa, you describe each task in plain words. For agents that write data, the check is the record in the connected system, not only the agent's reply. When you rerun the failed tasks, AI Quality Manager reports a step as a regression only if it fails again. Unconfirmed failures are listed separately.

First release gates are live within 7 minutes; for enterprise teams, an Agentiqa engineer sets up the gates on the riskiest tasks over a 3-day rollout.

FAQ

What is end-to-end testing for AI agents?

Running a whole agent task from its real trigger against test copies of the systems it uses, then checking the records those systems hold after the run.

Are evals enough without end-to-end tests?

For an agent that only answers questions, evals cover a lot. For an agent that writes data, they can't see what was stored, so you need end-to-end checks on the write tasks.

Can I run end-to-end tests in production?

Not for writes. Use a sandbox or staging copy of each system. Production monitoring is useful after release, but it finds errors after they have reached a real record.

How do I test the steps, not only the result?

List the steps that policy requires (a check, a disclosure, an approval) and make the case fail if any is missing from the trace, even when the record is right.

What is the difference between end-to-end and integration tests for agents?

An integration test checks that one tool or connector works with one system. An end-to-end test lets the model run the whole task and checks the resulting records.

How do I keep end-to-end tests from being flaky?

Reset the seed before every run, pin the data the task reads, and run each case more than once. Call a failure a regression only after it fails again on a rerun.

Sources

  • Yu, Zhang, Su et al. (Lero, University of Limerick; Genesys and others), "cxbench: A Benchmark for Process-Compliant LLM Agents in Regulated Customer-Experience Workflows", October 2026. arXiv:2610.25954. Seven models, 120 tasks, 840 runs; 55.5% reached the right final state but failed process checks; 13.8% passed both. Read 21 November 2026.
  • Li, Choe, Liu et al., "ClawsBench: Evaluating Capability and Safety of LLM Productivity Agents in Simulated Workspaces", April 2026. arXiv:2604.05172. Five mock services with snapshot and restore; 44 tasks; 6 models, 4 agent harnesses, 33 conditions; with full scaffolding, task success 39–64% and unsafe action rates 7–33%; scoring by comparing database snapshots before and after each run. Read 21 November 2026.

Testing your own agent? Start free with the Agentiqa Community Edition: 20 runs a month, no credit card. Plans are on the pricing page.

Related posts