This example shows how to implement Human-in-the-Loop (HITL) flows in AgentOS. When an agent needs to execute a tool that requires confirmation, the run pauses and waits for user approval before proceeding.
# 1. Send a request that requires confirmationcurl -X POST http://localhost:7777/agents/data_manager/runs \ -F "message=Delete 50 old records from the users table" \ -F "user_id=test_user" \ -F "session_id=test_session"# The response will have status: "paused" with tools awaiting confirmation# 2. Continue with approval (use the run_id and tool_call_id from response)curl -X POST http://localhost:7777/agents/data_manager/runs/{run_id}/continue \ -F "tools=[{\"tool_call_id\": \"{tool_call_id}\", \"tool_name\": \"delete_records\", \"tool_args\": {\"table_name\": \"users\", \"count\": 50}}, \"confirmed\": true}]" \ -F "session_id=test_session" \ -F "user_id=test_user" \ -F "stream=false"