Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:ANative Lab EvoAgentX Human In The Loop

From Leeroopedia
Knowledge Sources
Domains HITL, Workflow, Agents
Last Updated 2026-10-21 00:00 GMT

Overview

Pattern for integrating human judgment into automated agent workflows via approval checkpoints, input collection, and execution interception.

Description

Human-in-the-Loop (HITL) is the practice of inserting human decision points into an otherwise automated agent workflow. A HITL manager mediates between the workflow and a human operator: when a workflow node with an interceptor agent is reached, the interceptor calls the manager to request human approval (or rejection) before the target agent's action executes. This enables human oversight of critical decisions, safety checks, and guided corrections without halting the entire workflow.

Usage

Use this principle when human oversight is needed at specific points in a workflow:

  • Pre-execution approval: Require human approval before an action runs (`mode=PRE_EXECUTION`)
  • Post-execution review: Review results after an action completes (`mode=POST_EXECUTION`)
  • User input collection: Collect structured input from the user mid-workflow
  • Interaction types: APPROVE_REJECT, REVIEW_EDIT_STATE, REVIEW_TOOL_CALLS, MULTI_TURN_CONVERSATION

Theoretical Basis

The HITL pattern intercepts the execution flow:

# Abstract pattern (not real implementation)
class HitlInterceptor:
    async def execute(self, target_action, hitl_manager):
        response = await hitl_manager.request_approval(
            target_action, inputs, interaction_type, mode
        )
        if response.decision == APPROVE:
            return target_action.execute(inputs)
        else:
            raise RejectedByHuman(response.feedback)

Key properties:

  • Interception: A special agent node intercepts another agent's execution
  • Async blocking: The workflow blocks until the human responds (with timeout)
  • Auto-approval: When HITL is inactive, all requests are auto-approved
  • CLI interaction: Human input is collected via CLI prompts
  • Node placement: HITL agents must be the only agent in their WorkFlowNode

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment