Recommended resources
The freely available resources this lesson will direct you to.
- How to Build Human-in-the-Loop for AI Agents (Practical Guide)www.youtube.com
- LangGraph: Build Human-in-the-Loop Agents That Never Breakwww.youtube.com
- How to Build Human-in-the-Loop Oversight for AI Agents | Galileogalileo.ai
- AI Agent Orchestration Patterns - Azure Architecture Centerlearn.microsoft.com
Introduction
In our previous lesson, we established a comprehensive governance framework for deploying agentic AI in financial services. One of the central pillars of that framework is the principle of tiered human oversight. We acknowledged that full autonomy is not always desirable or permissible, especially in high-stakes environments. This brings us to the critical design challenge of integrating human judgment into an agent's workflow.
This lesson directly addresses the learning outcome: Design human-in-the-loop patterns including approval gates, escalation triggers, and override mechanisms. We will move from the high-level policy of human oversight to the architectural and logical patterns required to implement it. You will learn to design the systems that allow an agent to pause, seek guidance, and act on human feedback in a structured, auditable manner. This is where the abstract concept of governance becomes a concrete engineering reality.
1. The "When": Designing Escalation Triggers
Before designing the interaction itself, we must first define precisely when an agent should stop and ask for human input. An effective Human-in-the-Loop (HITL) system is not one that requires constant supervision, as that negates the benefits of automation. Instead, it relies on well-defined escalation triggers that fire only when necessary.
These triggers form the first layer of your control system, acting as sensors for risk, uncertainty, and ambiguity.
How to Build Human-in-the-Loop Oversight for AI Agents
To build a robust system, you need a multi-faceted trigger strategy. The article 'How to Build Human-in-the-Loop Oversight for AI Agents' from Galileo provides an excellent, structured breakdown of the types of triggers you can implement.
Please read the section titled 'What Triggers Determine When Agents Escalate to Humans?'. As you read, focus on how the three primary categories of triggers—confidence scores, risk classification, and contextual factors—create a layered safety net.
As the article details, your trigger framework should combine several mechanisms:
- Confidence Score Thresholds: The agent's own assessment of its certainty can be a trigger. If the LLM's confidence in a classification, decision, or generated response falls below a set threshold (e.g., 90%), the task is escalated. It's crucial, as noted, that these scores are properly calibrated, as raw probabilities from a model can be misleadingly high.
- Risk Classification: Certain categories of tasks are inherently high-risk and require human oversight regardless of the agent's confidence. These can be defined by regulatory frameworks (like the EU AI Act's risk tiers) or internal policy.
- Example: Approving a wire transfer.
- Contextual Triggers: These are hard-coded business rules that reflect specific operational risks. They are independent of the LLM's reasoning and provide deterministic guardrails. Examples include:
- Financial Thresholds: Any underwriting decision for a loan above $1 million requires human review.
- Reputational Risk: Any communication directed at a client flagged as a "VIP" must be approved.
- Task Complexity: If an agent's reasoning chain exceeds a certain number of steps, it may indicate a complex or unusual situation requiring human analysis.
By combining these trigger types, you create a system that is both intelligent (reacting to model uncertainty) and robust (enforcing deterministic business rules).
2. The "How": Architectural Patterns for Human Intervention
Once a trigger fires, the system must pause the agent's autonomous execution and manage the interaction with a human. Architecturally, this is a non-trivial problem. The agent's state must be preserved, the request must be routed to the correct human, and the system must await a response, which may not be immediate.
There are two primary architectural patterns for managing this process, each with different trade-offs in terms of latency and control.
How to Build Human-in-the-Loop Oversight for AI Agents
The Galileo article also provides a concise overview of the core architectural patterns. Let's start there to understand the high-level trade-offs.
Read the sections 'Synchronous approval pausing execution' and 'Asynchronous audit for speed with delayed review'. Focus on the key trade-off: immediate control versus operational speed.
To make these abstract patterns concrete, let's explore how they are implemented in practice.
How to Build Human-in-the-Loop for AI Agents (Practical Guide)
The video 'How to Build Human-in-the-Loop for AI Agents' by Dave Ebbelaar offers a practical guide, walking through the implementation of both synchronous and asynchronous patterns. This will clarify the technical components involved.
Watch the segments covering the two production patterns: 'SSC streaming' (12:19 - 19:17) for synchronous approval and 'async process' (19:17 - 22:21) for asynchronous review. Pay close attention to the critical role of a 'state store' (database) in both patterns for preserving the agent's context during the pause.
Let's summarize the key design considerations from these resources:
A. Synchronous Approval (Approval Gates)
This pattern forces the agent to stop and wait for explicit permission before proceeding. It is the implementation of a true approval gate.

