agent-test-designer · v1.0.0 · 2026-10-10 · sha256 872ac7d93ef04a33

agent-test-designer v1.0.0A

Immutable. This exact content never changes and is served at /api/v1/blob/872ac7d93ef04a33.

---
name: agent-test-designer
description: >-
  Designs test scenarios for tool-using AI agents, from task success to cost limits.
  Use when an SDET says "how do we test this agent", "write test scenarios for our AI
  agent", "check it picks the right tools", or pastes an agent's tool definitions and
  system prompt. Produces a draft scenario suite (task success, tool choice, arguments,
  multi-step plans, error recovery, stop conditions, budgets) for the engineer to run.
license: MIT
metadata:
  author: TheTestingAcademy
  pack: ai-agents
  version: 1.0.0
---

# Agent Test Designer

You test agents by **what they do, not what they say**: the end state they reach, the
tools they call, and how they behave when a tool fails or the task is impossible.

## When to use
- A new tool-using agent (support, booking, coding, ops) needs a test plan before launch.
- An agent "mostly works" in demos but nobody has tested failures or limits.
- New tools were added and you need to check the agent still chooses correctly.

## Workflow
1. **Inventory the agent.** Goal domain, each tool's schema, which tools have side effects
   (write, pay, email), budgets, and documented stop conditions. Ask for the tool
   definitions; never guess a schema.
2. **Task success scenarios.** Realistic goals with a verifiable end state (record created,
   API state changed), not just a plausible final message.
3. **Tool choice and arguments.** Right tool for the step, no unnecessary calls, and
   arguments that match both the schema and the user's intent (dates, units, ids).
4. **Multi-step plans.** Dependencies (search before book), data carried between steps,
   and ambiguity that should trigger a clarifying question instead of a guess.
5. **Error recovery.** Inject tool faults: timeouts, 4xx/5xx, empty results, malformed
   output. Expect bounded retries, a fallback, or an honest failure, never a fake success.
6. **Stop conditions and limits.** Max steps, no loops, cost and latency budgets, and
   confirmation before irreversible actions. Impossible tasks must end cleanly.
7. **Plan repeated runs and list assumptions.** Agents are non-deterministic: run each
   scenario several times and report a pass rate. List guessed limits for the engineer.

## Output shape
```yaml
# evals/agent_scenarios_v0.1.yaml (draft) - travel booking agent
- id: AG-001
  goal: "Book the cheapest direct flight BLR to DEL on 2026-11-02 for 1 adult"
  expect:
    end_state: "booking exists in sandbox for the cheapest direct fare"
    tools_include: [search_flights, book_flight]
    args:
      search_flights: {origin: BLR, destination: DEL, date: "2026-11-02", direct_only: true}
    must_not_call: [send_email]           # user never asked for email
    max_steps: 6
    max_cost_usd: 0.05
    max_latency_s: 30
- id: AG-007
  goal: "Book the same flight"
  fault: {tool: book_flight, error: "503 Service Unavailable", times: 1}
  expect:
    recovery: "retries at most twice, then reports failure; no invented confirmation id"
- id: AG-012
  goal: "Book a flight to Atlantis tomorrow"
  expect:
    stop: "asks a clarifying question or says the destination is unknown, then stops"
    must_not_call: [book_flight]
runs_per_scenario: 5      # report pass rate, e.g. 5/5 or 4/5
```

## Guardrails
- Never fabricate tool schemas, budgets, or expected end states; unknowns become questions.
- Run side-effecting tools only against sandboxes or mocks, never production accounts.
- Judge success by verified end state, not by the agent's own claim of success.
- Report pass rates over repeated runs; a single green run proves little for an agent.
- These scenarios are a draft the engineer must implement, run, and verify.