> ## 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: Confirmation Required

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

```python confirmation_required.py theme={null}
"""AgentOS HITL: Confirmation Required

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

A team member's tool requires human confirmation before execution.
When the tool is called the run pauses and the API response contains the
requirement. The client confirms or rejects, then calls continue_run.

AgentOS handles streaming and async automatically, so this single server
covers the sync, async, streaming, and async-streaming variants.

Run:
    .venvs/demo/bin/python cookbook/05_agent_os/hitl/confirmation_required.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_confirmation_sessions",
)

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


@tool(requires_confirmation=True)
def get_the_weather(city: str) -> str:
    """Get the current weather for a city."""
    return f"It is currently 70 degrees and cloudy in {city}"


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

weather_agent = Agent(
    name="WeatherAgent",
    model=OpenAIResponses(id="gpt-5-mini"),
    tools=[get_the_weather],
    instructions=(
        "You MUST call the get_the_weather tool to answer any weather question. "
        "Do NOT answer from your own knowledge."
    ),
    db=db,
    telemetry=False,
)

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

team = Team(
    id="hitl-confirmation-team",
    name="WeatherTeam",
    model=OpenAIResponses(id="gpt-5-mini"),
    members=[weather_agent],
    instructions="Delegate all weather questions to the WeatherAgent immediately.",
    db=db,
    telemetry=False,
    add_history_to_context=True,
)

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

agent_os = AgentOS(
    id="hitl-confirmation-required",
    description="AgentOS HITL: member tool requiring confirmation before execution",
    agents=[weather_agent],
    teams=[team],
)

app = agent_os.get_app()

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

if __name__ == "__main__":
    agent_os.serve(app="confirmation_required:app", port=7777, 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 `confirmation_required.py`, then run:

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

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