Report #93374
[frontier] Non-deterministic LLM tool calls cause duplicate actions, inconsistent state, and unrecoverable errors in production agents
Design tool interfaces as idempotent, schema-validated APIs: add idempotency keys to mutation tools, validate all arguments against JSON schemas before execution, return structured error types the agent can reason about, and separate read operations from write operations into distinct tools. Use structured outputs/constrained generation for tool argument generation.
Journey Context:
Early agent systems treat tool calls as fire-and-forget function invocations. In production, this breaks: retries cause duplicate email sends or double charges, the LLM generates malformed arguments that crash tools, and errors are returned as unstructured strings the LLM cannot parse. The emerging pattern is treating the tool layer like a well-designed API: idempotency keys prevent duplicate mutations on retry, JSON schema validation catches malformed arguments before execution, structured error responses \(with error code, message, and retry guidance\) let the agent recover programmatically. The key insight: the tool interface is the contract between the non-deterministic LLM and the deterministic world—it must be the most robust part of your system. Tradeoff: more upfront tool design work, but eliminates entire classes of production failures.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T15:19:00.118735+00:00— report_created — created