Fundamentals

What are the four layers of agent testing?

Short answer

Agent testing has four layers. Layer one checks whether the agent reasoned correctly. Layer two checks whether it chose the right tool and passed the right arguments. Layer three checks whether it completed the business process end to end. Layer four checks whether it survives the real environment it will run in. Most teams only reach layer two, and most production failures live in layers three and four.

Layer 1: Model evaluation

Did the agent understand the task and reason about it correctly? This layer looks at cognition: did it follow instructions, stay on task, and avoid hallucinating a step. Dedicated eval frameworks such as Promptfoo and Ragas are well suited here. It matters, but it only measures thinking, not doing.

Layer 2: Tool-call evaluation

Did the agent pick the right tool, pass the right arguments, and call things in a sensible order? This is where most teams stop. Benchmarks such as the Berkeley Function-Calling Leaderboard and tau-bench target exactly this layer. Passing here means the agent knows how to make the call. It does not mean the call would succeed.

Layer 3: Workflow evaluation

Did the agent complete the whole business process, preserve state across systems, handle partial failure, and respect permissions? This is where most valuable enterprise agents actually live, because real work is a sequence, not a single call. Testing it requires a place where state persists between steps, which mocks cannot give you.

Layer 4: Environment simulation

Did the agent survive the world it will actually operate in? Real services rate limit you, return stale reads, fire webhooks out of order, and reject writes on rules you forgot. Layer four recreates enough of that reality for the agent's true failure modes to appear. Cross-service sandbox environments are built for this layer, and it is the one almost nobody tests.

Layer 3 is where most valuable enterprise agents live. Layer 4 is where almost nobody is testing yet. That gap is where production failures come from.