Lambda durable functions run MicroVM sandboxes (25 Nov 2026 preview)

Prototype agent code runners and CI jobs on it now, set tight timeouts and the terminate permission, and keep production on GA tools until the preview ends.

Read time
16 min
Word count
2.6K
Sections
10
FAQs
8
Share
Two engineers planning code sandbox workflows beside a laptop and compute box under the title Lambda MicroVM Sandboxes
On this page · 10 sections
  1. What AWS shipped on 25 November
  2. How the orchestration works
  3. Limits and permissions in the preview
  4. The orphaned MicroVM is the bill to watch
  5. What it costs: AWS's CI example plus orchestration
  6. Where it fits, and where it does not
  7. A preview rollout plan
  8. India-specific considerations
  9. How eCorpIT can help
  10. References

Summary. On 25 November 2026 AWS released a developer preview that lets a Lambda durable function launch Lambda MicroVMs, send them work, wait for results and shut them down, so untrusted or AI-generated code runs in a VM-isolated sandbox while a workflow that can last up to one year checkpoints and retries around it. The extension ships for the Durable Execution SDK in TypeScript and Python, can be triggered from Amazon SQS or Amazon EventBridge, refreshes MicroVM access tokens itself, and AWS says it must not be used for production workloads. The npm package is at version 0.1.0-alpha.0 and every API in it is marked experimental. On AWS's own US East example, a 10-minute CI or security-scan job on an 8 GB, 4 vCPU MicroVM costs about $0.112, and the durable orchestration adds well under a cent per job at $8.00 per million operations. The real risk is not price: a MicroVM the workflow fails to terminate keeps billing until its maximum duration, up to 8 hours, which AWS's own documentation spells out. Our verdict: build a prototype agent code runner or CI executor on it now, because it removes the sandbox fleet you would otherwise run, but keep production on generally available tools until the preview ends.

About this article. This is for platform, DevOps and AI engineering leads in India, the US, the UK and elsewhere who run AI coding agents, multi-tenant CI or security scanners and need somewhere safe to execute code they did not write. On 30 November 2026 we checked every feature, limit, permission, price and date here against the AWS What's New announcement, the Lambda developer guide, the Lambda pricing page and the AWS Price List API, the SDK extension and worker documentation in AWS's GitHub repositories, and the E2B and Daytona pricing pages. This is a developer preview that AWS says may change, and vendors change prices, so re-check before you commit. It is technical guidance, not financial advice, and no vendor paid for inclusion. Researched with AI assistance and checked against the primary sources listed in the references.

What AWS shipped on 25 November

The announcement joins two Lambda products that already existed. Lambda durable functions let you write multi-step workflows in ordinary code that run for up to one year, with checkpoints and automatic retries. Lambda MicroVMs are serverless, Firecracker-based environments with VM-level isolation, snapshot-based fast startup, and suspend and resume that preserves memory and disk state, aimed at user-generated or AI-generated code. Until now you had to write the glue yourself: launch a MicroVM, deliver the job, watch for a crash, retry, and remember to terminate it.

The preview adds that glue as durable operations for running work on MicroVMs and managing their lifecycle. The headline capabilities:

  • Run a single task in a fresh MicroVM, or open a MicroVM session where several tasks share the same files and memory.
  • Each task runs as a durable operation, so the function checkpoints progress, retries failed tasks and refreshes MicroVM tokens as needed.
  • One durable function can drive several MicroVMs in parallel.
  • An optional worker library inside your MicroVM image receives tasks, sends heartbeats and reports results.
  • Triggers include Amazon SQS and Amazon EventBridge.

AWS names three target uses: software factories, security scanners and CI/CD jobs that run untrusted or agent-generated code. It is available in every AWS Region that supports both durable functions and MicroVMs. MicroVMs reached 10 regions, including Mumbai, in August; our MicroVM regions and quota analysis covers the 400 GB memory quota that six of those regions carry.

How the orchestration works

The durable function never waits on a running sandbox with a live invocation. The JavaScript extension documentation states that the function invocation ends while the MicroVM works, so Lambda does not bill function compute for the wait. The Python package says the same.

