Human-in-the-Loop Agent Design: When to Let AI Decide and When to Ask a Human
The question is not whether AI agents should operate autonomously or under human control. The question is: for each specific decision, what is the right balance? This framework helps manufacturing leaders design human-in-the-loop (HITL) patterns that maximize the benefits of automation while maintaining appropriate human oversight.
The Autonomy Spectrum
Every agent decision falls somewhere on this spectrum:
- Full automation -- Agent decides and acts without any human involvement
- Notification -- Agent decides and acts, then notifies humans afterward
- Approval gate -- Agent proposes an action, human approves or modifies, then agent executes
- Recommendation -- Agent analyzes and recommends, human decides and acts
- Information -- Agent presents data and analysis, human does everything else
The right position on this spectrum depends on four factors.
Factor 1: Consequence Severity
What is the worst outcome if the agent makes the wrong decision?
Low consequence (Full automation): - Adjusting a non-critical process parameter by 2% - Creating a low-priority work order for routine maintenance - Sending a shift performance report
Medium consequence (Notification or Approval): - Changing production schedule sequence - Ordering spare parts above a cost threshold - Adjusting a quality inspection parameter
High consequence (Recommendation or Information): - Emergency equipment shutdown - Quality hold on finished product lot - Actions affecting food/pharma safety - Actions with regulatory compliance implications
Factor 2: Reversibility
Can the action be undone?
Easily reversible (Higher autonomy): - Adjusting a temperature setpoint (can be changed back immediately) - Resequencing production orders (can be rescheduled) - Modifying machine speed (can be restored)
Difficult to reverse (Lower autonomy): - Scrapping a batch of material - Releasing product to customers - Modifying equipment hardware - Committing to supplier contracts
Factor 3: Decision Confidence
How confident is the agent in its decision?
Agent confidence-based routing: - Above 95%: Full automation - 85-95%: Execute with notification - 70-85%: Propose with approval gate - Below 70%: Present as recommendation with alternatives
The thresholds should be calibrated per use case based on consequence severity.
Factor 4: Regulatory Requirements
Some decisions require human involvement regardless of agent capability:
- FDA-regulated processes -- Certain decisions in pharmaceutical and food manufacturing require documented human review
- Safety-critical operations -- OSHA and IEC 62443 may require human authorization for specific actions
- Financial thresholds -- Purchase orders above certain values may require human approval per company policy
- Quality release -- Final product release may require qualified person sign-off
HITL Design Patterns
Pattern 1: Escalation Ladder
The agent starts with full autonomy and escalates when needed:
- Agent detects anomaly and attempts automated resolution
- If confidence is below threshold: escalate to shift supervisor
- If shift supervisor does not respond in 15 minutes: escalate to maintenance manager
- If safety-critical: immediate escalation to plant manager with automated safety measures
Pattern 2: Graduated Trust
The agent earns autonomy over time:
- Week 1-4: All actions require human approval (agent recommends, human approves)
- Month 2-3: Routine actions automated, novel situations require approval
- Month 4-6: Most actions automated, only high-consequence decisions require approval
- Month 7+: Full autonomy for all situations within defined envelope
Trust metrics that gate graduation: - Recommendation accuracy (target: 90%+ for graduation) - False positive rate (target: < 5%) - No safety incidents caused by agent actions - Operator satisfaction scores
Pattern 3: Dual Control
For high-stakes decisions, require both agent and human agreement:
- Agent analyzes situation and proposes action
- Human independently analyzes (possibly with agent assistance)
- Action proceeds only if both agent and human agree
- Disagreements trigger a deeper review process
Pattern 4: Supervised Learning Loop
Human decisions become agent training data:
- Agent presents situation with analysis
- Human makes decision
- Agent records decision with context
- Periodically, human decisions are reviewed and used to improve agent reasoning
- As agent accuracy improves, more decisions shift toward automation
Implementing HITL in Agent Frameworks
CrewAI
CrewAI supports human_input=True on individual tasks. When set, the task pauses and presents its output for human review before proceeding.
Google ADK
ADK supports approval gates in the orchestration layer. You can configure approval requirements per tool or per action type.
Custom Implementation
For custom HITL: - Implement a notification system (Slack, Teams, SMS, HMI dashboard) - Define timeout periods (what happens if the human does not respond?) - Log all human decisions for audit trail - Track time-to-response for different escalation levels
Common Mistakes
- Too much human involvement -- If humans approve everything, they develop "approval fatigue" and rubber-stamp without reviewing
- Too little human involvement -- If agents act without any oversight, mistakes compound and trust erodes
- No timeout handling -- If a human approval is required and the human is unavailable, what happens? Always define default actions.
- Inconsistent escalation -- Different shifts or operators should follow the same escalation rules
- No feedback loop -- If human overrides are not analyzed, the agent never improves
The Goal: Appropriate Autonomy
The goal is not maximum autonomy -- it is appropriate autonomy. The right level of human involvement varies by: - Decision type - Organizational maturity with AI - Regulatory environment - Risk tolerance - Individual agent track record
Design for the level of autonomy your organization is ready for today, with a clear path to earn more autonomy over time.