> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2-codex-docs-audit-20260719-0149.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# HITL Tool Confirmation

> Minimal backend agent with frontend-defined tools via useHumanInTheLoop.

```python hitl_tool_confirmation.py theme={null}
"""
HITL Tool Confirmation
======================

Minimal backend agent with frontend-defined tools via useHumanInTheLoop.
"""

from agno.agent.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.models.openai import OpenAIResponses
from agno.os import AgentOS
from agno.os.interfaces.agui import AGUI

confirmation_agent = Agent(
    name="tool_confirmation",
    model=OpenAIResponses(id="gpt-5.5"),
    db=SqliteDb(db_file="/tmp/agui_hitl_confirmation.db"),
    instructions=(
        "You help users with tasks that may require confirmation. "
        "Use available tools when needed - they are provided by the frontend."
    ),
    markdown=True,
)

agent_os = AgentOS(
    agents=[confirmation_agent],
    interfaces=[AGUI(agent=confirmation_agent, prefix="/tool_confirmation")],
)
app = agent_os.get_app()


if __name__ == "__main__":
    agent_os.serve(app="hitl_tool_confirmation:app", port=9001, reload=True)
```

## Run the Example

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U "agno[agui,os]" openai
    ```
  </Step>

  <Step title="Export your OpenAI API key">
    <CodeGroup>
      ```bash Mac/Linux theme={null}
      export OPENAI_API_KEY="your_openai_api_key_here"
      ```

      ```bash Windows theme={null}
      $Env:OPENAI_API_KEY="your_openai_api_key_here"
      ```
    </CodeGroup>
  </Step>

  <Step title="Run the example">
    Save the code above as `hitl_tool_confirmation.py`, then run:

    ```bash theme={null}
    python hitl_tool_confirmation.py
    ```
  </Step>
</Steps>

Full source: [cookbook/05\_agent\_os/interfaces/agui/hitl\_tool\_confirmation.py](https://github.com/agno-agi/agno/blob/v2.7.4/cookbook/05_agent_os/interfaces/agui/hitl_tool_confirmation.py)
