New Tool Radar

AI Agents & Automation

How to Require Human Approval Before an OpenAI Agents SDK Agent Runs a Sensitive Tool

Set needsApproval on a sensitive tool in the OpenAI Agents SDK so the run pauses and waits for a person before it executes.

Schematic diagram with three steps: Mark the tool needsApproval, Run a sensitive call, then Approve and resume.

A tool with needsApproval set to true does not execute. The run returns early with a list of interruptions, one entry per pending call, and the run can resume after a human approves. The state is portable, so the approval can happen in a different process from the run.

Before you start

You need a working OpenAI Agents SDK agent with at least one sensitive tool, for example a refund or an email send. Decide who approves, and set access control on the approval step first.

Mark the sensitive tool with needsApproval

Set needsApproval to true on the tool definition for the sensitive tool, and leave it off the read-only tools. Write the rule in the agent instructions too: the agent may propose the action, but it must never run the tool without approval.

Test the pause, then approve and resume

Run the agent with a request that needs the sensitive tool and check the run returns early with an interruption instead of executing. Approve the call and resume the run, then check the tool executed once. If the tool runs without approval, the flag is on the wrong tool.

Worked example: Approval for a fictional refunds agent

Maple Shop is a fictional online shop. Its agent can look up orders freely but needs approval to refund. The table shows the test.

Tool needsApproval? Runs without approval?
Look up order No Yes
Refund order Yes No, it pauses
Send email Yes No, it pauses

Expected result (UNTESTED): the refund request pauses with an interruption, and after approval the refund runs once. We checked the OpenAI Agents SDK guides, which describe needsApproval and the interruptions list, but we did not run the agent on this machine.

Limits

Approval only helps if the approver reads the proposed call: approving blindly is the same as no gate. Keep the approval message exact, showing the tool name and the arguments, and log every decision.

Sources

See all