Benchmarking Toolchains for Agents With Live External API Dependencies
Stateful simulators, checked against live APIs, make agent scores repeatable.

Benchmarking agents with live external API dependencies requires a toolchain that controls service state, removes live-service variability, and replays exact conditions. The practical approach is to run agents against stateful API simulators, verify those simulators continuously against live services, inject controlled failures, and score the resulting state changes.
Why benchmarking agents that call external APIs is a different problem than benchmarking models
A model benchmark can hold the input and scoring rules fixed while evaluating the output. An agent that calls an API changes the world that its next call must navigate. Creating a resource affects a later lookup, and updating that resource changes which subsequent actions are valid. The environment becomes part of the test. A correct-looking answer is therefore insufficient evidence that the agent completed its task.
Live services add three kinds of noise to this process: network variance, API-side state drift, and rate-limit throttling. These conditions can change between runs without any change in the agent. A failed request might show that an agent struggles to recover, but if that failure was uncontrolled, the run cannot be fairly compared with one that had no interruption. The benchmark must distinguish capability from circumstance.
Stateless mocks remove live-service noise but lose track of how tool calls build on one another. An agent can follow an invalid resource lifecycle while receiving responses that make every individual step appear successful. The design question is not simply whether to use a live API or a mock, but which environment preserves service behavior while making test conditions repeatable.
What stateful simulation actually means and why it is the minimum viable substrate
A stateful simulator models resource creation, updates, deletion, and state transitions so that each response reflects the current simulated world. A stateless mock instead returns a response that takes no account of earlier calls. Its POST can appear to create a resource without affecting the next GET. For a multi-step workflow, memory of consequential actions is a minimum requirement.
A payment lifecycle makes the distinction concrete. A charge is created, captured, and then refunded. If a stateless mock returns “captured” before capture occurs, the agent can pass the test despite skipping the action that establishes that state. A stateful simulator rejects an invalid transition. It allows the benchmark to test the workflow.
Sequential dependencies also compound across a task. An error in step two changes the conditions facing steps three and four, so an environment without state cannot expose where that chain broke. Live APIs preserve these dependencies but add credentials, rate limits, network variance, and real side effects. Simulation keeps the state built up by earlier calls while keeping those confounds out of benchmark runs.
How Agent-Diff's state-diff contract turned this idea into a working benchmark design
Agent-Diff, by Pyskło, Zhuravel, and Watson at KDD 2026, demonstrates this architecture through sandboxed replicas of real APIs. Its state-diff contract defines success as an expected change between environment snapshots taken before and after execution. The contract separates process from outcome. An agent need not reproduce a preferred sequence of calls if another valid path produces the required result.
The contract also defines what must remain unchanged. Because the diff covers the full environment state, it can expose unintended modifications or deletions of unrelated resources. Assessing both the requested update and any damage to other resources gives the benchmark evidence beyond what a call trace alone can provide.
The published benchmark includes Slack with 25 Web API endpoints, Linear with 19 GraphQL endpoints, Box with 27 REST endpoints, and Google Calendar with 37 REST endpoints. Those replicas support 224 tasks across 108 unique endpoints. The tests covered 9 frontier models with 3 trials per task, and used assertion-weighted scores and Bayesian credible intervals. Uncertainty was part of the measurement design.
In the no-docs condition, deepseek-v3.2 led at 88.1 overall, followed by devstral-2512 at 86.0, while claude-haiku-4.5 scored 49.3 and llama-4-scout scored 38.0. The spread shows that the tasks differentiated model performance. Agent-Diff's error analysis also found that stronger models favored adaptive lookup and decomposition over repetitive retry-same strategies. Planning quality, alongside familiarity with API calls, separated performance tiers.
The harness layer and what determines whether scores are reproducible
The harness establishes the conditions under which the simulator becomes a reliable test environment. It provisions clean state, supplies instructions and tool definitions, captures execution traces, triggers snapshots, and hands the resulting diff to the scorer. A score belongs to a model running within a particular wrapper and configuration.
Without an identical starting configuration, the second run may inherit resources or changes created by the first. Execution order then contaminates the comparison between agents. Realistic pre-seeded data is also a harness concern, because an empty sandbox presents a different task from one containing the data an agent would encounter in production.
Terminal-Bench Version 2.1 illustrates how defects around execution can masquerade as model failures. Its fixes addressed external dependency changes, inadequate resource budgets, and mismatches between instructions and tests.
OneDayAgent, from Zhejiang University and Ant Group in August 2026, offers a related way to design a harness for long-horizon work. Its execution memory preserves subtask state under context pressure and across environments. Without such checkpointing, earlier context can be lost as the run moves between tools. For multi-step API workflows, reproducible setup alone does not address that loss during the run.
Fidelity drift and why simulators need continuous verification against live APIs
A simulator can produce repeatable results while representing the wrong service behavior. APIs evolve as fields appear, error codes change, and response schemas are versioned. A replica that matched the service at release can therefore become inaccurate without any obvious failure in its own tests. Repeatability does not establish fidelity to the service. An agent may score well against the replica and still fail against the live API.
Terminal-Bench's v2.0 defects illustrate the need to distinguish different forms of substrate failure. Of its 28 broken tasks fixed in v2.1, 9 had external dependencies that changed, 8 had resource budget issues, and 11 had instruction-test mismatches. Only the first category was external dependency drift. The others show that a stable environment can still produce misleading scores when execution constraints or tests are wrong.
Test-layer drift creates a related risk. If a test rejects a functionally correct result, the evaluation has diverged from the behavior it is supposed to measure. That is a substrate-validity problem.
The defense is continuous comparison with the live API. Verification runs compare simulator responses with service responses on a regular cadence and block release when behavior diverges. These checks are separate from offline benchmark execution. That separation preserves repeatable evaluation without treating simulator accuracy as a one-time accomplishment.
Fault injection as a required evaluation dimension, not an optional stress test
An agent that succeeds when everything works may still struggle to recover when something fails. Production workflows also encounter 429s, 503s, ReadTimeouts, and partial failures, which require the agent to recover without corrupting state. Live services expose these conditions inconsistently between trials. Controlled fault injection makes them reproducible evaluation conditions.
Dev Proxy has random error injection that can be configured, including a Stripe sample with card_declined and expired_card variants. RetryLab provides deterministic failure simulation in Python, including 429, 500, and 503 responses, dynamic Retry-After headers, timeouts, TCP disconnects, and latency profiles. It also supports progressive outages that move from Timeout to 503 to 200. Its idempotency auditor uses SHA-256 canonical JSON hashing to detect duplicate payments and payload mutations.
These tools address the fault layer, but that layer must compose with persistent simulated state. An agent retrying payment creation must encounter the state that already exists. Otherwise, the test removes the very conditions that could make a retry unsafe. Failure responses cannot be evaluated independently of their effects.
A recovery test can separate an agent that changes its approach from one that repeats the same failed action. The benchmark can then assess recovery quality as well as eventual completion.
Evaluation scoring and why state-diff outperforms trace matching and fuzzy grading
Trace matching asks whether the agent took the steps expected of it, while fuzzy response grading asks whether its output looks right. Neither question establishes that the external resource reached the required state. A plausible completion message can conceal an invalid outcome. An agent can also take a different, valid sequence of steps and fail a trace check even though it completed the task correctly.
State-diff scoring closes this gap by evaluating the environment itself. Agent-Diff checks both the requested changes and the absence of unintended changes to unrelated resources. Its snapshots provide the evidence for those assertions, while traces provide diagnostic evidence for explaining failures.
BenchJack, from UC Berkeley in 2026, demonstrates the narrower integrity risk of scoring observable outputs without verifying task completion. Its exploit agent scored 100% on several benchmarks without solving any tasks. For the benchmarks tested, that finding shows why surface evidence is a weak substitute for checking the outcome directly.
EnterpriseOps-Gym, from ServiceNow, also evaluates stateful planning and tool use across simulated enterprise systems. State-first evaluation is therefore not confined to one benchmark's design. A scorer tied to valid outcomes can accept those strategies without requiring them to imitate a reference trace.
How can teams run automated API agent evaluations at scale?
The four layers connect through a controlled execution cycle. The harness provisions a known environment and captures its initial snapshot, while the stateful simulator processes the agent's calls against that environment. Fault injection alters the response path on a deterministic schedule without resetting accumulated state. After execution, the scorer compares snapshots against the task's state-change assertions and invariants.
The scorer needs faithful state, the simulator needs reproducible provisioning, and fault injection needs state to survive interruptions. A gap propagates into the final score. No scoring method can repair an inaccurate simulator, and no simulator can compensate for a harness that changes starting conditions between trials.
This separation also makes deployment practical. Benchmarks can run locally or in containers without live credentials, outbound service calls, or live rate limits. The same controlled conditions can be reproduced in CI/CD rather than reconstructed around production dependencies. Offline runs also work in enterprise environments where outbound access is limited or unavailable.
The same properties extend beyond evaluation into reinforcement learning. Stateful simulators can be instantiated across thousands of containers, providing deterministic state and controllable transitions for training environments. Horizontal scale requires preserving across instances the controls that make a single run interpretable.
What current frontier benchmarks still get wrong, and what a team building its own should take from that
Public benchmarks cover only part of the API surface that production teams use. Agent-Diff's published coverage includes Slack, Linear, Box, and Google Calendar, but does not establish support for GitHub, Stripe, PayPal, Kalshi, Resend, or Lob. Its results cannot substitute for evaluating those integrations. Published scores are also harness-specific, so a different wrapper or configuration can change the behavior being measured.
For a team building its own evaluation, the architectural lesson is to choose or build a stateful simulator for each API in scope and verify it continuously against the live service. Publishing fidelity scores makes that maintenance visible. Tasks should be defined as state-change assertions rather than prescribed traces, with fault injection included from the start. The complete toolchain should run in CI without live credentials.
The hardest work remains the service replica itself. Scoring and orchestration depend on a faithful account of each API's behavior, and that account must be maintained as the service changes. The decisive investment is therefore not a larger collection of static responses, but a stateful environment whose fidelity can be demonstrated repeatedly. Without that foundation, automation just makes scores that cannot be trusted faster.


