Claude Code vs Codex: The Real Differences in 2026
Claude Code vs Codex compared on pricing, GitHub automation, open source status and the latest releases from Anthropic and OpenAI.
7 min read
Human in the loop AI agents pause before a risky action so a person can approve, reject or edit it. How the pattern works, real frameworks, and when to skip it.
Human in the loop AI agents are systems where an autonomous agent pauses before a specific action and waits for a person to approve, reject or edit it before continuing. The pattern sits between full automation and a human doing the work directly: the agent still plans, calls tools and drafts the action, but a person signs off before anything irreversible happens.
Human in the loop AI agents combine the speed of an autonomous agent with a checkpoint a person controls. The agent proposes an action such as a refund, a database change or a sent email; execution pauses; a person approves, rejects or edits the request; and only then does the agent continue, according to Permit.io's framework guide and IBM's HITL explainer.
Every human-in-the-loop implementation follows the same shape, whatever the framework: the agent reaches a decision point, calls something like interrupt() or a requestConfirmation() method, the runtime persists its state, and the workflow waits, sometimes indefinitely, until a decision arrives. When it does, that decision becomes the return value inside the paused function and execution resumes from exactly where it stopped.
LangGraph, LangChain's graph orchestration library, implements this with an interrupt() function called from inside a node:
from langgraph.types import interrupt
def approval_node(state: State):
# Pause and ask for approval
approved = interrupt("Do you approve this action?")
# When you resume, Command(resume=...) returns that value here
return {"approved": approved}According to LangGraph's own interrupts documentation, calling interrupt() suspends graph execution at that exact point, saves state through a checkpointer keyed to a thread_id, and waits indefinitely for a response. You resume by re-invoking the graph with a Command object; its value becomes the return of the original interrupt() call. The docs are explicit about three rules: don't wrap interrupt() in try/except, don't reorder interrupt calls within a node, and keep any side effects that run before an interrupt idempotent, since a resumed node can re-execute code that ran before the pause.
Temporal's AI Cookbook shows the same pattern built on Signals instead of a graph checkpointer. A workflow proposes an action, and if it's risky, pauses and waits for a Signal carrying the human's decision:
@workflow.signal
async def approval_decision(self, decision: ApprovalDecision):
if decision.request_id == self.pending_request_id:
self.current_decision = decision
await workflow.wait_condition(
lambda: self.current_decision is not None,
timeout=timedelta(seconds=timeout_seconds),
)Temporal's documentation highlights that the waiting workflow consumes no compute resources while paused, that durable timers survive process restarts, and that every decision is logged for a complete audit trail. If no signal arrives before the timeout, the default in their sample is five minutes, the workflow completes with a timeout result rather than hanging forever.
Three frameworks ship this as a first-class feature rather than something you bolt on:
interrupt() for arbitrary, conditional pause points anywhere in a graph node, resumed with a Command, per the official interrupts page.Approvable contract and the InteractsWithApprovals trait; a needsApproval() method can return a boolean or an Approval::required() instance carrying a reason, so only refunds over a threshold, for example, need a human. Pending calls come back on the response with a tool call ID, name, arguments and reason; the caller resumes with a Decisions object keyed by that ID, using Decision::approve() or Decision::reject().ToolConfirmation workflows: a registered tool can call requestConfirmation() through its ToolContext, pausing the agent until a human supplies the missing input or approval, according to Google's release post.Permit.io's framework comparison adds two more: CrewAI supports a human_input flag or a HumanTool an agent calls for guidance, and HumanLayer wraps functions with decorators such as @require_approval() so an agent can request a decision over Slack, email or Discord rather than a custom UI.
IBM's HITL explainer frames the benefit as trading some automation speed for accuracy, accountability and a documented reason behind every override, which matters most for actions a model can get wrong in ways that are expensive or hard to reverse: deleting production data, issuing a refund, approving a hiring decision, or sending an email that can't be unsent. The EU AI Act's Article 14, which IBM cites, goes further and requires human oversight for high-risk AI systems specifically so a person can intervene during use.
The same sources are clear about the cost. IBM lists scalability and cost as the first drawback: a human review step that's fine for ten actions a day becomes a bottleneck at thousands. Permit.io frames the choice as risk-based rather than blanket: not every tool call needs a human, only the ones where a wrong action is expensive or hard to undo. The Laravel AI SDK's needsApproval() method is built around exactly that idea, letting a refund under a dollar threshold skip review while a larger one doesn't. Skip human-in-the-loop for read-only tools, low-stakes actions, or steps a person can easily undo after the fact; keep it for anything that spends money, deletes data, or leaves your system in a state a rollback can't cleanly fix.
Three concrete releases moved human-in-the-loop from a custom pattern to a built-in framework feature this year. Google shipped ADK for Java 1.0.0 with native ToolConfirmation support. The Laravel AI SDK's HITL API landed in v0.10.0 on 21 July 2026 and was announced at Laracon US 2026 in Boston on 30 July 2026. Temporal's human-in-the-loop Python cookbook recipe was last updated 14 August 2026, built around Signals, durable timers and a complete audit trail rather than a framework-specific interrupt call.
interrupt(), Temporal's Signals, the Laravel AI SDK's Approvable contract and Google ADK for Java's ToolConfirmation all implement the same pause-persist-resume pattern with different APIs.needsApproval() method and Permit.io's guidance both tie the review step to the cost of a wrong action, not to every tool call.It's a pattern where an agent pauses before a specific action, such as a refund or a data deletion, and waits for a person to approve, reject or edit it before the agent continues. The agent still plans and proposes the action; a human only signs off on the outcome.
LangGraph (interrupt()), the Laravel AI SDK (the Approvable contract, since v0.10.0), Google ADK for Java 1.0.0 (ToolConfirmation), CrewAI (human_input and HumanTool), and HumanLayer (@require_approval() decorators) all ship it as a built-in feature rather than something you build from scratch.
It adds latency only at the checkpoints you define, not to every action. Frameworks like the Laravel AI SDK let you scope approval to specific tools or specific argument values, such as refunds above a dollar threshold, so low-risk calls run immediately and only the risky ones wait on a person.
In the EU, Article 14 of the EU AI Act requires that high-risk AI systems be designed so a competent human can oversee and intervene during their use. Outside that category, HITL is a design choice driven by how costly a wrong action would be, not a universal legal requirement.
See how the agents and frameworks that ship these approval patterns compare on aiagentslisting.com.
One email a week. New agents, MCP servers and skills, and what is actually getting traction.
Claude Code vs Codex compared on pricing, GitHub automation, open source status and the latest releases from Anthropic and OpenAI.
7 min read
AI agent vs chatbot compared on control flow, tool use and autonomy, with sourced definitions from Salesforce, Google Cloud and Wikipedia.
6 min read
AI agent examples compared: Claude Code, Devin, ChatGPT agent, Intercom's Fin, Salesforce Agentforce and Manus, each sourced from the vendor's own docs.
8 min read