Agentic AI Patterns

Course Content

Agentic AI Patterns

9 sections · 50 lessons

What is the human-in-the-loop (HITL) approach, and when is it necessary?


A payout above the limit pauses, then resumesAgent stopsbeforeapprove_payoutStatecheckpointed;process endsAdjuster seesamount,clauses, evidenceApprove, editor rejectwith a reasonNew runresumes fromthe checkpointThe queue fell from 300 to 90 cases a day once safe payouts were promoted.
Gating the risky few is what keeps the human a reviewer instead of a rubber stamp.

What you need to know

Where humans can sit

ModeWhat the human doesExample
ApproveYes or no on an exact actionApprove a Rs 3 lakh claim payout
EditChange the draft or arguments, then approveEdit a customer letter before sending
Take overHandle the case themselvesComplex complaint escalated to a senior agent
Review afterAudit a sample laterWeekly sample of autonomous refunds

Only the first three are "in the loop". Review-after is "on the loop", which suits low-risk, reversible actions.

When it is necessary

  • Irreversible or costly: payments, deletions, production changes, external emails.
  • Regulated or high-liability: clinical, credit, insurance denial, hiring. The EU AI Act, for example, requires human oversight for high-risk systems.
  • Low confidence or unusual input: out-of-distribution cases.
  • New systems: until approval data shows an action is safe.

How to implement it

  1. Interrupt — the orchestrator stops before the gated tool call.
  2. Persist — the full state is checkpointed to durable storage; the approval may take hours.
  3. Preview — the human sees the exact action: payload, diff, draft, amount, plus the evidence behind it.
  4. Decide — approve, edit or reject with a reason.
  5. Resume — the agent continues from the checkpoint with the decision in its state.
  6. Log — who approved what, when, and what they changed.

Two points people miss

  • Approval data is free labelled data. It shows which action types are safe to automate.
  • Over-gating fails too. A reviewer approving 400 items a day stops reading. That is the appearance of oversight without the substance, sometimes called automation bias.

A real-life example

A motor insurer's claims agent drafts decisions. Gates:

  • Payouts above Rs 1 lakh, any denial, and any claim with a fraud score above 0.7 pause for an adjuster.
  • The adjuster sees the draft decision, the payout breakdown from the calculation tool, the documents cited, and the policy clauses, all on one screen.

In the first month, adjusters edited 18% of denials, mostly citing the wrong exclusion clause. That data led to a better clause-retrieval step, and edits fell to 6%. Payouts under Rs 1 lakh with complete documents, approved unchanged 99% of the time over 2,000 cases, were moved to autonomous with a weekly 5% audit sample. Adjusters' queue fell from 300 to 90 cases a day, and each case now gets real attention.

Follow-up questions to expect

  • "How does the agent wait for hours without holding resources?" — It does not keep running. State is checkpointed, the process ends, and the approval event starts a new run from the checkpoint.
  • "What should the reviewer see?" — The exact action and its evidence, not a model-written summary of intent. Summaries can hide the risky detail.
  • "How do you avoid rubber-stamping?" — Gate fewer, riskier actions; show the evidence; measure review time and disagreement rate; sample-audit the reviewers.