AgentCore Runtime V2 no longer boots an AI agent from scratch for every session. It restores it from a snapshot instead. Since November 12, 2026, that is the default for new runtimes in many Regions, Frankfurt included. When I read the announcement, I first looked at the numbers: under two seconds to start a session instead of almost 30. On my second pass through the docs, one sentence stuck with me, and for TypeScript developers it matters more than any benchmark: even crypto.randomUUID() can return repeating values across instances after a restore.
That is what this post is about. I will show you what changes with the new runtime, which values do not belong in a snapshot, and how to build a small TypeScript agent that behaves correctly after every restore. You also get a CDK project, a script that checks your code, and a checklist for migrating existing agents.
In short
AgentCore Runtime V2 freezes your agent as a snapshot once it has started and restores every session from it. That makes cold starts fast and cheap. Everything created during startup is then shared by all sessions, and in Node.js this even applies to random values from
node:cryptothat you generate inside the handler.
What you will learn in this article
- What AgentCore Runtime V2 does differently from V1, and what it costs
- Which five values can be wrong after a snapshot restore
- How to create unique IDs in Node.js without
node:crypto - How to deploy a TypeScript agent on V2 with CDK
- How to migrate existing runtimes with a way back
What changes with AgentCore Runtime V2
Some context first. Amazon Bedrock AgentCore Runtime is the AWS service that hosts your AI agent as a container or code package. Each session runs in its own Firecracker microVM, a very lightweight virtual machine with hardware isolation. That part stays the same. What is new is how a session starts.
Until now (platform version V1), AgentCore started your container and initialized your code for every new session. With a large image you could feel that. With V2, AgentCore prepares your agent once at deployment time, waits for a successful health check, and then stores the complete memory state as a snapshot. From then on, every new session is a restore of that snapshot.
According to the AWS announcement, this is what changes:
| Aspect | V1 | V2 |
|---|---|---|
| Session start (2 GB image, P75) | 29.7 seconds | under 2 seconds |
| Maximum image size (compressed) | 2 GB | 10 GB |
| Size per session | fixed | up to 8 vCPU and 32 GB when bursting |
| Billing while idle | memory stays allocated | memory is released, up to 68% less billed memory for multi-turn agents |
| Deployment time | seconds | several minutes (the snapshot is built) |
For new runtimes, V2 is the default in 19 Regions, among them Frankfurt, Ireland, Paris and Stockholm. Existing runtimes stay on V1 until you switch them yourself. You control this with the platformVersion field and the values V1 and V2.
One detail made me pause: at the time of writing, the “How it works” page in the developer guide still says a runtime without this setting ends up on V1. The announcement says the opposite. The docs are probably lagging behind, but I would not rely on either default. Set the platform version explicitly in your infrastructure code, and you always know what is running.
How the snapshot works
If you have used Lambda SnapStart, you already know the idea. I covered it in detail in my post on SnapStart for Python. AgentCore splits your code into two worlds:
-
Startup: everything that happens while the process boots, before your server listens on port 8080 and answers
/pingsuccessfully. That result is stored in the snapshot. -
Request handling: everything that happens in your
/invocationshandler. It runs again for every call on every instance.
The snapshot is taken on the first successful /ping (or after the optional warmup hook, more on that below). Your initialization has to finish within 120 seconds, otherwise the deployment fails with a health check error. AgentCore builds one snapshot per runtime version that an endpoint points to and keeps using it until the next update.
🎬 How AgentCore Runtime V2 starts sessions – this animated diagram only runs on my site: watch it on sascha-ms.de
The decision rule from the AWS docs boils down to one sentence: compute at startup whatever stays the same for the whole lifetime of an agent version. Compute in the handler whatever has to differ per request or can expire.
The rule of thumb for snapshot-safe code
Five snapshot pitfalls in AgentCore Runtime V2
AWS says in its FAQ that most agents run without changes. I believe that. The bugs that remain, however, are the unpleasant kind: they do not throw an exception. They quietly return wrong values. I would check these five spots in every agent.
Randomness and IDs in Node.js
After a restore, every instance holds an identical copy of memory, including the internal state of random number generators. An ID you create at startup is therefore the same in all sessions. That much is expected.
The second part is the surprise. According to AWS, crypto libraries on AgentCore currently do not reseed after a restore. The node:crypto module relies on OpenSSL, so this affects crypto.randomUUID(), randomBytes(), randomInt(), getRandomValues() and packages such as uuid. The AWS docs are explicit here: these values may show up again on other instances, even if the call happens inside the handler. If you create session IDs, idempotency keys or tokens this way, you have a real problem.
The recommended way out: read fresh bytes straight from the operating system, which means /dev/urandom. In Node.js that takes a few lines (see step 2 below). By the way, Math.random() is no alternative, since its state ends up in the snapshot as well.
Timestamps and measuring durations
A const bootedAt = Date.now() at module level is as old as the snapshot after a restore, which can easily mean days. Measuring durations is trickier: AWS points out that a monotonic clock does not advance across a restore. A duration measured against a startup reference is then wrong without looking wrong. So always measure from a point in time you take inside the handler.
Credentials and tokens
Temporary credentials fetched at startup may have expired before the first session even begins. The same applies to OAuth tokens your agent needs for third-party systems. It is fine to build SDK clients at startup, but let the SDK resolve credentials and refresh them when needed. Fetch your own tokens in the handler and cache them with an expiry time.
Hostname and PID as instance ID
Every restored instance reports the same hostname (localhost) and the same PID (1). If you derive a worker ID for logs, metrics or locks from them, all instances end up in one bucket. Generate an ID per request instead, and also log the session ID that AgentCore sends in the X-Amzn-Bedrock-AgentCore-Runtime-Session-Id header.
Values that change without a deployment
I find this pitfall the most instructive, because it looks like an optimization. AWS uses the tool catalog from AgentCore Gateway as an example: slow to load, so it seems perfect for startup. In the snapshot, however, it is frozen. If you add a new tool to the gateway, your sessions only see it after the next deployment. Feature flags or Parameter Store settings you want to change at runtime behave the same way. Load them in the handler and cache them briefly.
Open network connections do not survive the restore either. That is harmless, though: the SDK clients remember the endpoint, credential provider and connection pool, and the first call after a restore re-establishes the connection transparently. You should, however, avoid binding to a fixed source port.
Build a TypeScript agent for AgentCore Runtime V2 step by step
As an example, I build the support agent of a fictional bike rental called “Spokeworks”. It answers questions about rental periods and prices based on a small FAQ file and uses a Claude model through the Amazon Bedrock Converse API. I deliberately skip agent frameworks so you can see what AgentCore actually expects: an HTTP server on port 8080 with GET /ping and POST /invocations.
Prerequisites
- An AWS account with access to Amazon Bedrock and an enabled Claude model in your Region (the example uses an EU inference profile of Claude Haiku 4.5, which you can change via context)
- Node.js 22 and npm
- Docker with Buildx, because AgentCore expects ARM64 images
- AWS CDK 2 (tested with
aws-cdk-lib2.276.0 and CLI 2.1148.1) and a bootstrapped account - AWS CLI v2 for the test call
Step 1: Create the project
mkdir agentcore-runtime-v2 && cd agentcore-runtime-v2
mkdir -p agent/src agent/data bin lib tools test
npm init -y
npm install -D aws-cdk aws-cdk-lib constructs typescript tsx @types/node
cd agent && npm init -y
npm install @aws-sdk/client-bedrock-runtime
npm install -D typescript @types/node
cd ..
In agent/package.json, add "type": "module" so Node.js treats the files as ES modules. Store the FAQ as agent/data/faq.json:
[
{ "q": "How long can I rent a bike?", "a": "From one hour up to 14 days. Longer rentals on request." },
{ "q": "What does a city bike cost?", "a": "4 euros per hour or 18 euros per day." },
{ "q": "Do I need to bring ID?", "a": "Yes, a photo ID is required when you pick up the bike." },
{ "q": "What happens if I get a flat tyre?", "a": "Call the service hotline. We bring a replacement bike within the city limits." }
]
Step 2: Build snapshot-safe randomness
The core piece is small. On every call, the function opens /dev/urandom, reads the requested number of bytes and closes the file again. From these bytes I build a version 4 UUID, so it fits wherever you used randomUUID() before.
// agent/src/entropy.ts
import { closeSync, openSync, readSync } from 'node:fs';
// Reads fresh bytes from the kernel on every call.
// Do not use node:crypto here: on AgentCore Runtime V2 its OpenSSL state
// is copied into the snapshot and can repeat across restored instances.
export function freshBytes(size: number): Buffer {
const buf = Buffer.alloc(size);
const fd = openSync('/dev/urandom', 'r');
try {
let offset = 0;
while (offset < size) {
offset += readSync(fd, buf, offset, size - offset, null);
}
} finally {
closeSync(fd);
}
return buf;
}
// UUID v4 built from kernel entropy
export function freshId(): string {
const b = freshBytes(16);
b[6] = (b[6] & 0x0f) | 0x40;
b[8] = (b[8] & 0x3f) | 0x80;
const h = b.toString('hex');
return `${h.slice(0, 8)}-${h.slice(8, 12)}-${h.slice(12, 16)}-${h.slice(16, 20)}-${h.slice(20)}`;
}
Step 3: Write the agent server
The top of the module holds everything that may go into the snapshot: reading the FAQ, building the system prompt, creating the Bedrock client. The request ID, the timestamps and the model call happen in the handler. /ping only reports Healthy once the server is listening, and that only happens after initialization. This guarantees that the snapshot captures a fully initialized agent.
// agent/src/server.ts
import { createServer, type IncomingMessage, type ServerResponse } from 'node:http';
import { readFileSync } from 'node:fs';
import { BedrockRuntimeClient, ConverseCommand } from '@aws-sdk/client-bedrock-runtime';
import { freshId } from './entropy.js';
// ---------- Startup: runs once, before the snapshot ----------
// Only values that stay the same for the whole agent version belong here.
type FaqEntry = { q: string; a: string };
const faq: FaqEntry[] = JSON.parse(
readFileSync(new URL('../../data/faq.json', import.meta.url), 'utf8'),
);
const systemPrompt = [
'You are the support assistant of the fictional bike rental "Spokeworks".',
'Answer briefly and only based on these facts:',
...faq.map((e) => `- ${e.q} ${e.a}`),
].join('\n');
const modelId = process.env.MODEL_ID;
if (!modelId) throw new Error('MODEL_ID is not set');
// Build the client at startup; the SDK refreshes credentials when they expire.
const bedrock = new BedrockRuntimeClient({});
let ready = false;
// ---------- Request handling: runs on every request ----------
async function answer(question: string, sessionId: string) {
const requestId = freshId(); // unique per request, also after a restore
const startedAt = Date.now(); // reference time taken in the handler
const result = await bedrock.send(
new ConverseCommand({
modelId,
system: [{ text: systemPrompt }],
messages: [{ role: 'user', content: [{ text: question }] }],
inferenceConfig: { maxTokens: 400 },
}),
);
const text = result.output?.message?.content?.map((c) => c.text ?? '').join('') ?? '';
console.log(JSON.stringify({ requestId, sessionId, durationMs: Date.now() - startedAt }));
return { requestId, answer: text, answeredAt: new Date().toISOString() };
}
async function readBody(req: IncomingMessage): Promise<string> {
const chunks: Buffer[] = [];
for await (const chunk of req) chunks.push(chunk as Buffer);
return Buffer.concat(chunks).toString('utf8');
}
function send(res: ServerResponse, status: number, body: unknown) {
res.writeHead(status, { 'Content-Type': 'application/json' });
res.end(JSON.stringify(body));
}
const server = createServer(async (req, res) => {
try {
if (req.method === 'GET' && req.url === '/ping') {
// Report healthy only after initialization: the snapshot is taken then.
return ready ? send(res, 200, { status: 'Healthy' }) : send(res, 503, { status: 'Unhealthy' });
}
if (req.method === 'POST' && req.url === '/invocations') {
const payload = JSON.parse((await readBody(req)) || '{}') as { prompt?: string };
if (!payload.prompt) return send(res, 400, { error: 'prompt is missing' });
const sessionId = String(req.headers['x-amzn-bedrock-agentcore-runtime-session-id'] ?? 'local');
return send(res, 200, await answer(payload.prompt, sessionId));
}
send(res, 404, { error: 'not found' });
} catch (err) {
console.error(err);
send(res, 500, { error: 'internal error' });
}
});
server.listen(8080, '0.0.0.0', () => {
ready = true;
console.log('Agent listening on port 8080');
});
The line with the session ID is not decoration. Together with the request ID, it is the only reliable way to group calls of one session in your logs, because hostname and PID are identical on all instances.
Step 4: Build the container
The Dockerfile builds a slim ARM64 image in two stages. The tsconfig.json in the agent folder sets "module": "NodeNext", "rootDir": "." and "outDir": "dist"; you will find the complete file in the repository.
# agent/Dockerfile
FROM --platform=linux/arm64 public.ecr.aws/docker/library/node:22-slim AS build
WORKDIR /app
COPY package*.json tsconfig.json ./
RUN npm install
COPY src ./src
RUN npx tsc
FROM --platform=linux/arm64 public.ecr.aws/docker/library/node:22-slim
WORKDIR /app
ENV NODE_ENV=production
COPY package*.json ./
RUN npm install --omit=dev
COPY --from=build /app/dist ./dist
COPY data ./data
EXPOSE 8080
CMD ["node", "dist/src/server.js"]
Step 5: Deploy the runtime on V2 with CDK
aws-cdk-lib now ships an L2 construct for AgentCore. I set the platformVersion property explicitly, for the reason mentioned above. CDK builds the image from the agent folder and pushes it to an ECR repository.
// lib/agent-stack.ts
import * as path from 'node:path';
import { CfnOutput, Stack, type StackProps } from 'aws-cdk-lib';
import * as agentcore from 'aws-cdk-lib/aws-bedrockagentcore';
import { Platform } from 'aws-cdk-lib/aws-ecr-assets';
import * as iam from 'aws-cdk-lib/aws-iam';
import type { Construct } from 'constructs';
export interface AgentStackProps extends StackProps {
modelId: string;
}
export class SpokeworksAgentStack extends Stack {
constructor(scope: Construct, id: string, props: AgentStackProps) {
super(scope, id, props);
const runtime = new agentcore.Runtime(this, 'SupportAgentRuntime', {
runtimeName: 'spokeworks_support',
description: 'Support agent of the fictional bike rental Spokeworks',
agentRuntimeArtifact: agentcore.AgentRuntimeArtifact.fromAsset(
path.join(__dirname, '..', 'agent'),
{ platform: Platform.LINUX_ARM64 },
),
// Set explicitly instead of relying on the regional default
platformVersion: agentcore.PlatformVersion.V2,
environmentVariables: { MODEL_ID: props.modelId },
});
// Converse with an inference profile needs the profile and the foundation models
runtime.addToRolePolicy(
new iam.PolicyStatement({
actions: ['bedrock:InvokeModel'],
resources: [
`arn:aws:bedrock:*:${this.account}:inference-profile/${props.modelId}`,
'arn:aws:bedrock:*::foundation-model/*',
],
}),
);
new CfnOutput(this, 'AgentRuntimeArn', { value: runtime.agentRuntimeArn });
}
}
// bin/app.ts
import { App } from 'aws-cdk-lib';
import { SpokeworksAgentStack } from '../lib/agent-stack';
const app = new App();
new SpokeworksAgentStack(app, 'SpokeworksAgentStack', {
env: { account: process.env.CDK_DEFAULT_ACCOUNT, region: 'eu-central-1' },
modelId: app.node.tryGetContext('modelId') ?? 'eu.anthropic.claude-haiku-4-5-20251001-v1:0',
});
Then deploy:
echo '{ "app": "npx tsx bin/app.ts" }' > cdk.json
npx cdk deploy SpokeworksAgentStack
Expected result: after a few minutes, CDK prints the AgentRuntimeArn output. The wait is normal: AgentCore starts your container, waits for /ping and builds the snapshot. On V1 this would have taken seconds.
Step 6: Invoke and verify
aws bedrock-agentcore invoke-agent-runtime \
--region eu-central-1 \
--agent-runtime-arn "<AgentRuntimeArn from the CDK output>" \
--runtime-session-id "spokeworks-test-session-0001-abcdef" \
--payload '{"prompt":"How much is a city bike per day?"}' \
--cli-binary-format raw-in-base64-out \
response.json
cat response.json
response.json then contains an answer mentioning 18 euros, a requestId and a current timestamp. Run two more calls with different session IDs (at least 33 characters long). Each answer should have a different requestId, and the timestamps should match the time of the call, not the time of the deployment.
Common errors
-
Deployment fails with a health check error: your initialization takes longer than 120 seconds, or the server does not listen on
0.0.0.0:8080. -
exec format errorin the logs: the image was built for x86. Check the platform in the Dockerfile and in the CDK asset. -
AccessDeniedExceptionon the model call: the model is not enabled in the Region, or the role may not use the inference profile. -
ConflictExceptionon an update: the runtime is stillCREATINGorUPDATING. Wait until it isREADY.
To clean up, run npx cdk destroy SpokeworksAgentStack. AgentCore deletes the snapshot itself once no endpoint points to it; running sessions may still continue for up to eight hours.
Check your code for snapshot risks automatically
AWS mentions a validator for the migration in its FAQ. I also wanted something that runs in every pull request pipeline and needs no AWS credentials. The following script is deliberately simple: it searches for the typical patterns with regular expressions and reports file and line. It does not replace thinking, but it catches the most common slips, especially in code written by an AI assistant.
// tools/snapshot-check.ts
import { readFileSync, readdirSync, statSync } from 'node:fs';
import { join } from 'node:path';
export type Finding = { file: string; line: number; rule: string; hint: string };
const rules: { id: string; pattern: RegExp; hint: string }[] = [
{ id: 'node-crypto-random', pattern: /\b(randomUUID|randomBytes|randomInt|getRandomValues)\s*\(/, hint: 'Can repeat across restored instances, read /dev/urandom instead' },
{ id: 'uuid-package', pattern: /from\s+['"]uuid['"]/, hint: 'The uuid package uses node:crypto, use freshId()' },
{ id: 'math-random', pattern: /Math\.random\s*\(/, hint: 'Seeded state ends up in the snapshot' },
{ id: 'hostname-pid', pattern: /\b(os\.hostname\s*\(|hostname\s*\(\)|process\.pid)\b/, hint: 'Identical on every restored instance' },
];
// Only top-level lines (no indentation) count for time values
const topLevelTime = /^(export\s+)?(const|let|var)\s+\w+\s*=\s*(Date\.now\(\)|new Date\(\)|performance\.now\(\))/;
export function checkSource(file: string, source: string): Finding[] {
const findings: Finding[] = [];
source.split('\n').forEach((text, i) => {
const line = i + 1;
if (text.trim().startsWith('//')) return;
for (const r of rules) {
if (r.pattern.test(text)) findings.push({ file, line, rule: r.id, hint: r.hint });
}
if (topLevelTime.test(text)) {
findings.push({ file, line, rule: 'startup-time', hint: 'Timestamp is frozen at snapshot time, compute it in the handler' });
}
});
return findings;
}
function listFiles(dir: string): string[] {
return readdirSync(dir).flatMap((name) => {
const full = join(dir, name);
if (name === 'node_modules' || name === 'dist') return [];
if (statSync(full).isDirectory()) return listFiles(full);
return /\.(ts|js|mjs)$/.test(name) ? [full] : [];
});
}
if (process.argv[1]?.endsWith('snapshot-check.ts')) {
const dir = process.argv[2] ?? 'agent/src';
const findings = listFiles(dir).flatMap((f) => checkSource(f, readFileSync(f, 'utf8')));
for (const f of findings) console.log(`${f.file}:${f.line} [${f.rule}] ${f.hint}`);
console.log(findings.length === 0 ? 'No snapshot risks found.' : `${findings.length} finding(s).`);
process.exitCode = findings.length === 0 ? 0 : 1;
}
npx tsx tools/snapshot-check.ts agent/src
For the example agent, the script reports “No snapshot risks found.” and exits with code 0. If you add a crypto.randomUUID() as a test, the finding shows up and the exit code is 1, which stops the pipeline. The tests use the built-in Node.js test runner:
// test/snapshot-check.test.ts
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { checkSource } from '../tools/snapshot-check';
test('flags crypto.randomUUID even inside a handler', () => {
const src = 'function handle() {\n const id = crypto.randomUUID();\n}';
assert.deepEqual(checkSource('a.ts', src).map((f) => f.rule), ['node-crypto-random']);
});
test('flags a timestamp taken at module scope', () => {
const src = 'const bootedAt = Date.now();';
assert.equal(checkSource('a.ts', src)[0].rule, 'startup-time');
});
test('accepts a timestamp inside the handler', () => {
const src = 'async function handle() {\n const startedAt = Date.now();\n}';
assert.equal(checkSource('a.ts', src).length, 0);
});
test('flags hostname and pid as instance id', () => {
const src = "const worker = os.hostname() + process.pid;";
assert.equal(checkSource('a.ts', src).length, 1);
});
npx tsx --test test/*.test.ts
Migrating existing agents to AgentCore Runtime V2
Switching an existing runtime is an in-place update. AgentCore adds a new runtime version, moves the DEFAULT endpoint to it and lets running sessions on the old version finish. Named endpoints stay on their version. You can use exactly that for a safe way back. This is how I would do it:
- Run the check script and the AWS validator over your code and fix the five pitfalls above.
- Pin a named endpoint to the current, proven version and point your clients at it.
- Update the runtime with
platformVersionV2. Important: an update also replacesresourceConfigurationsandhooksConfiguration, so include them in every update. - Test through
DEFAULT: answers, logs, unique IDs, start times. - Move the named endpoint to the new version. If something goes wrong, point it back to the old one.
# 1) Pin the production endpoint to the current version
aws bedrock-agentcore-control create-agent-runtime-endpoint \
--agent-runtime-id "<runtime-id>" \
--name prod \
--agent-runtime-version "3"
# 2) Switch the runtime to V2 (artifact, role and network are required)
aws bedrock-agentcore-control update-agent-runtime \
--agent-runtime-id "<runtime-id>" \
--role-arn "<role-arn>" \
--agent-runtime-artifact '{"containerConfiguration":{"containerUri":"<image-uri>"}}' \
--network-configuration '{"networkMode":"PUBLIC"}' \
--platform-version V2
# 3) Check the result
aws bedrock-agentcore-control get-agent-runtime \
--agent-runtime-id "<runtime-id>" \
--query "[status, platformVersion]"
If your runtime is managed with CDK, change platformVersion in the construct instead of running the CLI commands. I would not mix both, or the next cdk deploy will overwrite your manual changes.
The warmup hook
V2 supports a lifecycle hook for the build phase. AgentCore then calls your container twice: first with the type memory for initialization that needs a running server, then with disk, so files that every session reads at startup are already warmed up. Both calls share 120 seconds. This pays off mostly for large binaries, heavy Python packages or a headless browser. In aws-cdk-lib 2.276.0 I cannot find a property for it yet, neither in the L2 nor in the L1 construct. The example agent does not need it anyway, because /ping only turns healthy after initialization.
What AgentCore Runtime V2 costs
Without further settings, each V2 session gets 2 vCPU and 8 GB of memory, and you pay per second only for what your agent actually uses. Alternatively, you set a committed baseline via resourceConfigurations (minimumMemoryInMiB from 1024 to 8192). You pay for the baseline for the whole session, but at a lower rate, and the session may burst up to four times the baseline. AWS recommends starting with consumption pricing and watching the CPUUsed-vCPUHours and MemoryUsed-GBHours metrics. I would do exactly that. A baseline mainly pays off for agents that keep a large index or cache in memory for the whole session.
My take
I like this change. Cold starts were a real nuisance for agents with large images, and cheaper idle time suits agents that spend most of their time waiting for a human or a model. That is the Serverless mindset I want to see.
At the same time, V2 shifts responsibility to us developers, and to a place that is easy to miss in code review. “Most agents need no changes” is surely true. The others, however, do not fail at deployment time but weeks later, when two customers receive the same case number. To me, the fact that crypto.randomUUID() inside the handler is affected is the most important line in the whole documentation. I hope AWS fixes the reseeding soon; until then, I would search every Node.js code base before switching.
One thing I am critical of: a default that differs by Region and by documentation page is not a good idea. So once more, my advice from the beginning: always set the platform version explicitly. If you already run Lambda SnapStart, you have a clear head start, since the mindset is the same. And if you take AI-generated code into your agent, add the check script to your pipeline. In my experience, assistants like to reach for randomUUID().
FAQ
Do I have to move my existing agent to V2?
No. Existing runtimes stay on V1 until you set platformVersion to V2. New runtimes in the supported Regions land on V2 by default, which is why the explicit setting is worth it.
Is AgentCore Runtime V2 available in Frankfurt?
Yes. Europe (Frankfurt) is one of the 19 Regions where V2 is the default for new runtimes according to the announcement, as are Ireland, London, Milan, Paris, Spain and Stockholm.
Why does a V2 deployment take so long?
AgentCore starts your agent once, waits for the health check and creates the snapshot. That adds a few minutes at deployment time but saves time on every session start.
Can I go back from V2 to V1?
Yes, with an update that sets platformVersion to V1. A named endpoint pointing to the old runtime version is faster: you can switch it back immediately.
Your next step
Run the check script over your agent code today, even if you are not migrating yet. Findings for randomUUID(), startup timestamps and hostnames are a good hint at hidden assumptions even without snapshots. If you want to go deeper into agents with TypeScript, my post on the AgentCore CLI 1.0 helps, and for code that agents run themselves, have a look at Lambda MicroVMs as a sandbox.
I am curious: which values does your agent create at startup that make you wonder now? Let me know in the comments.
All code from this article, ready to run: smirowstanitzok/sascha-ms-examples
Sources
- AWS What’s New: The next generation AgentCore runtime is now the default (Nov 12, 2026)
- AWS Docs: Optimize your agent for AgentCore Runtime V2
- AWS Docs: AgentCore Runtime – platform versions, snapshot lifecycle, resource configurations
- AWS Docs: Configure lifecycle hooks for AgentCore Runtime
- AWS Docs: HTTP protocol contract (/ping, /invocations)
- AWS CDK: Amazon Bedrock AgentCore Construct Library
- AWS API Reference: CreateAgentRuntimeEndpoint
- Amazon Bedrock AgentCore FAQs
This post was created with AI assistance.
👉 Next step: Working with AWS CDK? Grab my printable AWS CDK cheat sheet with commands, concepts and a stack skeleton.
📬 Stay updated: New articles on serverless, AI and leading tech teams via RSS, browser push or the weekly newsletter (in German).
Originally published on sascha-ms.de. More articles on serverless, AI in everyday development and leading tech teams: sascha-ms.de/en

Top comments (0)