Skip to main content

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.

When an agent or team pauses for human-in-the-loop, the Slack interface renders the pause as an interactive TaskCard in the channel. The user resolves it with buttons and inputs, and the run resumes. All four pause types are supported.

Example

A paused run is persisted to the database and resumed by run_id when the user resolves the TaskCard, so the Slack interface needs a db.
cookbook/05_agent_os/interfaces/slack/hitl_simple.py
import json
import httpx
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 get_top_hackernews_stories(num_stories: int) -> str:
    """Fetch top stories from Hacker News."""
    response = httpx.get("https://hacker-news.firebaseio.com/v0/topstories.json")
    story_ids = response.json()
    return json.dumps(story_ids[:num_stories])


db = SqliteDb(
    db_file="tmp/hitl_simple.db",
    session_table="agent_sessions",
)

agent = Agent(
    name="HN Agent",
    id="hn-agent",
    model=OpenAIResponses(id="gpt-5.4"),
    tools=[get_top_hackernews_stories],
    db=db,
)

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

if __name__ == "__main__":
    agent_os.serve(app="hitl_simple:app", reload=True, port=7777)

Pause Types

Each pause type renders a different TaskCard:
Pause typeSlack UITrigger
ConfirmationApprove / Reject buttons. Multiple pending tools render as separate rows.@tool(requires_confirmation=True)
User inputText fields, or dropdowns for Literal/Enum-typed fields.@tool(requires_user_input=True)
User feedbackOption buttons from a structured question.UserFeedbackTools
External executionConfirm button. The tool runs outside the agent, result is fed back.@tool(external_execution=True)
Rejections collect a reason where applicable, which is passed back to the agent so it can adjust.

Teams and Workflows

The same TaskCards work for teams and workflows. When a member agent inside a team pauses, the pause propagates to the team run and surfaces in Slack. Workflow step and executor pauses surface the same way.
PatternCookbook
Agent confirmationhitl_confirmation.py
User inputhitl_user_input.py
External executionhitl_external_execution.py
Structured feedbackhitl_user_feedback.py
Team confirmationteam_hitl_confirmation.py

Next Steps

TaskGuide
Understand pause typesHITL overview
Set up the Slack interfaceSlack introduction
Manage approvals in AgentOSApprovals overview