Report #76061
[frontier] Agent retries a non-idempotent tool call \(send email, create record, make payment\) after a timeout or failure, causing duplicate side effects in production
Design all agent-facing tools as idempotent: include idempotency keys in parameters, use upsert semantics for writes, return consistent results for repeated identical calls, and add deduplication layers for inherently non-idempotent operations
Journey Context:
Agents retry failed operations—it is fundamental to how they handle errors. But if a tool has side effects \(sending an email, creating a database record, making a payment\), retries cause duplicates that are expensive or impossible to undo. This is the number one production safety issue for agents with write capabilities. The fix borrows from distributed systems: make tools idempotent. \(1\) Include idempotency keys: the agent generates a unique key per logical operation, and the tool deduplicates on repeated calls with the same key. \(2\) Use upsert semantics: create-or-update instead of create-only. \(3\) Return consistent results: if a record already exists from a previous call, return success with the existing record rather than erroring. \(4\) For inherently non-idempotent operations \(sending an email\), wrap with a deduplication layer that tracks what has been sent. This pattern is non-negotiable for any agent that writes to external systems.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T10:15:46.872669+00:00— report_created — created