Skip to main content
Human-in-the-Loop 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.

Quick start

The Slack interface renders HITL pauses as interactive cards in the thread. Users approve, reject, or provide input without leaving Slack.
agent.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.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)
HITL requires a database to persist paused runs.

Pause types

Pause typeSlack cardTrigger
ConfirmationApprove/Reject buttons@tool(requires_confirmation=True)
User inputText fields or dropdowns@tool(requires_user_input=True)
External executionConfirm button, result fed back@tool(external_execution=True)
User feedbackDynamic forms: checkboxes, dropdowns, text questionsUserFeedbackTools()
See the HITL overview for details on each pause type.

Next steps

HITL Overview

All pause types and how to use them

Reference

All parameters and endpoints