Some agent actions — deploying to production, restarting a service, deleting data — should not happen without explicit user consent. Human in the Loop lets the gateway pause the agent before executing a sensitive tool call, show the tool name and arguments to the user, and resume only after an approval decision. This keeps the agent autonomous for safe operations while giving users a checkpoint before anything destructive or irreversible runs.Documentation Index
Fetch the complete documentation index at: https://www.truefoundry.com/llms.txt
Use this file to discover all available pages before exploring further.
How it works
When the agent requests a tool call that requires approval, the gateway does not execute the tool immediately. Instead, it emitstool.approval_required and stops the response until the client sends a tool.approval message.
Approvals are based on the tool metadata exposed by the MCP server. Tools marked as destructive or not read-only can require approval before execution.
When to use Tool Call Approvals
Use approvals for tools where user confirmation matters:- Deploying, restarting, or deleting applications.
- Updating infrastructure or configuration.
- Sending external messages or notifications.
- Mutating production data.
- Running expensive or irreversible operations.
When not to use Tool Call Approvals
Do not use approvals for safe read-only tools, such as listing resources, fetching metrics, searching docs, or reading application status. Approvals also do not replace authorization. The user still needs permission to call the underlying tool; approval only controls whether the pending tool call should proceed.Streaming events
The client should watch for two things:- An
agent.messageevent with a tool call wheretool_info.is_approval_requiredistrue. This contains the tool name and arguments to show the user. - A
tool.approval_requiredevent. This tells the client that execution has paused and an approval decision is required.
Tool call
tool.approval_required
previous_response_id and a tool.approval input.
Allow the tool call:
Example
User
Restart the billing service in
prod-us.Assistant
I found the billing service in
prod-us. Restarting it is a production change, so I need approval before running the tool.restart_application
restart_application
Tool Call
System
The stream emits
tool.approval_required and pauses.User
Approve.
Assistant
restart_application
restart_application
Tool Response
prod-us.