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:
-
AgentComponentautomatically 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:
- Intercepts tool calls before execution
- Presents tool calls to humans for approval/denial
- Continues execution only after approval
- 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
-
AgentComponentsupports tool approval via configuration - Tool calls are validated before presenting to humans
- Human approval/denial is properly handled
- Error scenarios are handled gracefully
Technical Notes
- Follow the component architecture patterns from #1216 (closed)
- Maintain consistency with existing
BaseComponentinterface - Consider performance impact of additional approval step
- Ensure proper state management throughout approval process
Related Issues
- Relates to #1216 (closed) (Base Component Class Architecture)
Edited by Mikołaj Wawrzyniak