How to Build a Human-in-the-Loop AI Agent Workflow

Design AI agents that move quickly without creating silent risk. This guide covers approvals, guardrails, audit trails, and safe rollout patterns.

Kevan Shah · · 10 min read

“Fully autonomous” is often a poor product requirement. For many business workflows, the right target is autonomous preparation plus deliberate approval.

An agent can research, classify, draft, and propose. A person should approve actions that are external, irreversible, expensive, legally sensitive, or reputationally risky.

Classify actions by risk

Action classExampleDefault
ReadSearch docs, inspect CRMAutomatic with least privilege
DraftPrepare a reply or CRM updateAutomatic, reviewable
Reversible writeCreate a task or draft recordRules plus audit log
External side effectSend email, publish postHuman approval
Irreversible/high impactDelete, refund, legal commitmentExplicit approval and policy

OpenAI’s guardrails and human review documentation distinguishes automatic validation from human approval decisions. Use both.

The approval contract

An approval request should show the reviewer exactly what they are deciding:

{
  "action": "send_email",
  "recipient": "prospect@example.com",
  "subject": "Question about lead routing",
  "body": "...",
  "evidence": ["https://example.com/jobs"],
  "risk": "medium",
  "expires_at": "2026-08-28T18:00:00Z",
  "options": ["approve_once", "edit_then_send", "reject"]
}

Do not ask humans to approve “Agent step 14.” Show the proposed action, context, evidence, and consequences.

Build the workflow

  1. Validate incoming data.
  2. Call only the tools needed for the task.
  3. Validate tool arguments at the boundary.
  4. Produce a structured proposal.
  5. Pause for approval if policy requires it.
  6. Resume the same run after approval or rejection.
  7. Record the decision and result.

A paused run should be resumable rather than restarted from scratch. The OpenAI Agents SDK human-in-the-loop guide describes interruption and resumable state patterns.

Avoid rubber-stamp approvals

Approval systems fail when reviewers see too many low-quality requests. Improve the review queue by:

  • Auto-approving low-risk internal actions.
  • Grouping related proposals.
  • Showing confidence and evidence.
  • Setting expiry times.
  • Offering edit-and-continue.
  • Tracking approval reversal and rejection reasons.

The goal is not maximum approval volume. It is high-quality attention where it matters.

Test the edges

Create test cases for:

  • Missing evidence.
  • Conflicting sources.
  • Duplicate requests.
  • Prompt injection in retrieved content.
  • Tool timeout after a side effect.
  • Reviewer rejection.
  • Expired approval.
  • Partial downstream success.

Use idempotency keys for side effects. If the system retries after an uncertain response, it must not send the same email twice.

Measure the system

Track:

MetricWhy it matters
Proposal acceptance rateDoes the agent prepare useful actions?
Edit rateHow much correction is required?
Rejection reasonWhere policy or quality fails
Time to approvalWhether the queue blocks operations
Duplicate/incident rateWhether execution is safe
Outcome rateWhether approved actions work

Rollout pattern

Start with internal drafts. Then add reversible writes. Then expose one narrow external action to a small cohort. Expand permissions only after the logs and evaluation set show stable quality.

Common pitfalls

  • Asking for approval after the risky tool already ran.
  • Hiding evidence behind multiple clicks.
  • Allowing a reviewer to approve an ambiguous batch.
  • Failing open when the approval service is unavailable.
  • Keeping no record of who approved what.

Next steps

Map your workflows by action risk, create an approval schema, and launch one small queue. Human-in-the-loop is not an admission that AI failed; it is how responsible systems earn the right to do more.

Hangryfeed builds AI Employees with explicit permissions, review queues, and measurable operating boundaries. Book a strategy call to design your first workflow.