Agents SDK approve_unsafe_replay with Sume paid calls
approve_unsafe_replay resends a model request, not a Sume tool call. Sume paid and write tools need a stable idempotency_key; keep it fixed on a repeat.

RetryDecision(approve_unsafe_replay=True) lets the SDK resend a model request the provider marked unsafe to replay. It does not touch Sume. For any Sume write or paid tool call the model makes, the safety comes from idempotency_key, which the tool requires and which must stay the same when the same intent is repeated.
Vendor facts are from the Agents SDK release notes; Sume facts from MCP tools and gates, read 2026-10-01. For backoff on 429s see the retry ceiling post.
What does the release note say?
Retry policies can inspect replay-safety facts and set approve_unsafe_replay=True for a non-streaming request the provider marked unsafe. The approval does not bypass aborts, emitted streamed output, or separate local-side-effect vetoes such as Programmatic Tool Calling. Elsewhere the notes warn that an approved unsafe replay can resend input and repeat provider-side work.
Where does the Sume idempotency key come in?
| Gate | What the docs say |
|---|---|
idempotency_key | Required on write and paid tools |
| Purpose | Stable key for transport/dedup, not human approval |
| Paid submits | Still need idempotency_key and wallet/admission |
| Output too large | Error text says never resubmit a paid create |
What should a replay-safe setup do?
Have the model derive the key from the task, not from a fresh random value per attempt, so a replayed model request that re-issues the same tool call carries the same key. A new key on a replay is a new request. If a result is too large to display, the error says it is an output limit and not a job failure: read the job, do not submit again.
Should I approve unsafe replay at all?
That is your call about provider-side repeats. Approve it only if repeated model work is acceptable, and keep paid Sume tools behind approval as in human-in-the-loop paid tools.
Sources
Related posts
More in Developers
- Does an OpenAI API key expire? Expiry dates and key rotation
OpenAI project keys can now carry an expiration date and orgs can cap lifetime. Sume documents no expiry field: rotate by minting a replacement key.
- OpenAI async tool calling for long-running render jobs
OpenAI's async tool calling lets the model keep working while your tool runs. For a slow Sume render, return the job id fast, then wait in slices.
- GPT Image 2.5 multi-turn edits: previous_response_id vs Sume
OpenAI keeps image edit state with previous_response_id in the Responses API. On Sume, each /v1/images call stands alone: re-send the image as a reference.
- OpenAI image-encoding fix: rerun workflows with the right key
OpenAI fixed an image-encoding bug and advised retrying affected workflows. On Sume, a replayed idempotency key returns the original; use a new key to rerun.
Written by Sume