AI Space

AI Models & Assistants / Knowledge library

Human Approval Loop

Pauses an agent before a consequential action and resumes only after a person decides

Human-in-the-loop control pattern

Why learn Human Approval Loop?

It preserves human authority for high-impact, ambiguous, or externally visible decisions.

The problem it solves

It prevents autonomous execution from crossing sensitive boundaries without informed review.

Where it came from

An approval loop presents the proposed action and sufficient context, persists pending state, and records approval, rejection, or edits. Approval must occur before the side effect and should bind to the exact action reviewed.

Build your understanding

Work through these exercises in order. Try the task before opening a reference.

  1. Define Human Approval Loop and identify its place in an agent architecture.
  2. Choose a task where Human Approval Loop improves an agent system.
  3. Diagnose one failure caused by misusing Human Approval Loop.
  4. Interpret a trace or state transition involving Human Approval Loop.
  5. Explain one operational tradeoff of Human Approval Loop.

Documentation and sources

Connect the ideas

Explore next

Agent GuardrailsAgent CheckpointingDurable Agent ExecutionEvent-Driven Agent LoopSandboxed Agent Execution

Real World Example

Illustrative business scenario · AI-generated from linked documentation · Not a measured customer case study

Automated Financial Disbursement Review

Corporate finance departments managing automated vendor payments.

The business problem

Unchecked automated agents might execute high-value wire transfers based on misidentified invoice data, leading to significant financial loss.

How this topic solves it

The Human Approval Loop pauses the agent execution when a sensitive tool call is triggered, requiring a manual decision before the transaction proceeds.

  1. Define a function tool for wire transfers with needs_approval set to True.
  2. Execute the agent run until it reaches the pending tool call.
  3. Inspect the RunResult.interruptions property to identify the pending transaction.
  4. Convert the result to a RunState and apply the human decision using state.approve or state.reject.
  5. Resume the agent execution using the updated RunState.
Approval Loop Execution Flow · Process flow

The flow shows how an agent pauses upon reaching a sensitive tool call and waits for external intervention.

Agent

Processes invoice data

Tool

Wire Transfer (needs_approval=True)

Runner

Pauses execution

Human

Reviews and approves/rejects

Resume

Continues execution

  • Agent → calls → Tool
  • Tool → triggers interruption → Runner
  • Runner → awaits input → Human
  • Human → provides decision → Resume
  • Resume → resumes → Agent

Implementation example

This demonstrates marking a sensitive function as requiring approval and using the RunState to resume the agent after the human decision is processed.

python · Illustrative code; not executed or production-validated.

@tool(needs_approval=True)
async def execute_transfer(amount: float, account: str) -> str:
    # Logic to perform the actual bank transfer
    return f"Transferred {amount} to {account}"

# After runner pauses:
state = result.to_state()
# Apply human decision
state.approve(interruption)
# Resume the agent
result = await Runner.run(agent, state)

Expected business outcome

Financial operations maintain high velocity while ensuring that all high-value disbursements undergo mandatory human oversight.

Limitations and checks

The RunState snapshot does not include built-in authentication for the person submitting the approval; the application must verify the reviewer's identity and authorization before calling state.approve.

Sources

Generated 2026-10-18 with gemini-3.1-flash-lite. Your assessment includes two questions about this example.

Catalog source: technology-maxxing. This page reproduces the existing catalog’s learning material and source links.