AWS's ambient-agent sample exits Lambda at each human checkpoint and resumes from DynamoDB
AWS published a Bedrock AgentCore sample for agents that wake on S3 and scheduled events, capping each agent turn at Lambda's 15-minute timeout. Reviewers can take hours, so the sample stops the agent at every human checkpoint and restarts it from saved state.
The Engineer · Build desk

What happened
- Events from S3 notifications, EventBridge schedules, CloudWatch alarms and SNS topics all land in one SQS queue, which triggers a Lambda function that runs the agent.
- The ask_human tool is the only one that pauses execution, while reading S3, querying a database and sending email all run synchronously inside the same invocation.
- At a pause, the handler saves the agent's reasoning chain, its pending decision and an execution ID to DynamoDB, then exits.
- SQS cannot route by message content, and the dev.to writeup says AWS's post does not specify how the Lambda decides which agent workflow a message belongs to.
- AWS says one ask_human tool plus a canonical response envelope is enough to handle the full range of human-in-the-loop interactions.
Why it matters
- What it costs cost Before writing any agent logic, a team running the sample takes on resources in nine AWS services ahead of Bedrock, from IAM and Cognito to CloudFront and ECR.
- Who has to decide decision Each adopting team has to write and maintain its own dispatcher from message body to workflow, and every new event source means changing that one function.
- Who's exposed exposure Synchronous tools have already run when the agent reaches ask_human, so a rejection cannot recall an email the agent sent earlier in the same turn.
Next story · Build · Oct 1
CloudWatch Omni opens incident investigation to staff without AWS console accessConfirmed2 publishers
The design follows from one constraint: where the waiting happens. A chat agent runs inside a request-response cycle. It keeps state in memory or a session store, and the conversation ends when the user closes the window [9]. An ambient agent's reviewer may answer hours later [10]. The reference caps each agent turn at Lambda's 15-minute timeout [14]. A wait of hours does not fit in a 15-minute invocation, so the agent has to stop running while the human decides [19].
AWS's answer is to exit early. When the agent calls ask_human, the tool returns a special status code. The handler catches it, serializes the agent's state, writes it to DynamoDB and exits [4]. Approval comes back as a second SQS message that triggers the function again [6]. Nothing runs while the reviewer is at lunch [4]. I think this is good engineering. Every pause goes through one tool, so exactly one code path writes a paused agent to the table [3].
Resume is where it can break. The dev.to writeup says the agent picks up from the exact tool call that triggered the pause [6]. AWS's own wording is that it resumes from where it left off [1]. That only works if the resumed agent treats the saved tool outputs as finished. Tools such as sending email run synchronously inside the invocation [3], so any that ran earlier in the turn have completed before the pause. An email sent ahead of the checkpoint is already out when the reviewer says no.
The routing is code the team writes. The writeup offers an illustrative handler and labels it a typical pattern. It checks for eventSource 'aws:s3', source 'aws.events' and an AlarmName field, then falls back to 'default-agent' [16]. Every new event source is another branch in that one function.
Concurrency comes from Lambda. Each invocation takes one SQS message, and workflows with different execution IDs run in parallel [7]. When a resume shares an execution ID, DynamoDB optimistic locking prevents the race, according to the writeup [22]. The Jobs page finds pending work by polling DynamoDB for rows marked WAITING_FOR_HUMAN [8].
The 15-minute figure is a claim about AWS's workload. AgentCore Runtime offers container hosting for long-running workloads with session isolation [17]. This reference still stops each turn at Lambda's limit, and AWS calls that "more than enough headroom in practice" [14]. The practice AWS describes is a document landing in S3 and an agent analyzing it before asking for approval [13]. For the claim to carry over, a team's slowest single turn, model calls plus synchronous tools, has to finish inside 15 minutes.
The setup list is long. The prerequisites ask for permission to create IAM roles, Lambda functions, DynamoDB tables, S3 buckets, SQS queues, API Gateway APIs, CloudFront distributions, Cognito user pools and ECR repositories, plus Bedrock resources [18]. Nine AWS services appear in that list ahead of Bedrock [20].
The writeup's author put the conclusion bluntly: "This is not a chatbot with extra triggers. It is a different control flow." [12] The sources support that. The human step covers more than approval, though. AWS says the agent interrupts a person when it needs clarification, approval or review [11].
What to watch
- Whether AWS publishes the schema of its canonical response envelope and the event-routing code in the reference sample repository.
- Whether a later version of the reference runs agent turns on AgentCore Runtime directly and drops the Lambda 15-minute cap per turn.
- How the sample records or compensates for side-effecting tool calls when a reviewer rejects the decision at ask_human.
Clarity's read
What the record supports and how the coverage leans. The claims behind it follow.
Reality
- Evidence60
- Adoption
- Not scored
- Hype gap+20
- Incentives70
- Confidence65
Claim ledger
Ranked by verification strength, evidence, and original report placement.
- [1]
AWS published a walkthrough of ambient agents on Amazon Bedrock AgentCore that respond to event streams, pause for human input through a single ask_human tool, and resume from where they left off once the human answers.
- [2]
Event sources (S3 bucket notifications, EventBridge schedules, CloudWatch alarms, SNS topics) all land in one SQS queue; SQS triggers a Lambda function that invokes the Bedrock AgentCore runtime, executes tools and writes state to DynamoDB.
- [3]
ask_human is the only tool that pauses execution; every other tool (read S3, query database, send email) runs synchronously inside the Lambda invocation.
- [4]
When the agent calls ask_human, the tool returns a special status code; the Lambda function catches it, serializes the agent's state, writes it to DynamoDB, and exits.
- [5]
The saved state includes the agent's reasoning chain (all previous tool calls and LLM responses), the pending decision, and the execution ID.
- [6]
When the human approves, a second SQS message triggers the Lambda function again and the agent resumes; the writeup says it resumes from the exact tool call that triggered the pause.
- [7]
Lambda scales horizontally; each invocation processes one SQS message, and events targeting the same workflow with different execution IDs run in parallel.
- [8]
The Jobs page polls DynamoDB for rows with status = WAITING_FOR_HUMAN.
- [9]
Chat-based agents run inside a request-response cycle, with state in memory or a session store; the conversation ends when the user closes the window.
- [10]
In an ambient agent, the human may respond to a pause hours later.
- [11]
AWS says the agent only interrupts a human when clarification, approval, or review is needed.
- [12]
"This is not a chatbot with extra triggers. It is a different control flow."
- [13]
AWS's example scenario: a document lands in an S3 bucket, a job appears on the Jobs page within seconds, and the agent analyzes the file and asks for approval before taking the next step.
- [14]
The reference implementation caps each agent turn at the Lambda 15-minute timeout, which AWS says is "more than enough headroom in practice."
- [15]
SQS does not route by content; every message goes to the same queue and the Lambda function inspects the message body to determine which agent workflow to invoke. The AWS blog post does not specify the routing logic, according to the dev.to writeup.
- [16]
The writeup's illustrative 'typical pattern' handler checks for eventSource 'aws:s3', source 'aws.events', and an AlarmName field, falling back to 'default-agent'.
- [17]
AgentCore Runtime provides container-based agent hosting with support for long-running workloads and built-in session isolation.
- [18]
Prerequisites for the reference implementation include permissions to create IAM roles, Lambda functions, DynamoDB tables, S3 buckets, SQS queues, API Gateway APIs, CloudFront distributions, Cognito user pools, ECR repositories, and Bedrock resources.
- [19]
A human response arriving hours later exceeds the 15-minute per-turn cap, so the wait cannot happen inside a single Lambda invocation.
- [20]
Nine AWS services are named in the prerequisites ahead of Bedrock: IAM, Lambda, DynamoDB, S3, SQS, API Gateway, CloudFront, Cognito, ECR.
- [21]
AWS says a single ask_human tool plus a canonical response envelope is enough to support the full range of human-in-the-loop interactions.
- [22]
If two events share the same execution ID (a resume after human approval), DynamoDB optimistic locking prevents race conditions, according to the dev.to writeup.
Sources
2 independent publishers whose own reporting we read for this story.
- aws.amazon.comBuilding ambient agents with Amazon Bedrock AgentCore: From event-driven signals to human-in-the-loop workflows
1 article · October 1, 2026
- dev.toAmbient Agents on AWS: Event-Driven Triggers, SQS Routing, and the ask_human Tool
1 article · October 1, 2026
Topics and entities
Topics
- Human-in-the-loop AI
- Serverless event-driven architecture