Skip to solution
mediumAI Engineering

How do you design human-in-the-loop approval for agent actions?

705 views
01

Understand the problem

Approval gates that catch the risky 2% without drowning users in confirmation fatigue.

human-in-the-loopapprovalssafetyagents
02

Attempt it yourself

Sketch your approach before reading the solution — that's what interviews test.

Nudge consolestandby

Stuck? Beam a request up — the console returns a conceptual nudge that guides your logic without spoiling the implementation.

03

Study the solution

Classify actions by reversibility and blast radius: auto-execute safe reads, batch-notify low-risk writes, and require explicit approval for irreversible or outward-facing actions (payments, emails, deletes, deploys). Present approvals with enough context to actually judge (what, why, diff/preview), support edit-then-a

Solution ready — 2 min read

Classified // press E to declassify

04

Read the code

Approval request with preview and scope
const decision = await approvals.request({
  action: "send_email",
  reason: agent.rationale,                     // why the agent wants this
  preview: { to: draft.to, subject: draft.subject, body: draft.body },
  editable: ["subject", "body"],               // human can fix, then approve
  scopeOffer: { kind: "session", pattern: "send_email:to=*@ourcompany.com" },
  approver: routeByAuthority(draft.to),        // account owner, not "anyone"
});

if (decision.status === "approved") await mailer.send(decision.finalPayload);
else agent.observe("Email rejected: " + decision.note);   // feedback, not silence
05

Join the discussion

Discussion (0)

Sign in to join the discussion.

No responses yet. Be the first to share what you think.

Transmission complete // awaiting log

KEEP THE
STREAK ALIVE.

Dossier 34 of 80 decoded in the AI Engineering track. One more won't hurt.

Back to track