Approval holds for MCP tool calls are in Preview and are turned on per workspace.
Approval decisions on the default path are written to the tenant’s hash-chained ledger, whose batches are signed when a signing key is configured, and the open-source verifier replays them offline. Approvals opened before this shipped are not recorded. The signed approval record is still a Preview: we have not yet observed it with a real approval in production, and the helpers below do not read or verify it.
What the agent receives
A held call comes back in one of two shapes.is_held / isHeld parses both and returns None /
null for anything else, including a denied or expired answer.
- A tool result with
isError: trueand the textapproval required "<id>"; retry the same call after approval. This shape comes from a tool rule set to “Require approval”. The gateway keeps the request open for up to 30 seconds first, so an approver who acts quickly lets the call run on the first try. Give your MCP client a request timeout of at least 35 seconds, or it reports a timeout instead of the held answer. - An HTTP 409 with
{"error": "approval_required", "approval_id": "<id>", "expires_at": "<time>"}. This shape comes from an action policy, and it answers straight away.
Wait for the decision
wait_for_decision reads GET /v1/approvals/{id} with the same API key the agent uses. That key can read
the status of the approvals it requested. The base URL must be https (plain http only for localhost),
and a redirect from the gateway is treated as an error, so the key is never sent anywhere else. It returns one of approved, denied, expired
or timeout. timeout means your deadline passed and the approval may still be pending.
LangGraph (Python)
Wrap the tool call inside a node. A held call raises a LangGraphinterrupt() with a typed payload
(type, approval_id, expires_at). LangGraph runs the node again from its first line when it resumes, so that first call is already the retry,
and the gateway decides: an approved approval returns the tool result, a denied or expired one raises
ApprovalNotGranted, and a still-pending one interrupts again. The resume value
({"decision": "approved"} once wait_for_decision returns) matters only while the approval is still
pending; only approved triggers one more retry, anything else raises ApprovalNotGranted. Requires langgraph; nothing else is added to the SDK.
Idempotency-Key header holding a UUID (for example from uuid.uuid4()). The retry must carry the same key as the first call. A missing or malformed key is refused with 400 and an answer that names the header.
OpenAI Agents SDK
Wrap the async function behind the tool. If the call is held, the wrapper waits, retries the identical call once after approval, and otherwise returns a short message telling the model the action was not performed and should not be retried.TypeScript
isHeld(body) parses an already-read body. For a real fetch Response use await isHeldResponse(res), which reads a clone. waitForDecision(held, { baseUrl, apiKey, timeoutMs }) returns the same four decisions as the Python function.
Who can approve
On the hosted service, approving needs a recent sign-in. If the approver signed in too long ago, the gateway refuses the decision and asks them to sign in again. The window is set by the gateway’s policy table, not by the caller. A tenant API key cannot approve. On a single-tenant self-host, the operator’s master key can approve and has no sign-in check.Notifications
When a call is held, the gateway can notify approvers by Slack or email. The message names the tool, the server, the rule and the expiry, and its button links to that exact held call in the approvals page, where the approver signs in. Tool arguments are not put in the message.Limits
- One retry after approval. A call that is still held after the retry is reported as not performed.
- The helper never retries on a denied, expired or timed-out decision. The gateway decides: if a person approved the call before your agent resumes, the identical retry runs once.
- The status read is rate limited per key. A
Retry-Afterheader is honoured, up to your deadline. Keep the default backoff when many agents wait at once.