> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AgentOS HITL: Team-Level Tool Confirmation

> AgentOS equivalent of cookbook/03_teams/20_human_in_the_loop/team_tool_confirmation.py.

```python team_tool_confirmation.py theme={null}
"""AgentOS HITL: Team-Level Tool Confirmation

AgentOS equivalent of cookbook/03_teams/20_human_in_the_loop/team_tool_confirmation.py

The confirmation-required tool is on the team itself (not a member agent).
When the team leader decides to use the tool, the run pauses until the
client confirms or rejects.

Run:
    .venvs/demo/bin/python cookbook/05_agent_os/hitl/team_tool_confirmation.py
"""

from agno.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.models.openai import OpenAIResponses
from agno.os import AgentOS
from agno.team import Team
from agno.tools import tool

# ---------------------------------------------------------------------------
# Storage
# ---------------------------------------------------------------------------

db = SqliteDb(
    db_file="tmp/agent_os_hitl.db",
    session_table="hitl_team_tool_sessions",
)

# ---------------------------------------------------------------------------
# Tools
# ---------------------------------------------------------------------------


@tool(requires_confirmation=True)
def approve_deployment(environment: str, service: str) -> str:
    """Approve and execute a deployment to an environment.

    Args:
        environment (str): Target environment (staging, production)
        service (str): Service to deploy
    """
    return f"Deployment of {service} to {environment} approved and executed"


# ---------------------------------------------------------------------------
# Create members
# ---------------------------------------------------------------------------

research_agent = Agent(
    name="Research Agent",
    role="Researches deployment readiness",
    model=OpenAIResponses(id="gpt-5-mini"),
    db=db,
    telemetry=False,
)

# ---------------------------------------------------------------------------
# Create team
# ---------------------------------------------------------------------------

team = Team(
    id="hitl-team-tool-confirmation",
    name="Release Team",
    members=[research_agent],
    model=OpenAIResponses(id="gpt-5-mini"),
    tools=[approve_deployment],
    instructions="You manage releases. Use the approve_deployment tool to deploy services. Call it immediately when asked to deploy.",
    db=db,
    telemetry=False,
)

# ---------------------------------------------------------------------------
# Create AgentOS
# ---------------------------------------------------------------------------

agent_os = AgentOS(
    id="hitl-team-tool-confirmation",
    description="AgentOS HITL: team-level tool requiring confirmation",
    teams=[team],
)

app = agent_os.get_app()

# ---------------------------------------------------------------------------
# Run
# ---------------------------------------------------------------------------

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

## Run the Example

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

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

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

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

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

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

Full source: [cookbook/05\_agent\_os/human\_in\_the\_loop/team/team\_tool\_confirmation.py](https://github.com/agno-agi/agno/blob/main/cookbook/05_agent_os/human_in_the_loop/team/team_tool_confirmation.py)
