A tool is a contract between deterministic code and a non-deterministic model. Anthropic's engineering team frames it this way: a function like getWeather("NYC") behaves identically on every call, but an agent asked "Should I bring an umbrella today?" might call the weather tool, answer from general knowledge, or ask a clarifying question first (Anthropic). That variability is exactly why a handful of hand-written prompts from a demo notebook is not a test suite. It samples maybe ten plausible paths out of the thousands your users actually take.
Recorded production conversations have two properties synthetic prompts lack. First, they carry the messy context that precedes a tool call: three turns of clarification, a pasted error message, a half-finished sentence. Second, they carry the distribution of intents your real users have, including the long tail. The traffic-replay discipline from classical load testing applies directly: capture real requests, sanitize them, replay them against pre-production, and compare behavior to a baseline (Speedscale). Keploy's write-up of the same idea reports that synthetic staging data covered only around 40 percent of production behavior in their experience, versus about 95 percent with replayed traffic (Keploy).
For agents, the unit of replay is a turn, not a request. You do not need the whole HTTP envelope. You need the message history up to the point where the model chose a tool, and you need the record of which tool it chose and with what arguments.
What to capture per turn
| Field | Why it matters |
|---|---|
| Full message history (system, user, assistant, tool results) | Selection depends on accumulated context, not the last user message alone |
| Tool call name and arguments as issued | The baseline you will compare against |
| Tool result returned to the model | Needed to simulate the next turn |
| Final model output | Lets you check whether a different tool choice changed the answer |
| Model identifier and temperature used | A replay against a different model or sampling setting is a different experiment |
Strip personally identifiable data before storing traces, and store the tool result alongside the call so you can drive the next turn without re-executing side-effectful tools.



