Stage 7 · Master
ChatOps & On-Call Copilots
Human-in-the-Loop Design
When to suggest, when to act, and how to keep the human accountable.
The Autonomy Spectrum
Human-in-the-loop is not binary. It is a spectrum from full human control to full autonomy. The right point on this spectrum depends on the action's reversibility, the model's track record, and the time pressure.
When to Suggest Only
- Destructive actions — deleting resources, dropping databases, removing users.
- Actions with downstream impact — scaling services that affect billing or capacity.
- Novel situations — the model has not seen this exact scenario before.
- Ambiguous alerts — the model is not confident about the root cause.
- Policy-sensitive actions — changes to RBAC, network policies, or secrets.
When to Act
- Read-only queries — getting pod status, reading logs, checking metrics.
- Information gathering — searching runbooks, looking up past incidents.
- Notifications — posting status updates, alerting the team.
- Well-understood, reversible actions — restarting a specific pod, clearing a cache.
Keeping the Human Accountable
The human must always know they are responsible. The AI assists, but the human owns the decision. This means the AI must present information clearly and not make it too easy to blindly approve.
def present_action_for_approval(action, context):
"""Present an action with enough context for informed approval."""
return f"""I recommend the following action:
**Command:** `{action['command']}`
**Risk level:** {action['risk_level']}
**Expected outcome:** {action['expected_outcome']}
**Side effects:** {action.get('side_effects', 'None identified')}
**Why this action:**
{action['reasoning']}
**Confidence:** {action['confidence']}
Type APPROVE to execute or CANCEL to abort.
Note: You are responsible for this action."""The approval message includes risk, side effects, and a reminder that the human is responsible. This prevents rubber-stamp approvals.
Design Patterns
| Pattern | When to Use | Example |
|---|---|---|
| Suggest + Confirm | Medium-risk actions | Suggest scaling, human confirms |
| Suggest + Auto-execute after delay | Low-risk with timeout | Restart pod after 60s if no objection |
| Act + Notify | Safe actions | Query metrics, post results to channel |
| Block + Escalate | High-risk | Block delete, page the team lead |
For low-risk actions, propose the action and auto-execute after 60 seconds unless the human cancels. This reduces friction for routine operations while preserving the human's veto power.
Mark this lesson complete to store local progress and unlock a cleaner resume path the next time you visit.