Cruxly

Cruxly › AI engineering › Agentic Systems

Human-in-the-Loop Design: When the Agent Should Ask

ask when a wrong action costs more than a person's ten seconds, and make those ten seconds enough

Open the interactive lesson

Prompt: "Our operations agent can send customer emails, update orders, issue refunds and change shipping addresses. We do not want a human on every action, and we do not want a bad email or a wrong refund going out unchecked. Where do the humans go, and what do they see?"

25 minutes first. The weak answer is "approve anything risky". The strong answer picks a mode per action using reversibility and the cost of being wrong, designs the approval message so a person can decide quickly and correctly, plans for the human not answering, and keeps the corrections people make because they are the best data you will ever get.

Three modes: approve, notify, review after

"Human in the loop" is not one design, it is three, and they differ in when the person acts.

ModeThe agentThe humanUse when
Approve beforePrepares the action and waits; it does not run until approvedDecides before anything happensIrreversible or expensive if wrong
Notify with undoActs, tells the person immediately, offers a quick undoCan reverse within a windowReversible, moderate cost, and speed matters
Review afterActs and logs; a sample or a digest is reviewed laterAudits patterns, not each actionCheap and reversible, high volume

Pick the mode with two questions: can it be undone, and how much does a wrong one cost?

Cheap if wrongExpensive if wrong
ReversibleReview after (change an internal tag, fetch a record)Notify with undo (change a shipping address before dispatch)
IrreversibleNotify, or approve if the volume is low (send a short status email)Approve before (large refund, delete data, message to an external partner)

Reversibility is a property of the world, not of the tool. A refund is "reversible" in principle (claw it back) but in practice the money has moved and the customer has been told. Ask whether the undo is cheap, fast and certain, not whether it exists.

A rough way to check the call is to compare expected loss with the cost of asking. If the agent is wrong on, for example, 2% of cases and a wrong action costs Rs 5,000, the expected loss per unattended action is 0.02 x 5,000 = Rs 100. A person reviewing it costs, for example, Rs 15 of attention. Ask before. For an action that costs Rs 200 when wrong, the expected loss is 0.02 x 200 = Rs 4, less than the Rs 15 of asking, so automate it and sample for review. The numbers are placeholders; the shape of the argument, expected loss against the price of a decision, is what the interviewer wants. The calculation assumes the human actually catches errors, which brings in the next sections.

:::key Enforce the mode in the tool, not the prompt As in the guardrails lesson, "ask before big refunds" written in a prompt is a suggestion. The tool for an approve-before action should return "pending approval" and create the request itself, so the model cannot talk its way past the gate. :::

The approval message: decide in ten seconds

An approval is only as good as the decision it enables. If the message is "Agent wants to proceed. Approve?", the person either rubber-stamps it or opens three other tabs to find out what it means, and the gate has failed in both cases. Design the request so the right decision takes about ten seconds. Four things, in this order.

@@ 1 | What will happen One plain sentence naming the action and its target. "Refund Rs 1,499 to the card used on order ORD-8812."

@@ 2 | Why The evidence, not the model's prose: the ticket line, the delivery record, the policy clause. A model's stated reasoning can be fluent and wrong, and it nudges a busy reader towards yes, so show the evidence first and label any rationale as model-written.

@@ 3 | What changes A diff. Before and after for each field the action touches, including side effects: "order status delivered to refunded; customer receives an email".

@@ 4 | How to undo it State whether it can be undone, how, and by when. "Cannot be undone after settlement (about 2 days)." Irreversible actions should look different from reversible ones.

A request for the example refund could look like this.

APPROVE?   Refund Rs 1,499 to card ending 4421          [Irreversible after settlement]
Why:       Ticket: "box arrived crushed". Delivered 12 Nov. Policy 4.2: damaged goods refundable within 7 days.
Changes:   order ORD-8812   delivered -> refunded
           customer         gets "refund issued" email
Risk note: customer has 2 refunds in the last 90 days (limit 3)
[Approve]   [Edit amount]   [Reject + reason]

Design choices worth saying aloud. Offer "edit" as a first-class button, because the agent is often 90% right and a person fixing the amount is cheaper than a reject and a retry. Require a reason on reject, which becomes data later. Bind the approval to the exact action: store a hash of the proposed call, and execute only that call. If the agent changes the amount after approval, the approval does not apply. Put the risky cues in the message, such as an amount near the limit or a first-time customer, instead of making the person go and find them.

Approval fatigue, timeouts, and what the agent does while it waits

If people approve 99.5% of requests, the gate is not protecting you. Either almost nothing it catches is real, or people have learned to click through. Both are bad, and you can see it in numbers you should be tracking from the first week.

SignalWhat it suggests
Approval rate near 100% and a median decision time of 2 secondsRubber-stamping, or the gate is on the wrong actions
High edit rate on one action typeThe agent is systematically a little wrong there; fix the agent or the tool
Rejects with the same reasonA rule that should become a hard limit or a prompt and tool change
Requests piling up unansweredToo many gates, or the wrong person is being asked

Ways to cut fatigue without removing safety.

Waiting is a state the agent must be designed for. A person may answer in 20 seconds or 20 hours.

Human edits as training signal, and the follow-ups

Every approval card produces a labelled example if you keep it. Store the proposed action, the final action the human allowed, the decision (approve, edit, reject), the reason, the decision time, and the evidence that was shown. Then:

Handle the data with care: the cards contain customer information, so apply the same redaction and retention rules as traces, and be sure that using human decisions for evaluation or training is covered by your policies and by what the approvers have been told.

Follow-ups they will ask.

"Why not just have the model decide whether it needs approval?" A model's confidence is not a reliable signal of whether it is right, and it can be pushed by the input. Use rules on the action (type, amount, target, irreversibility), and treat model confidence at most as an extra reason to ask, never as a reason to skip a rule.

"What if the only approver is on holiday?" Name an escalation chain and a default that fails toward blocked, and tell the customer the status. An approval queue with one person behind it is a single point of failure that you have designed in.

"How do we know the gates are working?" Track approval rate, edit rate, decision time and the canary catch rate, and read a sample of the approved ones. Compare incidents that slipped through against the gate settings at the time.

"Can we remove the human eventually?" Yes, per action type, and only on evidence: pass^k on the golden set, a low edit rate over a long period, and a cheap undo. Move one rung at a time (approve, then notify with undo, then review after) and keep the sample review running.

How to say it in the interview

"I would not use one rule for every action. There are three modes: ask first, tell after, and review later. I choose by two questions: can the action be undone, and what does it cost if it is wrong. Irreversible and expensive means approve before; reversible and cheap means just do it and log; in between, notify with an undo. The approval message has to let a person decide in about ten seconds: what will happen, why, what changes, and how to undo. If the approval rate is near 100 percent, the gate is either useless or being rubber-stamped, so I would measure that. And every edit a human makes is a labelled example I feed back into the eval set."

Checklist

Practice this interactively
Share this lessonWhatsAppLinkedInX

Related lessons