> ## 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.

# Tool Confirmation: Dojo Demo

> Frontend-provided tools: send_email, delete_files (via useHumanInTheLoop).

```python tool_confirmation.py theme={null}
"""
Tool Confirmation — Dojo Demo
=============================

Frontend-provided tools: send_email, delete_files (via useHumanInTheLoop)

The frontend defines these tools as requiring confirmation before execution.
When the agent calls them, the frontend renders a confirmation card.
User can approve or reject the action.
"""

from agno.agent.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.models.openai import OpenAIResponses

tool_confirmation_agent = Agent(
    name="tool_confirmation",
    model=OpenAIResponses(id="gpt-5.5"),
    db=SqliteDb(db_file="/tmp/agui_tool_confirmation.db"),
    instructions="""You are an assistant that can send emails and delete files.
Both actions require user confirmation before execution.

When asked to send an email:
- Call the send_email tool with: to, subject, body
- Wait for user confirmation

When asked to delete files:
- Call the delete_files tool with: action, description, details
- Wait for user confirmation

Example email tool call:
{
  "to": "alice@example.com",
  "subject": "Hello!",
  "body": "Just wanted to say hi."
}

Example delete tool call:
{
  "action": "Delete temporary files",
  "description": "Remove all .tmp files from the project",
  "details": {"count": "15 files", "size": "2.3 MB"}
}

After user confirms or rejects:
- Acknowledge the decision
- If confirmed, confirm the action was taken
- If rejected, acknowledge and ask if there's anything else""",
    markdown=True,
)
```

## Run the Example

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

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U agno openai sqlalchemy
    ```
  </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="Use the helper">
    This helper is imported by [AG-UI Showcase](/examples/agent-os/interfaces/agui/showcase), which mounts it at `/tool_confirmation` and serves on port 9001. Run the showcase entry point instead.
  </Step>
</Steps>

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