Skip to main content
Human in the loop (HITL) let’s you get input from a user before or after executing a tool call. The example below shows how to use a tool hook to get user confirmation before executing a tool call.

Example: Human in the loop using tool hooks

This example shows how to:
  • Add hooks to tools for user confirmation
  • Handle user input during tool execution
  • Gracefully cancel operations based on user choice
hitl.py