All posts
AI Engineering

Human Approval for AI Agent Actions with Lambda Durable Functions

By

October 25, 2026

7 min read

An agent that can refund, delete, email customers or change infrastructure needs a person in the loop for the risky steps. How to build approval gates that wait hours or days without paying for compute, with durable function callbacks, signed approval links, timeouts that default to no, and an audit trail.

AI Agents
Lambda Durable Functions
Human in the Loop
Security
Serverless

The hard part of human approval used to be the waiting. A person might answer in two minutes or two days, and something had to hold the agent's state, wake it when the answer came and give up when it did not. Lambda durable functions make that a few lines: a callback suspends the function, costs nothing while suspended and resumes when an external system responds.

Decide what needs approval

Action

Approval

Why

Reading data the user can already see

None

No new risk

Drafting a message, a change or a plan

None

Nothing happens until someone sends it

Sending email or messages to customers

Required, or within strict templates

Cannot be unsent

Refunds, credits, payments

Required above a threshold

Money, and a fraud target

Deleting data or changing infrastructure

Always required

Irreversible or high blast radius

Want a second opinion on this for your system?

Book a free 30-minute call. You'll leave knowing what we'd do first and roughly what it costs, whether or not you hire us.

The flow

  1. The agent proposes an action as structured data (type, target, parameters, its reasoning) instead of calling the tool directly. Risky tools are not given to the agent at all.

  2. A step validates the proposal against policy: is this user allowed to request it, is the amount within limits, does the target exist.

  3. createCallback returns a callback ID. A step sends the approver a message, in Slack or email, with the proposal and approve and reject links that carry a signed, single-use token bound to that callback ID.

  4. The function waits on the callback with a timeout. It is suspended and billed nothing while it waits.

  5. The approval endpoint verifies the token and the approver's identity and permission, then calls SendDurableExecutionCallbackSuccess or SendDurableExecutionCallbackFailure with the decision.

  6. The function resumes. On approval, a step performs the action with credentials scoped to that action alone. On rejection or timeout, it records the outcome and tells the requester.

Details that matter

  • Timeouts default to no. An approval nobody answered is a rejection, never an approval.

  • Show the approver exactly what will happen, rendered from the same structured proposal the executor will use, not from the model's description of it.

  • The approver must not be the requester for high-risk actions, and the approval link must not work for anyone else who sees it.

  • Put the action itself in a step, so a retry after a crash does not refund twice. Make the downstream call idempotent with a key derived from the proposal.

  • Record every proposal, decision, approver and result. The audit trail is the point as much as the gate.

hoolco Monthly Review

Once a month: what changed in tech that month and what it means for you, from cloud and AI to security and the tools you build with. Every item links to its source. No sales pitch, unsubscribe in one click.

As of October 25, 2026. Provided as is, for general information, and accurate to the best of our knowledge on the date shown. Not legal, compliance, tax, financial or other professional advice. Prices, limits and vendor services change; check current vendor documentation before relying on anything here. Terms of use.