- Add pre-hooks to tools for user confirmation
- Handle user input during tool execution
- Gracefully cancel operations based on user choice
- 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