For a single job, the microvm operation runs a fixed sequence of durable operations inside one child context:

  1. A callback step creates a durable callback whose ID is checkpointed.
  1. A launch step calls RunMicrovm. The client token is a SHA-256 digest of the callback ID, so a retried or replayed launch returns the same MicroVM rather than starting a second one.
  1. For larger jobs, a request step creates a short-lived auth token and POSTs the job to the MicroVM.
  1. The function suspends until the worker in the MicroVM completes the callback.
  1. A terminate step calls TerminateMicrovm after success, failure or timeout.

Small jobs skip the HTTP step. If the payload fits in 4,096 Unicode code points and no custom route is set, the job travels inside the launch request to the image's run hook, and the MicroVM gets no ingress at all. Larger jobs, routed jobs and every session job go over HTTP, with the worker accepting bodies up to 6 MiB. That is where the token refresh in the announcement comes in: the request step retries once with a new auth token after a 401 or 403. MicroVM auth tokens are port-scoped and carry an expiry, which is why a long workflow needs fresh ones.

Single jobs and sessions

Use microvm for one isolated job and microvmSession (microvm_session in Python) when several jobs must share a MicroVM's files and processes, for example build, wait, then test against the same working tree. A minimal Python version of a one-job sandbox, adapted from the package's quick start:


            import os

from aws_durable_execution_sdk_python.config import Duration
from aws_durable_execution_sdk_python.context import DurableContext
from aws_durable_execution_sdk_python.execution import durable_execution
from aws_durable_execution_sdk_python_extensions.compute.microvm import MicrovmConfig, microvm

CONFIG = MicrovmConfig(
    image_identifier=os.environ["MICROVM_IMAGE_ARN"],
    execution_role_arn=os.environ["MICROVM_ROLE_ARN"],
    timeout=Duration.from_minutes(20),
    heartbeat_timeout=Duration.from_minutes(2),
)


@durable_execution
def handler(event: dict, context: DurableContext) -> dict:
    # Runs the agent-generated patch's test suite in a fresh MicroVM.
    return microvm(context, "run-tests", job_input={"repo": event["repo"], "sha": event["sha"]}, config=CONFIG)
          

Inside the image, the worker package starts when the process starts, listens on port 8080 by default, sends heartbeats about every third of the job's heartbeat timeout, and returns your handler's value as the operation's result. The image must enable the run and ready lifecycle hooks; the terminate hook is recommended so a running job fails at once when its MicroVM ends rather than at its heartbeat timeout. One detail to size for: the heartbeat timer starts when the callback is created, before the launch, so it must cover launch retries and boot, and AWS notes a throttled launch can take several minutes.

Errors you can branch on

Every failure surfaces as a MicrovmError subclass: job failed, timeout (no result or no heartbeat in time), launch error, delivery error or not running. Because the class is the same on replay, workflow code that branches on it stays deterministic. For an agent code runner, that means a crash in generated code, a hung process and an AWS launch problem take three different paths in your workflow without extra plumbing.

Limits and permissions in the preview

These are the numbers the extension documentation gives on 30 November 2026.

Item Value Why it matters
Job timeout 1 second to 8 hours Longer work must be split into several jobs or a session
MicroVM maximum duration Job timeout plus 5 minutes, at most 8 hours This is how long an orphaned MicroVM keeps billing
Job input 6,283,264 bytes as UTF-8 JSON Pass repositories and artefacts by S3 key
Job result 256 KB as JSON Return a summary and a pointer, not full logs
Default retry strategy 5 attempts Throttling must stay retryable or terminate can fail
Minimum time left for an HTTP job 11 seconds in the invocation The default 3-second Lambda timeout fails every session job
Suggested function timeout 71 seconds Gives the request step its full 60-second retry window
Auto-suspend idle time 60 seconds by default Only when the session enables it

The function's execution role needs lambda:RunMicrovm and lambda:TerminateMicrovm, plus lambda:CreateMicrovmAuthToken and lambda:GetMicrovm for HTTP jobs, lambda:PassNetworkConnector, iam:PassRole on the MicroVM role, and lambda:SuspendMicrovm only if you suspend after jobs. The MicroVM's own role needs the three durable callback permissions (success, failure, heartbeat) on the function's ARN. AWS also says to invoke the durable function through a published version or alias rather than $LATEST, so every replay runs the same code.

