Skip to main content
This example uses a local mock model, so it runs without provider credentials. The same boundary applies to email, payments, database writes, and other side-effecting tools: the tool body must not run until the requirement is confirmed.
side_effecting_tool_approval.py

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Run the example

Save the code above as side_effecting_tool_approval.py, then run:
Full source: cookbook/02_agents/10_human_in_the_loop/side_effecting_tool_approval.py