L
Logs in the Sky
Gavin’s Workbench

Adding Human Review Before an AI Agent Takes an Irreversible Action

Adding Human Review Before an AI Agent Takes an Irreversible Action
Design human approval for Beam agents with concrete proposals, authorized reviewers, durable state, expiry, execution claims, and explicit handling of uncertain outcomes.

I would place human review between a concrete tool proposal and the code that performs its side effect. A human in the loop AI agent needs more than an “Are you sure?” message: approval must refer to the exact action, authorized reviewer, and current conditions. If the proposal changes, the old approval should no longer authorize execution.

For a Beam-hosted workflow, I would treat review state as durable application data. I would not hold a GPU worker open while someone decides whether an email, deletion, or account change should proceed.

Put the gate at the action boundary

Imagine an agent preparing a message to a supplier. Drafting the text is reversible; sending it to the wrong recipient is much harder to undo. I would let the agent gather information and prepare a proposal, then stop before the sending function.

The same boundary applies to destructive SQL, file replacement, permission changes, and purchases. The relevant question is what the tool can change, not whether its name sounds harmless. A generic “run command” tool can cross many boundaries behind one function name.

I would enforce approval in the dispatcher or executor that owns the side effect. A prompt telling the model to ask permission is useful guidance, but it does not prevent a different execution path from calling the tool directly.

Read-only actions also deserve scope checks. Reading a public document and exporting a private customer table are different operations, even if neither changes the source database. Human review and access authorization solve related but separate problems.

Make the proposal specific enough to judge

For AI agent tool approval, I would store a normalized proposal before showing the reviewer anything. The display and the executor must use the same saved values, rather than separate summaries that can drift.

A review record should include:

  • The action type, target system, and exact destination or object identifier.

  • The validated arguments, including amounts, recipients, or deletion scope.

  • A preview or diff of the material consequence.

  • The proposing workflow and immutable proposal revision.

  • The required reviewer role, creation time, and expiration policy.

  • The expected target version or other precondition where applicable.

For an email, I would show the resolved address, subject, attachments, and complete body. “Send the update to finance” is not enough when more than one destination could match.

I would keep proposal content access controlled. Moving sensitive material into an approval queue can create a second copy with different retention and access needs. A useful preview should expose what the reviewer needs without becoming a broadly visible archive.

Two people reviewing a printed letter and envelope with a pencil at a kitchen table.

Give review its own state machine

My starting lifecycle would be proposed, pending review, approved, executing, and a recorded outcome. Rejected, expired, and superseded proposals leave the execution path. An uncertain external result needs a separate unknown-outcome state.

Current situation

Permitted next step

Required check

Reviewer approves unchanged proposal

Attempt an execution claim

Reviewer scope, revision, expiry

Reviewer edits recipient or arguments

Create a new proposal revision

Revalidate and review final action

Reviewer rejects

Record rejection and stop that action

Do not translate rejection into success

Target changes while review is pending

Stop or request fresh review

Compare expected target state

Two workers try to execute

One claims the action

Durable conditional state transition

External response is lost

Reconcile the operation

Do not blindly repeat the side effect

These are design requirements, not an implementation supplied by Beam. I would enforce state transitions in a durable store with transactional or equivalent conditional-update behavior. An in-memory dictionary cannot coordinate independent workers or survive a restart.

Approval is also not a permanent capability. I would define how long it remains valid and recheck authorization immediately before execution. A reviewer losing access should not leave an unlimited queue of executable actions behind.

Use framework interrupts without confusing them with authorization

LangChain's human-in-the-loop middleware can pause selected tool calls and expose approve, edit, reject, and respond decisions. I would configure side-effecting tools explicitly and use rejection to deny an action. The respond option serves a different purpose: substituting a human-supplied tool result, rather than executing the tool.

For a LangGraph human in the loop workflow, interrupts and checkpointing support pausing and resuming a thread. A durable production checkpointer preserves workflow state across process lifetimes. It does not establish that the person calling the resume endpoint is authorized to approve a particular proposal.

I would authenticate that endpoint, resolve the actual reviewer server-side, and load the saved proposal. A caller-provided reviewer name or approval boolean is not sufficient evidence.

The application also needs to handle replay. LangGraph documents that interrupted nodes restart from their beginning on resume. I would keep irreversible work out of the portion that can run again and make the eventual execution boundary idempotent where possible.

This is why I would review the whole handoff: framework pause, stored proposal, reviewer authorization, conditional execution claim, and receiving-system behavior. Installing middleware covers only part of that path.

Let the worker stop while the decision waits

I would have the proposing request persist its proposal and return a pending-review identifier. A separate review interface can show the saved action. After a valid decision, a short resume or execution task can load the durable state and continue.

That design suits human waiting better than a long-running request holding model memory. Beam's billing documentation charges for running serverless containers, including configured warm time. A paused business process need not be an idle GPU process.

The cost is additional application state and coordination. For a small workflow, I would rather implement a narrow review queue for one consequential action than build a general approval platform before the first use case works.

Person making tea near a closed laptop and document folder in a home kitchen.

Approval does not solve uncertain execution

Suppose a reviewer approves one supplier email, the sending service accepts it, and the response disappears. The approval is real, but the outcome is uncertain. Retrying without a stable operation identity may send another message.

AWS's idempotent API guidance explains why operation identity matters. I would use a receiving service's documented idempotency contract when available, and retain its operation reference. If the service offers neither reliable deduplication nor a way to query the outcome, I would route uncertainty to reconciliation instead of promising exactly-once delivery.

The execution record should separate “approved,” “attempted,” and “confirmed completed.” Combining them into one green check hides the moment that matters.

Edits introduce another edge case. If a reviewer changes a destination, I would normalize and validate the revised proposal, show the final consequence, and bind authorization to that revision. Approval for one recipient must not silently transfer to another.

I would make the pending queue operationally visible as well. An agent that waits indefinitely for an absent reviewer is stalled work, even when the pause mechanism behaves correctly. Give each action an owner, a review deadline, and a visible expiration result. Escalation can notify another authorized reviewer; it should not silently convert waiting into approval.

The interface should distinguish rejection from a request for clarification. If the destination is ambiguous, save the answer and produce a new concrete proposal. A conversational reply such as “looks fine” should not be guessed into approval of whichever tool call happens to be next. The recorded decision must point to the action being authorized.

Test the gate before enabling a real side effect

My acceptance exercise would use a fake sending tool and a durable test store. No real messages or destructive operations are necessary to prove the basic control path.

I would check an approved action, a rejection, an expired proposal, an unauthorized reviewer, a changed target, and two concurrent execution attempts. Then I would restart the worker while review is pending and simulate a lost response after the fake service records completion.

The expected outcomes should be written before the test: no execution on rejection or expiry, one execution claim under contention, and explicit uncertainty after an unconfirmed result. I would also verify the audit trail can identify the proposal revision and authenticated decision maker without exposing unrelated content.

These are proposed acceptance tests, not tests performed against a live Beam deployment here. They provide a concrete readiness standard for the implementation.

Start with your most consequential tool. Write down exactly what a reviewer must see and which saved proposal revision their approval authorizes. If that connection is unclear, improve the review record before connecting the executor.

Last revised · 2026-10-26 15:45
Letters
Readers Write

No letters yet — be the first to write.

Write a letter
© 2026 Logs in the Sky. Logs in the Sky