The extension needs @aws/durable-execution-sdk-js 2.6.0 or later, and the MicroVM client is an optional peer dependency you install yourself. The Python package installs as aws-durable-execution-sdk-python-extensions and is marked experimental too.

The orphaned MicroVM is the bill to watch

The orchestration is cheap. The failure mode is expensive. AWS's reference documentation lists the cases where the terminate step never runs and the MicroVM keeps running, and billing, until its maximum duration:

  • The role lacks lambda:TerminateMicrovm. The only sign is an error in the function's log.
  • A terminate call fails. The job result is already recorded, so the operation logs an error instead of throwing.
  • A map or parallel block finishes early, for example once a minimum number of items succeed, while an item still waits for its MicroVM.
  • The execution fails, times out or is stopped while waiting.
  • A launch attempt times out after creating a MicroVM whose ID the workflow never learned.
  • Under $LATEST, a launch step that retries after a deploy can fail and leave the MicroVM an earlier attempt created.
  • A custom retry strategy does not retry throttling, so terminate fails under load.

AWS's own example makes the point: a job with an 8-hour timeout that finishes in 5 minutes leaves its MicroVM running for almost 8 more hours. Using the US East Graviton rates of $0.0000276944 per vCPU-second and $0.0000036667 per GB-second, an orphaned 4 vCPU, 8 GB MicroVM costs $0.000140111 a second. With a 1-hour job timeout it lives 65 minutes (3,900 seconds), or about $0.55, roughly five times the $0.112 average job. With the 8-hour maximum it lives 28,800 seconds, about $4.04, or 36 average jobs. Set each job's timeout close to its real run time, set a heartbeat timeout on every job, and alarm on MicroVMs older than your longest job.

What it costs: AWS's CI example plus orchestration

AWS publishes a worked example for exactly this workload. A platform runs 10,000 security-scan or CI jobs a month; each runs 10 minutes on a MicroVM with an 8 GB, 4 vCPU baseline, scaling to 32 GB and 16 vCPU for 10% of the time, launched from one 2 GB image with no suspend. AWS's arithmetic: $336.27 for peak compute, $756.60 for baseline compute, $31 for snapshot reads at launch and $0.16 for image storage, a total of $1,124.03 a month or $0.112 per job.

Durable functions add three charges in US East: $8.00 per million durable operations, $0.25 per GB of data written and $0.15 per GB-month retained. A one-job microvm call creates a callback, a launch step, a terminate step and, for HTTP delivery, a request step, inside a child context. Our estimate is six operations per job with the execution start: 10,000 jobs times 6 is 60,000 operations, or $0.48 a month. Checkpoint data for small job inputs and results adds cents. Function compute is also small, because the invocation ends while the MicroVM works. The orchestration layer is under 0.1% of the sandbox bill in this example.

For comparison, sandbox vendors price per second too. The figures below were checked on 30 November 2026 against each vendor's pricing page and the AWS Price List API.

Option Price per hour for 2 vCPU and 4 GiB Plan fee Session ceiling
Lambda MicroVMs, US East, Graviton $0.2522 baseline, usage above baseline billed separately None 8 hours per MicroVM
E2B $0.1656 Pro $150 a month; Hobby free with a $100 one-time credit 24 hours on Pro, 1 hour on Hobby
Daytona $0.1656 None listed; $200 of free compute Not stated on the pricing page

The MicroVM figure is 2 times $0.0000276944 plus 4 times $0.0000036667, times 3,600 seconds. E2B's is 2 times $0.000014 plus 4 times $0.0000045 per second, and Daytona's is 2 times $0.0504 plus 4 times $0.0162 per hour. On list price per hour, Lambda MicroVMs cost about 52% more for this size. Two things narrow the gap: MicroVMs let you size for the baseline and pay for extra capacity only while it is used, and suspended MicroVMs pay snapshot storage, at $0.08 per GB-month, rather than compute. Our sandbox comparison covers Modal, Vercel, Cloudflare and the isolation trade-offs in more depth.

The bigger difference is what comes with the sandbox. With E2B or Daytona you still need a queue, retries, crash detection and cleanup around it. Here those come from durable functions, inside your AWS account, under your IAM and VPC controls.

