Skip to main content

Someone wanted to learn this too, so Grasp built them a personal learning path.

You can keep exploring this one or create your own

Approval Workflows and Escalation Triggers

Hello! Welcome back to our module on "Human-in-the-Loop and Guardrails."

In our last lesson, we established a strategic framework for deciding when and why to integrate human oversight into an agentic workflow. We identified the key drivers—high stakes, uncertainty, and the need for uniquely human judgment—and explored the architectural shift required to support long-running, stateful processes involving human interaction.

This lesson moves from strategy to tactical system design. Our goal is to answer the question: how do we build the specific mechanisms for human intervention? We will focus on designing the two core components of any robust human-in-the-loop system: approval checkpoints and escalation triggers. Mastering these will enable you to build agentic workflows that are not only powerful but also safe, auditable, and trustworthy—critical attributes for the services you intend to offer clients.

1. The Core Pattern: Plan-Validate-Execute

Before an agent takes a significant action, especially one that is irreversible or costly, we need to introduce a point of inspection. The most robust architectural pattern for this is the two-phase action, more commonly described as Plan-Validate-Execute. This pattern enforces a "measure twice, cut once" discipline on your agentic system.

Instead of allowing an agent to move directly from reasoning to action, we break the process into distinct phases:

  1. Plan: The agent analyzes the request and its available context and generates a structured, explicit proposal for what it intends to do. This plan is not a conversational text blob; it's a machine-readable artifact.
  2. Validate: The orchestration layer (the "control plane" of your system) subjects this plan to a series of deterministic checks. These can include policy checks, business rule validation, risk scoring, and, crucially, routing for human approval.
  3. Execute: Only if the plan passes all validation checks (including human sign-off, if required) is the agent or a tool permitted to execute the specified actions.

This separation is fundamental to building predictable and safe systems.

Orchestrating AI Agents in Production: The Patterns That Actually Work

The article 'Orchestrating AI Agents in Production' provides an excellent, production-focused overview of this pattern. It frames it as a non-negotiable for building trustworthy agents.

Please read 'Pattern 4: Two-phase actions (Plan → Validate → Execute)'. Pay close attention to the example 'plan' artifact. Notice its structure: it contains the objective, a sequence of tool calls, a risk assessment, and a flag indicating if approval is required. This is the kind of structured output you should design your agents to produce.

The "Validate" step is where we insert our approval checkpoint. Let's explore the architectural options for implementing this.

2. Designing Approval Checkpoints

An approval checkpoint is a state in your workflow where execution pauses, awaiting external input. The design of this checkpoint involves a trade-off between control and latency.

A. Synchronous Approval

In this pattern, the workflow physically stops and waits for a human to make a decision. The agent's process is paused until it receives an "approve" or "reject" signal.

Human-in-the-loop Agent Pattern: The Safety Valve Approach
This diagram illustrates a classic synchronous approval loop. The 'Transaction Agent' processes a request, but for high-stakes actions like a large financial transaction, it enters a 'Human Approval Loop.' Execution only resumes after the 'Human Reviewer' provides a decision.

This pattern provides maximum safety and is essential for:

  • High-risk financial transactions.
  • Actions with legal or regulatory consequences.
  • Any irreversible change to critical data.

The main drawback is latency. The workflow is blocked for as long as the human takes to respond. Given your background, you can appreciate that implementing this requires a durable execution framework capable of managing state over long periods (minutes, hours, or even days).

Human-in-the-Loop (HITL) for AI Agents: Patterns and Best Practices

In this video from Temporal, the presenter provides a fantastic technical walkthrough of how a durable execution system enables synchronous approval checkpoints. It shows the code-level primitives that make this pattern feasible.

