Human-in-the-loop for AI agents: who approves which tool calls
On this page
For an agent that calls tools, human in the loop means a person can stop a specific action before it runs, or check it soon after, with enough detail to judge it. Put the approval before the call for tools that are irreversible, reach outside your organization, cost money or export data. Let reads run, block what the agent never needs, and log everything so the review afterwards is possible. The approval itself can sit in the client’s permission prompt, in an MCP elicitation, in the tool’s own design or in a gateway rule.
Checked as of November 2026 against the MCP tools specification (revision 2026-07-28), the Claude Code MCP documentation and OpenAI’s Codex MCP documentation.
What human in the loop means for tool-using agents
In a chat assistant, a human reads every answer anyway. Once the model can call tools, the risky output is no longer text: it’s a merged pull request, a sent email or a refund. The MCP specification addresses this directly. Tools are model-controlled, but “there SHOULD always be a human in the loop with the ability to deny tool invocations”, and applications should show which tools are exposed, indicate when one is invoked and present confirmation prompts.
There are two distinct moments a person can be involved:
| Approve before | Review after | |
|---|---|---|
| When | The call waits until someone decides | The call runs; someone checks the record |
| What it prevents | The action itself | Repeats of a bad action |
| Cost | Latency and attention on every gated call | Attention later, only if someone looks |
| Fits | Irreversible, external, costly or data-exporting actions | Reversible internal changes: a draft, a label, a branch |
Most setups need both. Approval covers the handful of actions you can’t undo; review covers the rest, which only works if the calls were logged.
Where approval can live
The client’s permission prompt
Every major agent client can ask before a tool runs. In Claude Code, an ask rule prompts on every call to a matching tool, and a deny rule removes it:
{
"permissions": {
"allow": ["mcp__github__get_*", "mcp__github__search_*"],
"ask": ["mcp__github__create_pull_request", "mcp__github__merge_pull_request"],
"deny": ["mcp__github__delete_*"]
}
}
A server can also force the prompt: Claude Code shows it on every call to a tool whose tools/list entry sets _meta["anthropic/requiresUserInteraction"] to true, even in bypassPermissions mode, and allow rules don’t skip it.
Codex sets this per server and per tool in config.toml. Its writes mode prompts for tools that aren’t marked read-only:
[mcp_servers.tracker]
url = "https://tracker.example.com/mcp"
default_tools_approval_mode = "writes"
ChatGPT does the same by default: it treats any custom-server tool without readOnlyHint as a write and asks before running it.
The limits are structural. The prompt goes to whoever is running the session, which is usually the person who asked for the action. Rules live on each machine and differ between clients. And modes that read annotations trust the server: the specification says clients must treat tool annotations as untrusted unless the server is trusted. The Claude Code permissions guide and the MCP allowlist guide cover the client side in detail.
MCP elicitation
Elicitation lets a server pause a tool call and ask the person for input through the client: a choice, a missing value or explicit consent. In revision 2026-07-28 the server answers tools/call with an input-required result containing an elicitation/create request, and the client retries the call with the person’s answer, which can be accept, decline or cancel.
That makes it a confirmation the server controls, in its own words:
{
"method": "elicitation/create",
"params": {
"mode": "form",
"message": "Refund $1,240.00 to customer cus_8812?",
"requestedSchema": {
"type": "object",
"properties": { "confirm": { "type": "boolean" } },
"required": ["confirm"]
}
}
}
Two caveats. Client support varies, and a headless run has nobody to answer. And an elicitation can be answered by automation: Claude Code’s Elicitation hook can respond without showing a dialog. MCP elicitation covers both modes and which clients support them.
The tool’s own confirmation
You can design the confirmation into the tools. A prepare_refund tool returns what would happen and a short-lived token; commit_refund refuses to run without that token. A dry_run argument does a lighter version of the same thing.
On its own this proves only that the model looked, not that a person did: nothing stops the model calling both tools in sequence. It becomes human-in-the-loop when the commit tool is gated by the client or a gateway, and the preview gives the approver something readable.
A gateway approval rule
A gateway sits between clients and servers, so a rule there applies whichever app makes the call. It also changes who approves: the request can go to an owner or a teammate instead of the person whose agent asked. That matters for production changes, where “the requester approved their own request” isn’t much of a control.
Which tools need approval
Four questions sort most tools:
- Is it irreversible? Deleting, sending, merging, paying.
- Does it reach outside? A message to a customer, a public comment, an email.
- Does it cost money? Charges, refunds, provisioning infrastructure.
- Does it move data somewhere new? Exports, share links, uploads, queries that return customer records.
A yes to any of them is a case for approval before the call. Tools the agent never needs get blocked, so they don’t appear at all.
| Tool | Decision | Reason |
|---|---|---|
search_issues, get_file_contents | Allow | Internal reads |
create_issue, add_label | Allow, review later | Internal and easy to undo |
merge_pull_request | Require approval | Hard to undo; can trigger deploys |
send_email, post_message to a shared channel | Require approval | Reaches people outside the session |
create_refund, create_invoice | Require approval | Costs money |
export_contacts, create_share_link | Require approval | Moves data outside |
execute_sql with free-form queries | Require approval | The arguments decide what it does |
invite_user, update_permissions | Require approval | Changes who has access |
delete_repository, drop_table | Block | Not something an agent should do |
OpenAI’s own list of actions that may need extra review in ChatGPT lines up with this: sending messages or invitations, creating, editing or deleting records, changing access or sharing settings, purchases, and sharing sensitive personal data.
Reads aren’t automatically safe. An agent that reads untrusted content, such as inbound support tickets, and also holds a tool that can send data out is exposed to prompt injection. Gate the outbound tool. The lethal trifecta explains why that combination is the one to break.
Approval fatigue and how to avoid it
If every call prompts, people stop reading prompts. Twenty approvals for twenty searches train the reviewer to click yes, and the twenty-first, the one that matters, gets the same click. The fix is fewer, better prompts:
- Allow reads, approve writes, block the rest. Start there and adjust per tool.
- Show the exact arguments. “Call
send_email?” is useless; the recipient, subject and body are what the reviewer needs. - Gate by consequence, not by server. One server can have twenty harmless tools and one dangerous one.
- Be careful with “remember this choice”. ChatGPT and Claude Code both offer ways to stop asking for a tool; use them for tools you’d have allowed anyway.
- Route high-impact approvals to someone else, and keep that list short enough that they still read each one.
If people approve almost everything for a tool, it probably belongs on the allow list. If they deny a tool often, find out why the agent keeps calling it.
What to log
The specification says clients should log tool usage for audit purposes. For review after the fact, each record needs:
- Which agent and client made the call, and for which person
- The server, the tool and the upstream account used
- The arguments, with secrets redacted
- The decision: allowed by rule, approved (by whom, when), denied or blocked
- The outcome: success, tool error or protocol error, and how long it took
- Which version of the tool definition was in force, since servers can change a tool’s description or inputs at any time
Without the decision and the approver, the log tells you what happened but not whether anyone agreed to it.
Require approval in Toolstile
Toolstile, a managed MCP gateway for remote MCP servers, has a Require approval setting per tool and per agent. It doesn’t guess whether a tool reads or writes from its name or annotations, so you choose the tools yourself. When the agent calls a gated tool, it gets a result saying approval is required, with a review link. The reviewer sees the agent, connection, account and exact arguments, and chooses Approve once or Deny: the connection owner in a personal workspace, owners and admins in a team workspace. Approving doesn’t run the call. The agent retries the identical call, different arguments need a new approval, changing the account or the rules cancels an earlier one, and pending requests expire after 15 minutes. A block wins over Require approval, which wins over allow, and every forwarded call is logged.