Where it fits, and where it does not

The table draws on the announcement, the extension documentation and the MicroVM guide.

Workload Good fit for the preview? Why
AI coding agent that runs tests on its own patches Yes, for prototypes One job per patch, VM isolation, results back into the workflow
Multi-tenant CI executor triggered from SQS Yes, for prototypes AWS names CI/CD jobs; no standby pool to manage
Security scanner for customer repositories Yes, for prototypes Untrusted dependency installs stay inside a VM
Interactive developer environment Partly Sessions and suspend work, but an 8-hour MicroVM ceiling applies
Long human approval between build and deploy Yes, with care Durable waits use no compute; suspend needs an idle policy
Production customer workloads today No AWS says not to use the preview in production

The pattern that suits agent teams: an EventBridge rule or SQS message starts a durable function per agent task; the function asks a model for a patch, runs the patch's tests in a MicroVM, loops on failures, then waits for a human callback before merge. The extension also has a subpath for asking a decision model or a Bedrock model in a durable step, and an experimental operation that sends a job to an Amazon Bedrock AgentCore Runtime session instead of a MicroVM. If you already weigh AgentCore for agent hosting, our agent session isolation comparison sets out how its per-session microVMs differ.

Two cautions from the documentation. First, for the AgentCore operation AWS warns that a retried request can deliver the same job again, so job handlers with side effects, such as posting a pull request comment, should be safe to repeat. Second, adding or removing the suspend-after-job option changes replay behaviour, so ship such changes only in a new function version. If you are still deciding between durable functions and Step Functions for the outer workflow, our durable execution and Step Functions comparison covers the trade-off.

A preview rollout plan

  1. Pick one workload with a clear blast radius, such as running tests for agent-generated patches on an internal repository.
  1. Build a MicroVM image with the worker package and the run, ready and terminate hooks enabled.
  1. Grant the function role the run, terminate, auth-token, get, pass-connector and pass-role permissions, and the MicroVM role the three callback permissions.
  1. Set the function timeout to at least 71 seconds, set a heartbeat timeout on every job, and keep job timeouts tight.
  1. Invoke through a published version or alias, never $LATEST.
  1. Add a CloudWatch alarm or scheduled check for MicroVMs running longer than your longest job, and a budget alert on the Lambda MicroVMs line.
  1. Treat egress as open: the extension gives each MicroVM internet egress by default because the worker must reach the Lambda callback APIs, so keep secrets out of the image and review what the job can reach. Small jobs delivered through the run hook get no ingress.
  1. File what breaks on the SDK GitHub issue trackers, which is where AWS asks for preview feedback.

India-specific considerations

The AWS Price List API carries both durable function and MicroVM rates for Asia Pacific (Mumbai), so the extension's rule of running wherever both exist points to ap-south-1, though AWS does not publish a separate region list for the preview. Mumbai Graviton MicroVM rates are within a fraction of a per cent of US East, while durable operations cost $8.60 per million there against $8.00. For Indian SaaS and IT services teams that run CI or code scanning for clients, a sandbox inside your own AWS account keeps client source code off a third-party sandbox provider, which simplifies the data-processing terms you sign. Under the Digital Personal Data Protection Act, test fixtures and logs that carry customer personal data are still personal data inside a MicroVM, so apply your retention and access rules to the durable execution history too: durable functions keep execution data for 1 to 90 days after completion, 14 by default. Our MicroVM regions analysis found AWS's developer example at $12.54 a month per developer in Mumbai against $12.41 in N. Virginia.

How eCorpIT can help

eCorpIT is a Gurugram-based technology organisation, founded in 2021, assessed at CMMI Level 5 and MSME certified, with senior-led engineering teams working across AWS, Microsoft and Google platforms. Our cloud computing services team can prototype a durable-function sandbox pipeline for your agents, CI or code scanning, with IAM, timeout and cleanup guardrails. Talk to us at /contact-us/.

Last updated: 30 November 2026.