Please watch the segment from 19:26 to 22:36. The key mechanism to focus on is workflow.wait_condition. This demonstrates how a workflow can be programmed to pause its execution based on a state variable that is changed by an external signal (the human's decision). This is a concrete implementation of a synchronous approval checkpoint.

B. Asynchronous Audit

In contrast, this pattern allows the agent to execute its plan immediately but flags the action for later human review.

This is suitable when:

  • The risk of an incorrect action is moderate and, crucially, reversible.
  • Workflow latency is a primary concern.
  • The goal is quality control and system monitoring, rather than real-time prevention.

For example, an agent that categorizes support tickets might operate asynchronously. If it miscategorizes a ticket, a human can correct it later with minimal impact.

How to Build Human-in-the-Loop Oversight for AI Agents | Galileo

The article 'How to Build Human-in-the-Loop Oversight for AI Agents' discusses these architectural choices in detail, providing clear guidance on when to use each.

Please read the subsections 'Synchronous approval pausing execution' and 'Asynchronous audit for speed with delayed review'. Compare the use cases and trade-offs for each pattern. This will help you decide which is appropriate for a given client problem.

For most client-facing services involving meaningful actions, a synchronous approval pattern for high-risk decisions is the default choice for building trust and ensuring accountability.

3. Designing Escalation Triggers

An approval checkpoint is the "what"; an escalation trigger is the "why." Triggers are the specific, programmable rules that determine when an agent's plan must be routed to a human for approval. Designing a comprehensive set of triggers is key to balancing autonomy with safety.

A robust system combines multiple types of triggers:

A. Confidence-Based Triggers

The agent itself can signal uncertainty. If the LLM's confidence in its own generated plan or decision falls below a set threshold, it triggers an escalation.

  • Implementation: You set a threshold (e.g., escalate if confidence < 90%).
  • Context is Key: The appropriate threshold is domain-specific. Financial services might require >95% confidence, while internal content tagging might tolerate 80%.
  • A Deeper Consideration: Raw probability outputs from LLMs (softmax values) are often poorly calibrated and shouldn't be treated as true confidence scores. Production systems often require post-hoc calibration techniques (e.g., temperature scaling, conformal prediction) or the use of specialized evaluation models to get reliable confidence metrics. This is a critical detail for building reliable triggers.

B. Rule-Based & Contextual Triggers

These are deterministic business rules encoded into the orchestration logic. They are independent of the agent's confidence.

  • Financial Thresholds: if transaction_amount > $1000, escalate.
  • Reputational Risk: if customer_tier == 'VIP', escalate.
  • Task Complexity: if request involves > 3 distinct systems, escalate.
  • Policy Violations: if proposed_action requires access to PII and agent_permissions == 'tier-1', escalate.

C. Anomaly-Based Triggers

This is a more sophisticated approach where the system detects deviations from normal operating patterns. For instance, if an agent that normally takes 5 seconds to generate a plan suddenly takes 60 seconds, or if its plan involves an unusual combination of tools, the orchestrator can trigger a human review, even if the agent reports high confidence. This acts as a safety net for "unknown unknowns."

The following resource provides a superb breakdown of these trigger categories.

How to Build Human-in-the-Loop Oversight for AI Agents | Galileo

The Galileo article provides a detailed framework for designing escalation triggers, which is directly applicable to our work.

Please read the entire section 'What Triggers Determine When Agents Escalate to Humans?'. Pay special attention to the target escalation rates mentioned (10-15%). This is a crucial operational metric: if your escalation rate is too high, your human reviewers become a bottleneck, defeating the purpose of automation.

4. Designing the Escalation Path

Once a trigger is fired, what happens next? A well-designed system needs an explicit, auditable escalation path.

Orchestrating the Handoff

This is where multi-agent system design principles become relevant. The orchestrator, acting as a supervisor, routes the task from the specialist agent to a "human-review" state or even a conceptual "human agent."

AI in the Human Loop: Agentic Architecture Framework
This framework illustrates a hierarchical control structure. An escalation trigger effectively moves a task from the 'Operational (AI)' layer up to the 'Tactical (AI+Human)' or 'Intervention (Human)' layers. The orchestrator manages these state transitions.

Frameworks like LangGraph are designed to manage these kinds of conditional handoffs within a graph structure, where a human review loop can be a node in the graph.

Multi Agent Systems - a complete guide with hands-on using LangGraph | Agent Design Pattern

While focused on multi-agent systems, this video on LangGraph demonstrates the core concepts of building a supervisor that routes tasks between different workers. You can think of the 'human reviewer' as just another worker in this graph.

Watch the segment from 22:26 to 28:52, which explains how a general-purpose supervisor node is built. The key concept is that the supervisor uses a structured output model to decide which 'member' to route the task to next ('research team', 'writing team', or 'finish'). In our HITL context, one of these members could be 'human_approval'. This shows how routing logic for escalation can be programmed.

The Human Review Interface: A Critical Product Surface

The final piece is the interface where the human performs the review. This is not just a UI detail; it's a critical part of the system's design for safety and efficiency.

A poorly designed interface can lead to rubber-stamping or incorrect decisions. As a system architect, you must specify what the review interface presents. The Hatchworks article (LINK), in "Pattern 8," provides an excellent checklist. A good review UI should show:

  • The original user input and relevant context.
  • The key evidence the agent retrieved and used.
  • The agent's structured plan, not a verbose chain-of-thought log.
  • Which policy or rule checks passed or failed.
  • Clear, granular actions for the human: Approve Plan, Reject Plan, Edit Plan.

By capturing the human's decision and the rationale, you also generate invaluable data for your evaluation dataset, creating a feedback loop for continuously improving the agent and reducing future escalations.

Conclusion

In this lesson, we have moved from the "why" of human oversight to the "how," establishing concrete architectural patterns and design principles for building safe and reliable agentic systems.

Key Takeaways:

  • Plan-Validate-Execute is the Foundation: Enforce this two-phase pattern for any significant agent action to ensure safety and auditability.
  • Choose the Right Checkpoint: Use synchronous approval for high-risk, irreversible actions where control is paramount. Use asynchronous audit for lower-risk, reversible actions where speed is essential.
  • Design a Multi-Layered Trigger System: Combine confidence-based, rule-based, and anomaly-based triggers to create a comprehensive safety net that balances autonomy and oversight.
  • Engineer the Entire Escalation Path: The system's responsibility doesn't end at the trigger. You must design the routing mechanism and specify the requirements for the human review interface to ensure the handoff is effective.

In our next lesson, we will focus on the rules themselves. We'll explore how to design and implement prompt-based and programmatic guardrails that define an agent's safety boundaries and expected behavior, forming the very policies that our escalation triggers will enforce.

Can't find a good explanation? Sign up and we'll make it for you

Sign up