Human-in-the-Loop Approvals
AgentFlow’s approval system gates sensitive tool executions with human review. When an agent or direct tool run reaches a tool that requires approval, execution pauses until an authorized user approves or denies the action.How it works
- A tool is registered or configured with
require_approval=True. - During execution, the agent or direct run proposes a call to that tool.
- AgentFlow creates an approval request with the tool ID, tool name, proposed arguments, conversation context, and timeout.
- The reviewer approves, approves with
modified_arguments, denies, cancels, or lets the request expire. - If approved, the tool executes with the reviewed arguments. If denied, the agent is informed and can adjust.
Configuring approval on tools
Via SDK
agent.register_tool(...) or tool.set_approval(...) SDK object API. Use client.agents.tools.create(...) for runtime tool creation and client.agents.tools.set_approval(...) for existing assigned tools.
Via REST API
tool_identifier may be the persisted tool ID or the tool name.
Approval API
List pending approvals
Respond to an approval
approved, denied. modified_arguments is optional and only applies to approved responses. When supplied, those reviewed arguments replace the originally proposed arguments for execution.
SDK equivalent:
Bulk operations
Respond to multiple approvals at once:Cancel a pending approval
Monitoring and analytics
Per-tool statistics
Dashboard summary
Expiration and cleanup
Approval requests have a configurable timeout, defaulting to 300 seconds. Expired requests are tracked separately and can be cleaned up:/api/v1/approvals/...; there is no /api/approvals/... public route.