- Use Case: High-stakes, irreversible actions. Examples: executing a trade, disbursing loan funds, deleting customer data.
- Mechanism:
- The agent identifies a high-risk action (e.g., calling the
transfer_fundstool). - The orchestration layer intercepts the action, serializes the agent's current state (its goal, message history, pending action), and saves it to a state store (e.g., a database).
- The system notifies a human reviewer through a UI, email, or messaging platform (e.g., Slack).
- The agent process is paused.
- The human reviews the context and approves or denies the action.
- The system receives the human's response, retrieves the agent's state from the store, and resumes the agent's execution with the new information (approval or denial).
- The agent identifies a high-risk action (e.g., calling the
- Trade-off: Provides maximum control and safety at the cost of increased latency.
B. Asynchronous Audit (Human-on-the-Loop)
This pattern allows the agent to act autonomously while flagging certain actions for later review. This is often called "human-on-the-loop" or "human-over-the-loop."
- Use Case: Moderate-risk actions where mistakes can be corrected retroactively. Examples: classifying customer support tickets, generating internal summaries, drafting marketing emails.
- Mechanism:
- The agent performs an action.
- The action, along with its full context and reasoning, is logged to a separate review queue.
- The agent continues its work without waiting.
- Human reviewers periodically audit the queue, looking for errors, biases, or systemic problems.
- Trade-off: Maintains near-zero latency and high throughput, but error detection is delayed.
3. Orchestration Patterns for Collaboration
Beyond these basic synchronous/asynchronous patterns, we can use more sophisticated multi-agent orchestration patterns to structure human collaboration. These are particularly relevant in complex financial workflows.
AI Agent Orchestration Patterns - Azure Architecture Center
Microsoft's guide on AI agent orchestration patterns provides two highly relevant models for structuring human review: the 'Group Chat' pattern (specifically 'maker-checker loops') and the 'Handoff' pattern.
Read the sections on 'Group chat orchestration' and 'Handoff orchestration'. Also, review the short, dedicated section on 'Human participation' under 'Implementation considerations'. Note how the 'maker-checker loop' is a formalization of an approval workflow common in finance.
-
Maker-Checker Loop (a form of Group Chat): This is a powerful pattern for quality control.
- An agent (the "maker") creates an artifact (e.g., a risk assessment report, a draft response to a regulatory inquiry).
- The artifact is passed to a human reviewer (the "checker").
- The checker either approves it or provides feedback for revision.
- The feedback is passed back to the maker agent, which generates a new version. This cycle continues until approval.
- This directly mirrors established quality control processes in banking and insurance.
-
Handoff Orchestration (Escalation Path): This pattern defines a clear escalation trigger and path.
- An agent attempts to handle a task but determines it is outside its scope or capabilities.
- Instead of failing, it "hands off" the entire task context to another, more specialized agent or, crucially, to a human expert.
- This is the core of an effective escalation mechanism, ensuring that difficult cases are routed to the right person.
4. The "What If": Designing Override Mechanisms
A simple "approve/deny" is often insufficient. A robust HITL system must allow for more nuanced human input. This is the domain of override mechanisms, which give humans the power to not just veto an agent's action, but to correct it or guide it.

Modern agent frameworks like LangGraph provide primitives to build these sophisticated interactions.
LangGraph: Build Human-in-the-Loop Agents That Never Break
The video 'LangGraph: Build Human-in-the-Loop Agents That Never Break' provides an excellent technical deep-dive into implementing various human review actions. It moves beyond simple approval to show how to build update, feedback, and rejection logic.
First, watch the brief introduction to the core mechanism in LangGraph (06:00 - 08:19). Then, watch the detailed code walkthrough of the 'human_tool_review' node (18:53 - 31:47). This is a technical segment, but focus on the logic of the four possible human actions it handles: continue, update, feedback, and reject. This demonstrates the design of a comprehensive override system.
Let's break down the types of override actions a well-designed system should support, as illustrated in the video:
-
Continue / Approve: The simplest case. The human agrees with the agent's proposed action, and execution proceeds as planned.
-
Reject / Deny: The human vetoes the action. The system must then decide on the next step. A good design would have the agent report the rejection back to the user or try an alternative approach, rather than simply halting.
-
Update / Correct: This is a powerful override. The human doesn't just reject the action; they correct it.
- Example: The agent proposes to
transfer_funds(amount=1000, recipient='John Doe'). The human reviewer notices the name is misspelled and updates the tool call totransfer_funds(amount=1000, recipient='Jon Doh')before approving. The agent then executes the corrected action.
- Example: The agent proposes to
-
Feedback / Redirect: The human provides natural language guidance to the agent.
- Example: An underwriting agent recommends denying a loan. The human reviewer provides feedback: "Re-evaluate the application, but this time give more weight to the applicant's long-term relationship with the bank." The agent then takes this new instruction and re-runs its analysis.
Implementing these varied overrides transforms the human from a simple gatekeeper into a true collaborator, actively improving the agent's performance and ensuring its actions are precisely aligned with business intent.
Conclusion
Designing effective human-in-the-loop patterns is a cornerstone of responsible agent deployment. It's an exercise in systems design, balancing automation with control. By thinking through the three key dimensions—triggers, architectural patterns, and override mechanisms—you can build systems that are not only powerful but also safe, auditable, and trustworthy.
Key Takeaways:
- Design Starts with Triggers: A robust HITL system begins with defining precise escalation triggers based on a combination of model confidence, task risk, and hard-coded business rules (contextual triggers).
- Choose the Right Architectural Pattern: Your choice between synchronous approval (for high-stakes, irreversible actions) and asynchronous audit (for speed in lower-risk scenarios) is a critical trade-off between control and latency.
- Leverage Orchestration for Collaboration: Patterns like maker-checker loops and agent handoffs provide structured ways to embed human review and escalation into complex workflows, mirroring familiar business processes.
- Overrides Enable Nuanced Control: Go beyond simple approve/deny. A well-designed system includes mechanisms for humans to correct an agent's proposed action (update) or provide new instructions to guide its reasoning (feedback).
Preview of the Next Lesson:
Every action an agent takes, and every human intervention that guides it, must be recorded. In our next lesson, we will focus on the learning outcome: Design robust logging and auditability mechanisms to create a decision trail for every agent action. We will see how the HITL patterns we designed today generate the crucial data points that form the backbone of an immutable and compliant audit trail.