Skip to main content
This example shows how to implement human-in-the-loop functionality in your Agno tools. It shows how to:
  • Add pre-hooks to tools for user confirmation
  • Handle user input during tool execution
  • Gracefully cancel operations based on user choice
Some practical applications:
  • Confirming sensitive operations before execution
  • Reviewing API calls before they’re made
  • Validating data transformations
  • Approving automated actions in critical systems

Code

human_in_the_loop.py

Usage

1

Create a virtual environment

Open the Terminal and create a python virtual environment.
2

Install libraries

3

Run the agent