> ## Documentation Index
> Fetch the complete documentation index at: https://phidatainc-redirect-agent-platform-overview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Human-in-the-Loop

> Pause agents for approval before executing sensitive tools.

[Human-in-the-Loop](/hitl/overview) solves three problems that appear when agents move from answering questions to taking actions:

1. **Irreversible operations.** Sending an email, deleting a record, or posting to a channel cannot be undone. A human checkpoint prevents mistakes that require cleanup or apologies.

2. **Missing context.** The agent knows what action to take but lacks a critical detail. A deployment needs a target environment. A booking needs a budget. Rather than guessing, the agent pauses and asks.

3. **Audit trail.** Sensitive operations need accountability. Slack threads already contain the discussion that led to the action. Rendering the approval in the same thread keeps the decision and its context together.

<Frame caption="Agent pausing for approval before creating a calendar event and sending an email">
  <video autoPlay muted loop playsInline controls className="w-full rounded-lg" src="https://mintcdn.com/phidatainc-redirect-agent-platform-overview/7T6Z7KMTMhNdtk6c/videos/slack-hitl.mp4?fit=max&auto=format&n=7T6Z7KMTMhNdtk6c&q=85&s=5b043bfc73ca744e980b2c4037b0a602" data-path="videos/slack-hitl.mp4" />
</Frame>

## Quick start

The Slack interface renders HITL pauses as interactive cards in the thread. Users approve, reject, or provide input without leaving Slack.

<Tabs>
  <Tab title="Agent">
    ```python agent.py theme={null}
    from agno.agent import Agent
    from agno.db.sqlite import SqliteDb
    from agno.models.openai import OpenAIResponses
    from agno.os import AgentOS
    from agno.os.interfaces.slack import Slack
    from agno.tools import tool

    @tool(requires_confirmation=True)
    def send_email(to: str, subject: str, body: str) -> str:
        """Send an email."""
        ...

    db = SqliteDb(db_file="agent.db")

    agent = Agent(
        name="Assistant",
        model=OpenAIResponses(id="gpt-5.4"),
        tools=[send_email],
        db=db,
    )

    agent_os = AgentOS(
        agents=[agent],
        db=db,
        interfaces=[Slack(agent=agent)],
    )
    app = agent_os.get_app()

    if __name__ == "__main__":
        agent_os.serve(app="agent:app", reload=True)
    ```
  </Tab>

  <Tab title="Team">
    ```python team.py theme={null}
    from agno.agent import Agent
    from agno.team import Team
    from agno.db.sqlite import SqliteDb
    from agno.models.openai import OpenAIResponses
    from agno.os import AgentOS
    from agno.os.interfaces.slack import Slack
    from agno.tools import tool

    @tool(requires_confirmation=True)
    def send_email(to: str, subject: str, body: str) -> str:
        """Send an email."""
        ...

    db = SqliteDb(db_file="agent.db")

    researcher = Agent(name="Researcher", model=OpenAIResponses(id="gpt-5.4"))
    writer = Agent(name="Writer", model=OpenAIResponses(id="gpt-5.4"), tools=[send_email])

    support_team = Team(
        name="Support Team",
        mode="coordinate",
        members=[researcher, writer],
        model=OpenAIResponses(id="gpt-5.4"),
        db=db,
    )

    agent_os = AgentOS(
        teams=[support_team],
        db=db,
        interfaces=[Slack(team=support_team)],
    )
    app = agent_os.get_app()

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

    When a member agent calls a tool that requires confirmation, the team pauses.
  </Tab>

  <Tab title="Workflow">
    ```python workflow.py theme={null}
    from agno.agent import Agent
    from agno.workflow import Step, Workflow
    from agno.db.sqlite import SqliteDb
    from agno.models.openai import OpenAIResponses
    from agno.os import AgentOS
    from agno.os.interfaces.slack import Slack
    from agno.tools import tool

    @tool(requires_confirmation=True)
    def send_email(to: str, subject: str, body: str) -> str:
        """Send an email."""
        ...

    db = SqliteDb(db_file="agent.db")

    researcher = Agent(name="Researcher", model=OpenAIResponses(id="gpt-5.4"))
    writer = Agent(name="Writer", model=OpenAIResponses(id="gpt-5.4"), tools=[send_email])

    research_flow = Workflow(
        name="Research",
        steps=[
            Step(name="Research", agent=researcher),
            Step(name="Write", agent=writer),
        ],
        db=db,
    )

    agent_os = AgentOS(
        workflows=[research_flow],
        db=db,
        interfaces=[Slack(workflow=research_flow)],
    )
    app = agent_os.get_app()

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

    Workflow step pauses surface in Slack the same way.
  </Tab>
</Tabs>

<Tip>
  HITL requires a [database](/features/storage) to persist paused runs.
</Tip>

## Pause types

| Pause type                                     | Slack card                                           | Trigger                             |
| ---------------------------------------------- | ---------------------------------------------------- | ----------------------------------- |
| [Confirmation](/hitl/user-confirmation)        | Approve/Reject buttons                               | `@tool(requires_confirmation=True)` |
| [User input](/hitl/user-input)                 | Text fields or dropdowns                             | `@tool(requires_user_input=True)`   |
| [External execution](/hitl/external-execution) | Confirm button, result fed back                      | `@tool(external_execution=True)`    |
| [User feedback](/hitl/dynamic-user-input)      | Dynamic forms: checkboxes, dropdowns, text questions | `UserFeedbackTools()`               |

See the [HITL overview](/hitl/overview) for details on each pause type.

## Next steps

<CardGroup cols={2}>
  <Card title="HITL Overview" icon="shield-check" href="/hitl/overview">
    All pause types and how to use them
  </Card>

  <Card title="Reference" icon="book" href="/agent-os/interfaces/slack/reference">
    All parameters and endpoints
  </Card>
</CardGroup>
