Running code that an agent wrote is the uncomfortable part of most agent builds. You want isolation, you want it fast, and you don't want to babysit a fleet. On 25 November AWS put out a developer preview that connects two things it already had: Lambda MicroVMs and Lambda durable functions.
Here's what the launch post says, and what I'd want to know before building on it.
The pieces
Lambda durable functions let you build multi-step workflows that can run for up to a year, with checkpointing and automatic retries.
Lambda MicroVMs are a serverless compute primitive with VM-level isolation, near-instant launch and resume, and state preservation. The stated use case is running user-generated or AI-generated code.
The new extension lets a durable function drive MicroVMs. You can run a single task in a MicroVM, or start a MicroVM session where tasks share the same files and memory.
What the extension does
According to the post, the durable function manages the MicroVM lifecycle and treats each task as a durable operation. That means:
- progress is checkpointed
- failed tasks are retried
- MicroVM tokens are refreshed as needed
- one durable function can orchestrate several MicroVMs in parallel
- you can trigger it from SQS or EventBridge
An optional worker library runs inside your MicroVM image. It receives tasks, sends heartbeats and reports results.
AWS names software factories, security scanners and CI/CD jobs as examples, all running untrusted or agent-generated code in isolated sandboxes.
Availability and caveats
- It's a developer preview. AWS says features may change and not to use it for production workloads.
- It supports the AWS Durable Execution SDK for TypeScript and Python.
- It's available wherever both Lambda durable functions and Lambda MicroVMs are available.
- The post doesn't state pricing for the extension. I'd read the Lambda MicroVM pricing before estimating anything.
Setup per the post: add the extensions package alongside the Durable Execution SDK in your function, and add the worker library to your MicroVM image. There's a sample application linked from the announcement, and the code lives under the aws-durable-execution-sdk repos on GitHub.
Why I think it matters
The hard part of agent sandboxes isn't starting a VM. It's the loop around it: what happens when a task hangs, a token expires, or the orchestrator dies halfway through a ten-step job. Durable execution gives you that for free if the checkpoint model fits your task shape.
What I'd do first: take one existing sandboxed job, like a dependency scanner, and port it using the sample app. Then look at three things: how retries behave on a task that half-completed, what a shared-session task sees on the second attempt, and what it costs per run.
I haven't run it. This is based on the launch post only. Has anyone looked at how session state behaves after a failed task? That's my first question.
Sources
Drafted with AI assistance. I review and edit every post.
Top comments (0)