AgentCore Runtime V2: snapshot startup changes your init
Amazon Bedrock AgentCore Runtime V2 snapshots your agent after the first healthy ping and restores it for each session. Move init before app.run() and close sockets first.
Amazon Bedrock AgentCore Runtime V2 starts agent sessions from a snapshot, not from a cold container. AWS published the architecture guidance on November 13. The change is quiet, but it moves the line between work you do one time and work you do for each customer session. If your agent code is in the wrong order, you get a slow first reply and you pay for it in each session.
What actually happened
AWS published Architecture patterns for fast session startup on Amazon Bedrock AgentCore Runtime. The mechanics, as the post gives them:
- The switch. You set
platformVersiontoV2. The post does not say if V2 is generally available or in preview. - The snapshot. On each create or update, AgentCore starts your container in a new microVM and waits for the first healthy
GET /ping. That ping must arrive within 120 seconds. AgentCore then clears the OS file cache, freezes the microVM, and stores memory and disk as a snapshot. - The restore. Each new session starts from that snapshot. Process memory comes back: imports, objects and clients.
- The cost of a deploy. Each create or update now takes a few minutes.
- The billing. AWS says V2 reclaims memory that your sessions do not use, so the bill follows what the agent uses. The post does not explain the mechanism.
- Build hooks. The runtime now supports build hooks to load and prime large files before the snapshot.
The post gives no before-and-after timing. The only number is a threshold: if a new session in about 2 seconds is acceptable, the basic pattern is sufficient.
Why AgentCore Runtime V2 matters for your business
A customer who opens a chat and waits five seconds for the first word thinks that the agent is broken. Snapshot startup removes most of that delay, but only for work that is done before the snapshot.
What to change in your agent code:
- Do all initialization before
app.run(). The/pingendpoint answers only after that line. Imports, model clients and configuration that load before it are in the snapshot. Work in the request handler runs again for each session. - Close network connections before the snapshot. Sockets are stale after a restore. AWS says that some clients try the stale socket first, which adds hundreds of milliseconds.
- Keep dynamic data out. Data that changes cannot be in the snapshot. Get it in the session.
- Compile bytecode in the image. Late imports compile from source unless you set
UV_COMPILE_BYTECODE=1or usepip install --compile. - Audit what is in memory at the first ping. AWS says credential resolution comes back with the snapshot. The post does not discuss secrets that are in memory at that moment. Treat the snapshot as a copy of your process and load per-customer secrets after the restore.
- Pre-warm on engagement. Start the session in the background when the user opens the chat window, not when they send the first message.
Key takeaways
- AgentCore Runtime V2 snapshots the microVM after the first healthy ping, which must arrive within 120 seconds
- Each new session restores from the snapshot, with imports and clients in memory
- Each create or update now takes a few minutes
- AWS gives no measured startup numbers and does not state the release status
- Move init before app.run(), close sockets, and load customer secrets after the restore
The first reply sets the customer's opinion of your agent. We build agents with measured startup time, clean init order and no customer data in shared snapshots. See how we build agent systems, or send us your slowest agent and we will find the delay.
- #aws
- #bedrock-agentcore
- #ai-agents
- #cold-start
- #infrastructure
Tommy Rush — Founder, Rush Commerce
Operator turned builder. 15+ years running operations — now shipping the systems businesses run on. More
Get The Rush Report weekly — one email, zero fluff.
Keep reading
TSMC employee data breach traced to a cloud provider
TSMC confirmed an employee data breach in an SEC filing. The leaked data matches records at a cloud service provider. Inventory the HR data your vendors hold.
Read itSignDrop Windows zero-day: SYSTEM access, no patch, no CVE
The SignDrop Windows zero-day uses CLFS and Defender to give a standard user SYSTEM rights. No patch or CVE exists. Keep CLFS authentication on and cut admin rights.
Read it