References

  1. AWS Lambda now supports orchestrating MicroVMs with Lambda durable functions, 25 November 2026 — AWS What's New
  1. aws-durable-execution-sdk-js-extensions package.json — AWS on GitHub
  1. AWS Durable Execution SDK Extensions (TypeScript) README — AWS on GitHub
  1. AWS Lambda pricing — Amazon Web Services
  1. AWS Lambda price list offer file, US East (N. Virginia), published 25 November 2026 — AWS Price List API
  1. MicroVM operations reference — AWS on GitHub
  1. Lambda durable functions — AWS Lambda Developer Guide
  1. AWS Lambda MicroVMs — AWS Lambda Developer Guide
  1. AWS Durable Execution SDK for Python: extensions README — AWS on GitHub
  1. Security and permissions for Lambda MicroVMs — AWS Lambda Developer Guide
  1. AWS Durable Execution SDK Compute Worker README — AWS on GitHub
  1. Pricing — E2B
  1. Pricing — Daytona
  1. AWS Lambda price list offer file, Asia Pacific (Mumbai) — AWS Price List API

Frequently asked

Quick answers.

01 What did AWS announce on 25 November 2026?
A developer preview of an extension that lets Lambda durable functions orchestrate Lambda MicroVMs. A durable workflow can launch MicroVMs, send them tasks, checkpoint and retry those tasks, refresh access tokens and terminate the MicroVMs, so untrusted or AI-generated code runs in VM-isolated sandboxes inside a workflow lasting up to one year.
02 Can I use the MicroVM extension in production?
No. AWS released it as a developer preview and says preview features may change and should not be used for production workloads. The npm package is an alpha release and every API is marked experimental. Use it for prototypes and internal pipelines, and keep customer-facing workloads on generally available services until AWS announces general availability.
03 Which languages does the extension support?
TypeScript and Python. You add the extensions package to a function that uses the AWS Durable Execution SDK for that language, and add the matching MicroVM worker library to your MicroVM image. Durable functions may support other languages, but the MicroVM extension in this preview covers only these two.
04 How is a Lambda durable function billed while a MicroVM runs?
The function invocation ends while the MicroVM works, so you pay no function compute for the wait. You pay for durable operations, at 8 dollars per million in US East, plus data written and retained. The MicroVM itself is billed per second for its baseline vCPU and memory while it runs, plus any usage above baseline.
05 What happens if the workflow fails to terminate a MicroVM?
The MicroVM keeps running and billing until its maximum duration, which is the job timeout plus five minutes, capped at eight hours. This happens if the role lacks the terminate permission, a terminate call fails, an execution stops while waiting, or a parallel block ends early. Tight timeouts and an age alarm limit the damage.
06 How does this compare with E2B or Daytona?
On list price, a 2 vCPU, 4 GiB sandbox costs about 0.17 dollars an hour on E2B or Daytona against about 0.25 dollars on Lambda MicroVMs in US East. The AWS option includes orchestration, retries and cleanup through durable functions and runs inside your own account, while the others need you to build that layer.
07 What triggers can start a sandbox workflow?
AWS names Amazon SQS and Amazon EventBridge as event sources for the durable function that orchestrates the MicroVMs. A typical setup puts one message per agent task or CI job on a queue, and each message starts one durable execution that runs the job in a MicroVM and records its result.
08 Is the extension available in the Mumbai region?
AWS says it runs wherever both Lambda durable functions and Lambda MicroVMs are supported, and the AWS price list carries rates for both in Asia Pacific (Mumbai). AWS publishes no separate region list for the preview, so confirm in your own account before you design around Mumbai, and compare regional rates.

About the author

Manu Shukla

Founder & Director

Founder of eCorpIT. Hands-on engineer leading senior-only delivery for AI apps, custom software, and cloud systems for global clients.

Subscribe

One engineering note a week. No fluff, no spam.

Senior-architect playbooks on AI agents, mobile apps, cloud, security, data, and marketing — delivered every Wednesday.

Past the reading

Read enough. Let's build something.

A senior architect responds in 24 working hours with scope, indicative cost, and a timeline. NDA before any technical conversation.

Weekly engineering notes

Enjoying this article? Get one like it every Wednesday.

Senior-architect playbooks on AI agents, mobile apps, cloud, security, data and marketing. Unsubscribe in one click.

We email a link to confirm your address. Privacy

Loading search…

Browse all guides