How to Gate Agent Writes with Human Review
The first bad write from an agent is usually not a dramatic hack. It’s a mundane one: a file deletion on the wrong branch, an email sent from the wrong context, a production change replayed after a retry. For teams building agents that can mutate state, the real decision is not whether to add human-in-the-loop. It is where the human gets a vote, what they see, and whether the system can safely wait.
The practical answer is not one pattern but three: synchronous approval for short, irreversible steps; asynchronous escalation for longer-latency workflows; and draft-first permits when you want the agent to propose changes without letting them land automatically. The right choice depends on risk, latency tolerance, and reviewer availability. 1, 2
Start by classifying the write
Before you pick a framework, define what counts as a consequential write. In enterprise systems, that usually means a mutation that changes an authoritative record, alters access, sends an external communication, or has a meaningful operational effect. Trampoline’s guidance is to treat consequential writes as proposed changes, not final model decisions, and to make the write executor accept an immutable approved plan rather than free-form instructions from the model. 3
That distinction matters because not every write deserves the same gate. A reversible draft can often move with lighter review. An irreversible action—payments, deletions, code merges, infrastructure changes, outbound email—needs stronger control. Fernando Abishai’s rule of thumb is blunt: the absence of a dangerous tool is stronger than telling the model not to call it. 4
So the first implementation step is architectural, not conversational. Separate read from write. Split reversible from irreversible operations. If you can make the dangerous path impossible at the tooling layer, you need less policy theater later. 4, 5
Use a draft-first default for consequential writes
The cleanest HITL pattern for write access is draft first, execute later. OpenPort’s baseline posture is exactly that: write requests create reviewable drafts unless auto-execution is explicitly enabled and time-bounded. It also recommends “fail closed into draft,” which turns tool misuse, prompt injection, and retries into a review queue instead of immediate side effects. 6
That is a control-plane decision, not just a safety slogan. It changes the default from “the agent can act unless stopped” to “the agent proposes, and the system decides whether anything can happen.” ArchCrux makes the same point in different language: a simple allowlist does not contain enough information for a consequential write. For serious actions, you need bounded action permits with deadlines and single-use behavior. 7
"The protocol’s baseline write posture is draft-first: write requests create reviewable drafts unless auto-execution is explicitly enabled and time-bounded."
— OpenPort Protocol 6
A good draft should show the target, the intended change, the rationale, and the expected side effects. If a reviewer cannot tell what will happen, the gate is ornamental. Trampoline argues that meaningful review needs before-and-after values, active acknowledgment for high-risk actions, and enough context for the reviewer to exercise judgment instead of rubber-stamping. 3
Put approval where the side effect begins
A common mistake is placing the check too early, before the agent has enough context, or too late, after the action is already underway. The better rule is simple: pause immediately before the irreversible step, or before crossing a meaningful risk boundary. Metacto’s framework says a production approval gate needs three things: a deterministic precondition, a blocking semantic that forces an explicit decision, and a durable checkpoint. If any of those are missing, you do not have an approval gate; you have a logging hook with extra UI. 8
This is also where latency planning matters. If the approver is already waiting, a synchronous interrupt-and-resume pattern is fine. If not, the system should be designed for async review from the start. Metacto’s heuristic is practical: if the approver is not at their desk waiting, the gate is asynchronous. 8
Dataiku’s pattern guide frames the choice well: pick based on risk, latency tolerance, and reviewer availability. For irreversible actions, synchronous interrupt-and-resume is safer. For high-volume workflows where pausing every transaction would stall the system, you need something closer to human-on-the-loop monitoring with escalation. 1
"If the approver is not at their desk waiting, the gate is asynchronous. Design for it."
— metacto 8
That distinction is not academic. If you use synchronous approval for a task that can sit for hours, you will lose state or clog the queue. If you use asynchronous escalation for an irreversible action, the agent may continue with fallback behavior before anyone can stop it. 1, 8
Bind the decision to the exact action
A durable approval gate only works if the approval cannot drift away from the action it was meant to authorize. Cordum’s rule is crisp: an approval is a statement about one request under one policy. If either changes, the approval should stop working. 9
That means the approval should be tied to the request hash, policy version, resource version, and reviewed arguments. ArchCrux recommends converting authorization into a bounded permit and handling unresolved external outcomes explicitly, rather than assuming a timeout means nothing happened. AWS’s agentic AI guidance adds an important constraint: risk classification should be deterministic, not delegated to an LLM that can be influenced by the same untrusted content it is evaluating. 7, 10
A concrete failure mode to design for is approval drift across retries. Suppose a manager approves a refund plan under policy v12. Before execution, the policy changes, the amount is edited, or the record version moves. If the system reuses the old approval anyway, the reviewer signed off on the wrong thing. The fix is simple but strict: make the approval artifact immutable, single-use, and re-checked at execution time. If the model can revise the request after approval, or replay it after a retry, the human approved a phantom. 7, 9
"An approval is a statement about one request under one policy. If either changes, the approval should stop working."
— Cordum 9
Make the human review the real payload, not a summary
If you only show reviewers an LLM summary, you are trusting the same system that may have produced the risky action to describe that action honestly. TrendAI’s warning is useful here: the reviewer needs the actual SQL, the target table, and the affected row count in front of them, because the same injection that drove the malicious operation can also shape the summary. It also argues that the reviewer must be a person, not another agent. 11
The same principle applies beyond SQL. For code changes, show the diff and the consequence. For customer communications, show the exact message. For access changes, show the principal, scope, and duration. For multi-step changes, show the plan and the current state, not just the endpoint. 3, 4
There is also a human-factors trap here: if every action gets a prompt, reviewers stop paying attention. Fernando Abishai’s advice is blunt: do not ask the user to approve every thought the model has; ask them to approve the action that changes the world. 4 That is the basic defense against approval fatigue. Risk-tiered gating only asks for attention when human judgment can actually change the outcome. 10
Use framework primitives that preserve state
The operational question is not just “where do I pause?” but “can I resume safely?” LangGraph’s human-in-the-loop approach is built around persistence and resumability. Its documentation says that when a model proposes an action like writing to a file or executing SQL, the middleware can pause execution and wait for a decision; production setups need a persistent checkpointer rather than an in-memory-only setup. 12, 13
That persistence detail matters because resumed runs often re-execute the interrupted node from the top. In LangGraph, side effects before the interrupt must be idempotent, or they should be moved downstream of the pause. The implementation guides are explicit: use a checkpointer, include a thread ID, and put side effects after the interrupt or isolate them into separate nodes. 14, 15
OpenAI’s Agents SDK uses a similar model. Its HITL flow pauses execution until a person approves or rejects sensitive tool calls, and approval decisions from nested agents can surface on the outer run. 16, 17 The main engineering rule is the same across stacks: assume replay, bind decisions tightly, and keep the mutating side effect out of the pre-approval path. 12, 14
"When a model proposes an action that might require review—for example, writing to a file or executing SQL—the middleware can pause execution and wait for a decision."
— LangChain documentation 12
"Use the human-in-the-loop (HITL) flow to pause agent execution until a person approves or rejects sensitive tool calls."
— OpenAI Agents SDK 16
Choose the right approval shape for the workflow
Not every workflow needs the same gate. Cloudflare’s HITL patterns separate approval by who introduces the pause and where the pause sits in the workflow: MCP elicitation, workflow approval, and Code Mode approval each solve a different problem. 18 Scalekit makes the same point from the authorization side: the critical evaluation happens at tool invocation time, not at login or session establishment. 19
For builders, the mapping is usually:
- Use synchronous interrupt-and-resume for high-stakes, low-frequency actions.
- Use asynchronous escalation for slower processes where a human can review later.
- Use policy-driven approval routing when certain actions require specific approvers.
- Use draft-first or bounded-permit flows when you want velocity without giving up control. 1, 6, 19
LangChain’s human-in-the-loop middleware supports this granularity with approve, edit, reject, and respond decisions, plus per-tool configuration and persistent state. 13 That matters because one workflow often contains both reversible and irreversible steps. A file write may be editable; a payment should usually be approve-or-reject only. 1, 13
Keep the control plane tied to the product, not the hype
The point of a human-in-the-loop system is not to make agents feel enterprise-ready. It is to make write access governable. Replit’s trajectory is relevant here only insofar as it shows what the control plane has to absorb: sandboxing, cloud execution, transactional filesystem behavior, and agents treated as standard users inside shared projects. That is not broad ecosystem commentary; it is the infrastructure a write-capable agent needs if the approval gate is going to mean anything. 20
The larger lesson is that operational reliability does not come from raw model intelligence alone. It comes from observability, draft-first defaults, durable checkpoints, and reviewer context that makes judgment possible. 1 Minute Signal coverage of Cole Medin makes the same point from a different angle: the effective current strategy is hybrid orchestration, with frontier models for planning and review and weaker models for implementation, measured by intervention frequency rather than token price. 21
That is the architecture question builders should actually be asking. Not “Can the agent write?” but “What exactly must be true before it may write, who gets to say yes, and how do we prove the approval still applies when execution happens?”
"The most effective current strategy is a hybrid orchestration: using frontier models for planning and review, while delegating implementation to open-weight models."
— 1 Minute Signal coverage of Cole Medin 21
What to implement first
If you are putting this into a product or internal tool, start here:
- Classify the writes that are truly consequential.
- Make drafts the default for those writes.
- Bind approval to the exact request, policy version, and resource state.
- Show reviewers the real payload, not a summary.
- Use a durable checkpoint so retries do not replay side effects.
- Decide in advance what happens when the reviewer is late. 1, 8, 9
Get those six right and the rest is mostly framework choice. Get them wrong and even a “human-in-the-loop” workflow can still ship the wrong write with a very human sign-off.