Keep Humans in the Loop
Human in the loop (HITL) is a checkpoint where a workflow waits for a person. In a room, the checkpoint is a conversation: an agent mentions you with a question, and you answer by mentioning the agent that should act next. This uses messages and mentions on every plan and with every adapter. The routing is deterministic; whether the agent follows the approval instruction depends on its model and instructions, not an enforced acceptance policy.
Prerequisites
- The sample project running in the Webhook Retries room, as set up in Set Up Your First Multi-Agent Room
How a Mention Approval Works
A message triggers only the agents it mentions, and an agent that is not mentioned never receives it, as Route Messages with @Mentions describes. An approval step uses that routing:
- Reviewer Agent asks you a question without mentioning Architect Agent, so that request does not trigger Architect Agent.
- Your reply mentions Architect Agent, so Band delivers it to Architect Agent. Its model then decides how to respond under its instructions; a mention alone does not enforce approval.
- Every person who can read the room sees the request and your answer, so the decision stays in the room’s history.
Each agent’s context lists the room’s participants with their type, User or Agent, so an instruction can tell an agent to mention the person in the room without knowing their handle.
Add an Approval Step
In this step, Reviewer Agent asks you to approve instead of telling Architect Agent that a change passed. Architect Agent is instructed to accept the change only after your approval reply mentions it. This is an instruction to the model, not a deterministic authorization check.
Ask for Approval in Reviewer Agent
In reviewer.py, replace the three lines from “If the code passes review” through “for Architect Agent.” with the approval request:
If you added the memory lines in Persist Knowledge with Memories, keep them.
Wait for Approval in Architect Agent
In architect.py, replace the lines about Reviewer Agent’s report:
Restart Both Agents
Stop reviewer.py and architect.py, then start them again:
Each agent is connected again when its log shows Agent started: Reviewer Agent (band-sdk 6.0.1) or Agent started: Architect Agent (band-sdk 6.0.1).
Run the Request
In Webhook Retries, send:
The agents run the plan, the review, and the fixes as before. The earlier requirements remain in Reviewer Agent’s rehydrated room context, so it should use them instead of asking Architect Agent again. Model behavior can vary; if it asks again, let Architect Agent answer. When the review passes, Reviewer Agent mentions you with a two-sentence summary and asks for your approval without mentioning Architect Agent.
To reject the change instead, mention Coder Agent with what to change, for example @Coder Agent Cap the retries at 3 attempts, then ask Reviewer Agent to review again. The review runs again, and Reviewer Agent asks you for approval when it passes.
Other HITL Mechanisms
A mention approval asks a person about the result of the work. Coding agents and Band Desktop also stop before individual actions, and the Agent API has an event type for flagging that a person is needed.
Approval Mode for Coding Agents
A coding-agent adapter with an approval mode can send the coding agent’s own approval prompts into the room, such as a request to run a command, and a participant answers each prompt there when the mode is manual. Approval Mode lists the adapters, settings, reply commands, and timeouts.
Questions and Permissions in Band Desktop
Band Desktop (formerly Jam) shows agent questions and permission requests from the coding agents it runs, and you answer them in the app. See Answer Agent Questions and Decide Permission Requests.
Attention Events in the Agent API
An agent can post an attention event to a room through Create agent chat event. Like other events, it needs no mention, and Band stores it in the room’s history.
A successful call returns HTTP 201 with data.id, data.message_type, and data.success. To associate a later event with this one, set the later event’s metadata.resolves to this event’s id. The API stores that value as metadata; it does not validate the referenced ID or change the original event.
As of band-sdk 6.0.1 and the current web app, attention events have these limits:
- In
band-sdk6.0.1,band_send_eventaccepts onlythought,error, andtask, so an SDK agent’s model cannot post anattentionevent through its tools. - The web app has no dedicated
attentionview. It displays the event as plain text and does not showkind,blocking, orresolves. To inspect those fields, use List my chat messages withmessage_type=attention. - A
metadata.kindoutside the four values returns HTTP 422 with codevalidation_errorand the messageattention metadata.kind is required and must be one of: question, assumption, failure, review. A non-booleanblockingreturnsattention metadata.blocking must be a boolean. - If an operator stopped the agent in the room, the call returns HTTP 403 with
Agent execution is stopped; cannot post events.