AWS Lambda MicroVMs for AI agents: what we learned shipping on launch day
By Manik Narang ·
TL;DR: AWS Lambda MicroVMs give each AI agent session its own Firecracker virtual machine without you running a sandbox fleet. At Profound, I had our AI Marketer (Aim) running inside one the evening AWS announced the service, and we cut over production a couple of weeks later. AWS now quotes me on the Lambda MicroVMs product page about that launch-day adoption. Aim now launches several hundred thousand MicroVMs a month, time to first token dropped by more than 20%, and a warm pool brings session start under 100 ms at p99. The main things to plan for are account quotas, idle reaping, and keeping session state off the sandbox's disk.
What did AWS say about Profound's adoption?
AWS features Profound on the Lambda MicroVMs product page, under "Profound delivers instant-start AI marketing agents to thousands of customers," and quotes me:
"At Profound, we built AI Marketer, which is a marketing agent that runs in the background, helping thousands of marketers win in AI search and beyond. An AI Marketer session can run for hours, pull brand context, run code analysis, generate recommendations, and pause for human review, allowing marketers to do their work in Profound. Each session needs a fast cold start in its own isolated environment and the ability to suspend and resume with its state intact. Lambda MicroVMs are a perfect fit for this use case. AWS handles the Firecracker virtualization, and we manage the session lifecycle, networking, and data persistence across turns while ensuring tenant isolation. Today, we launch several hundred thousand MicroVMs every month.
Agent workloads have needed this primitive for a while. Now it exists, and it fits alongside the rest of our AWS stack. We adopted Lambda MicroVMs the day after launch. Read the announcement in the morning, had AI Marketer running inside a MicroVM that evening, and shipped it to production from there. Lambda MicroVMs is one of the most useful primitives we've adopted this year, and one of the few pieces of infrastructure we trusted in production from day one. Three months in, we're building more features on it as our usage grows."
— Manik Narang, Member of Technical Staff at Profound, on the AWS Lambda MicroVMs page
The rest of this post is the story behind that quote.
What are AWS Lambda MicroVMs?
AWS Lambda MicroVMs are serverless compute environments with VM-level isolation. Each one is a Firecracker microVM with its own kernel and full operating system capabilities, so code inside it can install system packages or mount filesystems. MicroVMs start quickly from snapshots, can suspend and resume with their state intact, and give you fine-grained control over network ingress. AWS runs the virtualization; you own the session lifecycle, networking, and persistence.
That combination is what agent workloads have been missing: an isolated machine per session that starts fast, can live for hours, and sits inside your own AWS network.
Why did Profound need a new sandbox for its AI agent?
Aim started as a root cause analysis bot that explained why a Profound metric changed. It grew into a general-purpose marketing agent that runs across the whole platform. A single Aim session can run for hours, pull brand context, run code analysis, generate recommendations, and pause for a human to review its work.
The first version ran on a hosted sandbox provider, and three problems grew with usage:
- Network path. The sandboxes lived on the provider's infrastructure, so every call from Aim to an internal Profound service left our AWS network and crossed the public internet. That added hops to every tool call, raised time to first token, and forced internal services to be reachable from outside.
- Isolation. The provider isolated code with gVisor, which intercepts syscalls in software. Aim runs untrusted code, and we wanted the stronger boundary of a separate kernel per sandbox, which Firecracker provides.
- Reliability. Aim's uptime depended on a system we couldn't see into or fix.
Which options did we compare?
| Hosted sandbox provider | Self-hosted E2B on AWS | AWS Lambda MicroVMs | |
|---|---|---|---|
| Isolation | gVisor (software syscall interception) | Firecracker (own kernel) | Firecracker (own kernel) |
| Network path to internal services | Public internet | Inside our VPC | Inside our VPC |
| Who runs the sandbox fleet | Provider | Us | AWS |
| Who owns uptime | Provider | Us | Us, on AWS primitives |
We were about to self-host E2B. It fixed networking and isolation, but it meant operating a sandbox fleet ourselves. Lambda MicroVMs gave us the same two fixes without the fleet.
How did we go from announcement to production?
- Morning: I read the AWS announcement.
- Evening: Aim was running inside a MicroVM as a proof of concept.
- A couple of weeks later: we cut over production, in early August 2026.
It moved fast because most of Profound already ran on AWS. The MicroVMs went into dedicated subnets in our existing VPC, behind a network connector, so Aim could reach internal services privately from day one.
How does an AI agent session run on Lambda MicroVMs?
Each Aim session gets two MicroVMs:
- A runtime sandbox runs the agent loop: it calls the model and coordinates tools.
- An untrusted sandbox runs model-written code and any tool that touches the filesystem. It runs without privileges, can't read most of the filesystem, and has no route into our private network. We hardened it with ideas from Anthropic's open-source sandbox-runtime.
A gateway sits between the sandboxes and our internal services. It holds credentials and makes authenticated calls on the sandbox's behalf, so secrets never enter the untrusted VM. It also writes artifacts to blob storage.
A warm pool of pre-launched sandbox pairs hides the cold start. When someone opens a chat, the gateway claims a pair from the pool and binds it to the session.
When a sandbox stops, the session's conversation turns, artifacts, and checkpoints are persisted through the gateway to our database and blob storage. Any fresh sandbox can pick the session up later.
What results did we see?
| Metric | Before | After |
|---|---|---|
| Time to first token, new chat | 10–12 s | 8–9 s |
| Time to first token, later turns | 8–9 s | 6–7 s |
| Sandbox start, fresh (p95) | n/a | 2–3 s |
| Sandbox start, from warm pool (p99) | n/a | under 100 ms |
| MicroVMs launched per month | n/a | several hundred thousand |
The latency gain comes mostly from removing the public-internet hops. Aim does more per turn now than it did then, so the real improvement is a bit larger than the table shows. One scheduled pipeline alone launches thousands of sandboxes every other day to analyze each customer's categories.
The less visible win is ownership: Aim's uptime is now ours to measure and fix.
What should you know before running agents on Lambda MicroVMs?
These lessons came from incidents and fixes after the cutover.
- Ask for quota early, and more than once. Your launch rate is bounded by AWS account quotas. Batch jobs that fan out to thousands of sandboxes hit them first. We had to raise ours several times.
- Give startup one budget. A fresh sandbox can fail to bind. Retry inside a single startup deadline instead of stacking timeouts, or users wait through several cold starts in a row.
- Protect live work from idle reaping. Idle suspension saves money, but a long tool call can look idle. Mark active executions explicitly so they aren't suspended halfway through.
- Treat the sandbox pair as one unit. If the runtime or the untrusted sandbox dies, replace both and keep their idle lifetimes aligned. A half-alive pair is worse than a clean restart.
- The sandbox disk is scratch space. Anything a user would miss belongs in your own storage. This matters more as sessions turn into long-running collaborations that pause for review.
- Keep the untrusted VM off your network. Route everything through a gateway that holds the credentials. The sandbox should be able to do useful work without ever seeing a secret.
Frequently asked questions
Do AWS Lambda MicroVMs use Firecracker?
Yes. AWS runs Firecracker virtualization under the hood, so each MicroVM has its own kernel. That is a stronger isolation boundary than container- or gVisor-based sandboxes.
How are Lambda MicroVMs different from Lambda functions?
Lambda functions run short, stateless handlers. Lambda MicroVMs are full virtual machines with operating system capabilities that can run long sessions and suspend and resume with their state, which suits AI agents that work for hours.
Should I use Lambda MicroVMs or self-host E2B?
If you're already on AWS and don't want to operate a sandbox fleet, start with Lambda MicroVMs. Self-hosting makes sense when quotas or launch rates become the constraint and you're ready to run the lifecycle yourself. We're reconsidering that trade-off ourselves as usage grows.
How do you avoid cold starts for AI agent sandboxes?
Keep a warm pool of pre-launched sandboxes and claim one when a session starts. That took our start time from 2–3 seconds at p95 to under 100 ms at p99.
Sources
- AWS: Lambda MicroVMs product page, which includes my quote on Profound's adoption
- AWS: Lambda MicroVMs developer guide
- Profound Engineering: Inside Aim: Running AI sandboxes on AWS Lambda MicroVMs, which I co-wrote with Jacob Goldstein, Praneeth Alla, Rohan Jain, and Ana Lastoviria