| Example | Description |
|---|---|
| Agentic User Input | Let the agent request missing fields at runtime with UserControlFlowTools, then continue the run. |
| Confirmation Advanced | Confirm or reject tool calls across a custom HackerNews tool and WikipediaTools in one run. |
| Confirmation Required | Gate a custom HackerNews tool behind requires_confirmation and resume the paused run with agent.continue_run(). |
| Confirmation Required MCP Toolkit | Require confirmation for an MCP server tool and resume an async streamed run after approval. |
| Confirmation Toolkit | Gate a toolkit’s web_search tool behind user confirmation with requires_confirmation_tools. |
| External Tool Execution | Pause the run for a shell tool marked external_execution, execute it yourself, and continue with the result. |
| User Input Required | Mark a tool with requires_user_input so the run pauses to collect the to_address field. |
| Approval Async | Async approval-backed HITL: @approval with async agent run. |
| Approval Basic | Approval-backed HITL: @approval + @tool(requires_confirmation=True) with persistent DB record. |
| Approval External Execution | Approval + external execution HITL: @approval + @tool(external_execution=True). |
| Approval List And Resolve | Full approval lifecycle: pause, list, filter, resolve, delete. |
| Approval Team | Three patterns for team approvals: tool on the team, on the member, or on both. |
| Approval User Input | Approval + user input HITL: @approval + @tool(requires_user_input=True). |
| Audit Approval Async | Async audit approval: @approval(type="audit") + @tool(requires_confirmation=True) with async. |
| Audit Approval Confirmation | Audit approval with confirmation: @approval(type="audit") + @tool(requires_confirmation=True). |
| Audit Approval External | Audit approval with external execution: @approval(type="audit") + @tool(external_execution=True). |
| Audit Approval Overview | Compare pre-execution @approval records with audit-type approvals logged after the tool runs in SQLite. |
| Audit Approval User Input | Audit approval with user input: @approval(type="audit") + @tool(requires_user_input=True). |
| Confirmation with Session State | HITL confirmation where the tool modifies session_state before pausing. |
| Mixed External and Regular Tools | Combine a regular tool with an external_execution tool; the agent auto-runs one and pauses for the other. |
| User Feedback (Structured Questions) | Pause a trip-planning agent with UserFeedbackTools and collect answers to multiple-choice questions. |
| Approval Post Hook | Demonstrates the post-hook reading the resolved approval record from run_output.metadata[“approval”] after a paused run resumes via DB resolution. |
| Member-Level Approval (Case 2) | Approval tool lives on the member agent. |
| Both Member + Team Level Approval (Case 3) | Approval tools on both the member agent AND the team. |
Human in the Loop
Human In The Loop
Browse agent examples for confirmation, user input, external execution, and approval-backed HITL.