Skip to main content

Human-in-the-Loop (HITL)

The HITL system lets human operators monitor, intervene in, and approve AI agent conversations. Configure when and how conversations escalate to humans, what users see during the process, and how approvals work.

Configuring HITL

Navigate to your agent’s Tools tab and click Escalate to Human to open the HITL configuration page. Settings are organized into three sections:

Escalation

Controls when and how conversations transfer to a human operator.

Queue & Availability

Controls what happens when operators are busy or offline.
When selecting fallback_email, a verified email input appears below the config form. You must verify the email via OTP before it can receive escalation notifications.

Approval

Controls whether AI responses require human review before being sent.

Conversations Module

The Conversations module is available at /conversations in the sidebar. It provides:

Overview

The Overview tab displays:
  • Stats bar: Pending escalations, active conversations, pending approvals, resolved today
  • Awaiting a response: Priority-sorted list of waiting escalations with one-click claim
  • Already being answered: Live conversations with operator involvement
  • Real-time updates: WebSocket-powered live feed of events

Approvals

The Inbox tab includes an Approvals chip listing every conversation whose latest AI response is awaiting review. Open one and the review panel sits above the reply box, showing:
  • They asked — the end-user message that triggered the response
  • The agent proposes — the full response text awaiting approval
The rest of the conversation is right there above it, which is the point of reviewing in the thread rather than on a list of disconnected cards: the agent, the channel and everything already said are all on screen. Operators can:
  • Send as written — publish the response unchanged to the end user
  • Edit first — modify the response text, then send. Edits are saved with a distinct edited status and the original response is preserved in the audit trail
  • Reject — reject the response; the AI resumes assisting the user

Status Management

Operators can set their availability status: Online, Busy, Away, or Offline. When an operator comes online, any queued escalations are automatically assigned to them if they have capacity.

Browser Notifications

The dashboard requests browser notification permission on first visit. When enabled, operators receive push notifications for:
  • New escalations
  • Escalation assignments
  • New user messages in active conversations
  • Responses awaiting approval

Notification Bell

A bell icon appears next to the Conversations nav item in the sidebar for all operator-role users. It shows a red badge with the count of pending items and a dropdown of recent alerts — visible from any page, not just the module.

How Escalation Works

  1. The AI decides to escalate (or an operator takes over manually)
  2. User sees the Escalation Started message
  3. If an operator is available → auto-assigned, user sees Operator Joined
  4. If no operators → user sees Queued message and waits
  5. Operator claims from dashboard → sends messages directly to user
  6. Operator hands back or closes → AI resumes (or conversation ends)
  7. If queue timeout expires → user sees Expired message, AI resumes

Concurrency Safety

Multiple operators can work simultaneously without conflicts. All claim and approval operations use atomic database updates — if two operators click “claim” at the same time, only one succeeds and the other sees an “already claimed” message.