When a model can call tools, the failure mode is no longer “it answered poorly.”

It becomes:

This guide lays out a test sequence that focuses on product behavior and tool safety—so you can ship with evidence, not optimism.

TL;DR
  • Treat agent testing as journey testing + tool safety + failure UX.
  • Enforce approval gates on any action that can write or affect data.
  • Validate tool schemas and check what happens on schema mismatch.
  • Test partial failures (timeouts, tool errors, invalid arguments) and confirm the rollback story.
  • Test tool selection under adversarial prompts and ambiguous instructions.
  • Rank findings by blast radius and decide ship / wait / block.

What to test in agents (the three-layer model)

An agent system is three layers:

  1. User intent to tool selection (what the model decides to do)
  2. Tool execution safety (what the product allows and blocks)
  3. Product experience on failure (what the user sees next)

A secure system needs all three.

The testing sequence

1) Identify “action power” in your agent

Write down every action the agent can trigger:

Then define which actions require confirmation.

If your agent can act, your test plan must treat approval gates as first-class functionality.

2) Build a small tool behavior set

Before writing dozens of prompts, create a minimal set for each tool:

Pass rules should be explicit for each:

3) Test approval gates and permission checks

For any tool that can write or affect user data:

Injection probe idea:

Pass rule:

4) Test schema validation and argument repair

Agents often fail on structured arguments:

Your test cases should verify:

If the agent calls tools with bad args and the product “just lets it through,” you have a serious gap.

5) Test partial failures and rollback behavior

Tool errors are normal. The system’s job is to remain understandable.

Test for scenarios like:

Pass rules to write:

Even without perfect rollback, you can make the UX honest and actionable.

6) Test tool selection under ambiguity

Agents can choose the wrong tool when:

Test these deliberately:

Pass rule:

Worked example: “send email” tool

If your agent can send email:

Verify:

How GenCodeQA approaches it

We test the agent as a system:

Findings are severity-ranked with location and fix guidance, plus retest support when scoped.

Method overview: AI evaluation framework.

Free tool: start with first-pass scope

First-test scope builder (free, no signup)

Use it to decide what to test first, then write pass rules around approval gates and failure UX.

When to get a second pair of eyes

If your agent:

Consider an independent pass. Book a free testing triage.

FAQ

Do we need to test every tool?

Not on day one. Start with the highest blast-radius tools and the failure states that matter on your core journeys.

Is this different from testing function calling?

Function calling tests the structure. Agent testing also covers approvals, permissions, tool errors, and the user experience when things fail.

What if we don’t have rollback?

Then your pass rules must focus on honest UX and safe retry behavior. “No rollback” is still a behavior; test it as such.