Skip to content

Implement Human-in-the-Loop Tool Approval in AgentComponent

Summary

Integrate human-in-the-loop mechanism into AgentComponent to enable human approval of tool calls generated by AI agents before execution, following the design patterns established in the componentization architecture.

Description

This issue is a follow-up to #1216 (closed) and implements part of the design document from gitlab-com/content-sites/handbook!14034 (merged). The goal is to enhance the AgentComponent located at duo_workflow_service/agent_platform/experimental/components/agent/component.py with human approval capabilities for tool execution.

Current State:

  • AgentComponent automatically executes tool calls without human oversight
  • Tool execution flows directly from agent node to tool node via _agent_node_router
  • No mechanism exists to pause execution for human review

Proposed Solution: Implement a configurable human approval mechanism that:

  1. Intercepts tool calls before execution
  2. Presents tool calls to humans for approval/denial
  3. Continues execution only after approval
  4. Handles rejection scenarios gracefully

Reference Implementation: Use duo_workflow_service/components/human_approval/tools_approval.py as a reference for:

  • Tool call validation and filtering
  • Approval request formatting
  • Human interaction patterns
  • Error handling for malformed tool calls

Acceptance Criteria

  1. AgentComponent supports tool approval via configuration
  2. Tool calls are validated before presenting to humans
  3. Human approval/denial is properly handled
  4. Error scenarios are handled gracefully

Technical Notes

  • Follow the component architecture patterns from #1216 (closed)
  • Maintain consistency with existing BaseComponent interface
  • Consider performance impact of additional approval step
  • Ensure proper state management throughout approval process

Related Issues

Edited by Mikołaj Wawrzyniak