Velamuvi AIAcademy

Lesson 5 of 5 · Agency

Human-in-the-Loop Design

Keep people in control of AI agents: approval steps, review queues, undo, escalation and takeover. Decide by risk in code and avoid approval fatigue.

  • 5 min read
  • Intermediate
  • Reviewed
In this lesson you will learn
  • Describe the main ways people stay in the loop: approve, review, undo, take over
  • Decide in code which actions need a person, based on risk
  • Write approval requests that let people make real decisions
  • Avoid approval fatigue and rubber-stamping

People where they matter

PatternWhen the person actsGood for
Approve firstBefore the action runsPayments, external emails, deletions
Review queueBefore outputs are released, in batchesDrafted replies, generated reports
Report with undoAfter the action, within a windowLow-risk, reversible actions
EscalationWhen the agent is unsure or stuckAmbiguous requests, repeated failures
TakeoverAny time, on the person's initiativeLong-running or sensitive tasks

Deciding by risk, in code

The decision about when a person is needed belongs in the policy layer, written as code, so the model can't skip it:

Try it yourselfPython
from dataclasses import dataclass

@dataclass
class Action:
    kind: str            # e.g. "read", "draft", "send_external", "pay", "delete"
    detail: str
    amount: float = 0.0

def review_mode(action):
    """Where does a person come in? Decided by risk, not by the model."""
    if action.kind in ("read", "draft"):
        return "auto"                              # safe: no approval needed
    if action.kind == "pay" and action.amount <= 50:
        return "auto, shown in the daily summary"  # low-value and logged
    if action.kind in ("pay", "send_external"):
        return "approve first"                     # a person must confirm
    if action.kind == "delete":
        return "approve first, with an undo window"
    return "approve first"                         # unknown actions: be careful

queue = [
    Action("read", "Open supplier invoice INV-2201"),
    Action("draft", "Draft reply to supplier"),
    Action("pay", "Pay INV-2201", 38.0),
    Action("pay", "Pay INV-2202", 1250.0),
    Action("send_external", "Email remittance advice to supplier"),
    Action("archive", "Archive old invoices"),
]
for a in queue:
    print(f"{review_mode(a):<34} {a.detail}")

# What the approval request should show the person
a = queue[3]
print(f"\nApproval needed: {a.detail} for {a.amount:,.2f} EUR. "
      "Reason: amount over 50 EUR. Matches purchase order PO-118. [Approve] [Reject] [Edit]")

Reading and drafting run automatically; a 38-euro payment runs alone but appears in the daily summary; the 1,250-euro payment and the external email wait for approval. The unknown “archive” action defaults to approve first: when in doubt, ask.

Approval requests people can judge

An approval is only meaningful if the person can tell what they're approving. A good request shows:

  • Exactly what will happen: the recipient, amount, file or record.
  • Why approval is needed: the rule that triggered it.
  • Supporting context: the matching purchase order, the customer's history, the agent's reasoning.
  • Clear choices: approve, edit, reject (and, ideally, why).

Common mistakes

Practice exercise

Write a clear approval request: what exactly will happen, why a person must approve, and the choices.

Your solutionPython
action = {"tool": "send_email", "to": "[email protected]", "subject": "Revised quote",
          "reason": "external recipient"}

# Build the text of an approval request that tells the person exactly what will happen
# and why approval is needed, then lists the choices. Print exactly:
# Send email to [email protected]: "Revised quote"
# Needs approval: external recipient
# [Approve] [Edit] [Reject]
Knowledge check

People approve 99% of an agent's requests without changes and say they barely read them. What is the risk?

Summary

  • People stay in the loop by approving, reviewing, undoing, handling escalations and taking over.
  • Decide in code, by risk, which actions need a person; default to asking for unknown actions.
  • Approval requests should show what, why, the evidence and clear choices.
  • Watch for approval fatigue, and use human feedback to improve the agent.

Course complete

You now understand what “agentic” means, the levels of autonomy and how to choose them per action, the trade-offs between reliability and flexibility and between capability, cost and latency, and how to design meaningful human oversight. Next: the Agent Workflows course covers the standard patterns for predictable agentic systems.

Finished reading? Tick it off to track your progress.