Skip to main content
Human-in-the-Loop (HITL) in Agno enables you to implement patterns where human oversight and input are required during agent execution. This is crucial for:
  • Validating sensitive operations
  • Reviewing tool calls before execution
  • Gathering user input for decision-making
  • Managing external tool execution

Use Cases

Agno supports various human-in-the-loop (HITL) use cases for agents, teams and workflows:
  1. User Confirmation: Require explicit user approval before executing a tool
  2. User Input: Gather specific information from users during execution
  3. Dynamic User Input: Have the agent collect user input as it needs it
  4. External Tool Execution: Execute tools outside of the agent’s control
  5. Requires Approval or Audit: The workflow requires an admin review (approval/rejection) or an optional audit-only mode logging without pausing

HITL Requirements

During Human-in-the-Loop flows, the agent run pauses until the HITL requirements are resolved by the admin, user or external tool. You can interact with the HITL requirements in the code as follows:
Similarly, you can check the requirement for resolving the HITL pauses to see if a user input is required or an external tool is required:

Resuming Execution

After all active requirements have been resolved, you can continue the run by calling the continue_run method. The continue_run method continues with the state of the agent at the time of the pause.
You can also call the continue_run method passing the RunOutput of the specific run to continue:

Streaming HITL Flows

You can also stream the responses you get during a Human-in-the-Loop flow. This is useful when you want to process or show the response in real-time. You can also stream the events resulting from calling the continue_run or acontinue_run methods. For streaming you must handle the events received while streaming the Agent run. If any event is paused, then you will need to handle the active requirements:

Teams

HITL works the same way for Teams. If a member agent calls a tool that requires confirmation, user input, or external execution, the team run pauses until the requirement is resolved. Each requirement includes member_agent_name, so you know which agent triggered it.
Tools attached directly to the Team (rather than individual member agents) also support HITL. If the team leader calls a tool that requires confirmation, the run pauses in the same way. See Team HITL examples for complete examples.

Learn More

User Confirmation

Require explicit user approval before executing tool calls

User Input

Gather specific information from users during execution

Dynamic User Input

Let agents request user input dynamically when needed

External Tool Execution

Execute tools outside of the agent’s control

Approval

Admin approval with persistence, resolution tracking, and audit trails

Developer Resources