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.
“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 class | Example | Default |
|---|---|---|
| Read | Search docs, inspect CRM | Automatic with least privilege |
| Draft | Prepare a reply or CRM update | Automatic, reviewable |
| Reversible write | Create a task or draft record | Rules plus audit log |
| External side effect | Send email, publish post | Human approval |
| Irreversible/high impact | Delete, refund, legal commitment | Explicit 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
- Validate incoming data.
- Call only the tools needed for the task.
- Validate tool arguments at the boundary.
- Produce a structured proposal.
- Pause for approval if policy requires it.
- Resume the same run after approval or rejection.
- 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:
| Metric | Why it matters |
|---|---|
| Proposal acceptance rate | Does the agent prepare useful actions? |
| Edit rate | How much correction is required? |
| Rejection reason | Where policy or quality fails |
| Time to approval | Whether the queue blocks operations |
| Duplicate/incident rate | Whether execution is safe |
| Outcome rate | Whether 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.