Skip to content

[Story1] Core HITL Agent & Escalation Framework #28

@gapilongo

Description

@gapilongo

Summary
Implement production-grade Human-in-the-Loop agent with role-based escalation, SLA tracking, and structured feedback capture. Agent must handle grey-zone routing (confidence 40-70%), high-risk approval workflows, and analyst collaboration with full audit trails.Key Deliverables

HITL Agent Core (agents/human_loop/base.py): Implement HumanLoopAgent with async review queues, timeout handling, and escalation logic supporting 3 analyst tiers (Analyst/Senior/Manager). Include confidence-based routing that triggers on: grey-zone scores (40-70%), ReAct analysis uncertainty, high-impact response actions requiring approval, or manual escalation requests.

Escalation Engine (agents/human_loop/escalation.py): Role-based routing with SLA enforcement (15min/2hr/4hr based on severity), automated escalation on timeout, on-call rotation support, and workload balancing across available analysts with priority queue management.

Feedback Capture (agents/human_loop/feedback.py): Structured feedback model storing analyst decisions (Approve/Deny/Request-More-Info), classification corrections (FP/TP), confidence adjustments, detailed reasoning, and suggested playbook modifications. Store feedback in Postgres with full lineage to alert state versions.

Workflow Integration: Update core/workflow.py routing logic to invoke HITL agent when needs_human_review() returns true. Implement _execute_human_loop() and _route_after_human_loop() with proper state synchronization and agent execution tracking.
Acceptance Criteria

[]Agent handles concurrent review requests with <100ms queue insertion
[ ]Escalation paths work for all 3 severity x 3 role combinations
[] Feedback stored with full audit trail and state version linkage
[] Integration tests cover timeout scenarios, approval workflows, and feedback loop
[] Metrics tracked: review queue depth, SLA compliance, escalation rate, analyst workload

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions