DEV Community

Kling4 AI
Kling4 AI

Posted on

Why Do AI Agent Retries Still Break Idempotency in Production?

Reading through today's engineering post-mortems on agent tool calls, two failure modes keep coming up in production systems:

  1. Duplicate side effects on timeout: An agent invokes a billing or webhook tool, the upstream service commits the write, the HTTP response drops or times out, and the planner blindly retries because it only sees a failure string.
  2. Confused-deputy credential leakage: Multiple agents share one workspace or environment, discover a user-scoped OAuth token, and fire external messages or PR actions under the developer's own identity without explicit confirmation.

Enforcing deterministic operation IDs at every tool wrapper and isolating agent credentials via workload identity federation seems to solve most of the blast radius, yet very few off-the-shelf tool SDKs ship with idempotency enforcement enabled by default.

How are you designing your agent tool boundaries right now — strict idempotency keys in the wrapper, human-in-the-loop approval gates for any mutating call, or read-only sandboxes by default?

Top comments (0)