← AUTOMATER NEWSROOM

AWS Connects Lambda Durable Functions to Isolated MicroVM Sandboxes in Developer Preview

AWS released a developer preview extension for the AWS Durable Execution SDK in TypeScript and Python that lets year-long Lambda durable functions orchestrate isolated Lambda MicroVMs, stateful multi-task sessions, and inside-VM workers.

Architecture diagram showing Amazon SQS, EventBridge, and qualified Lambda invocations triggering a Lambda durable function that checkpoints steps, refreshes tokens, and orchestrates stateful MicroVM sessions and parallel isolated MicroVMs with an inside-VM compute worker.Architecture diagram showing Amazon SQS, EventBridge, and qualified Lambda invocations triggering a Lambda durable function that checkpoints steps, refreshes tokens, and orchestrates stateful MicroVM sessions and parallel isolated MicroVMs with an inside-VM compute worker.
AWS Lambda durable functions use the new MicroVM extension and inside-VM compute worker to orchestrate stateful MicroVM sessions and parallel isolated MicroVM tasks across workflows lasting up to one year.

On November 25, 2026, AWS announced a developer preview extension for orchestrating AWS Lambda MicroVMs with Lambda durable functions. Available for both the AWS Durable Execution SDK for JavaScript and TypeScript and the AWS Durable Execution SDK for Python, the extension introduces durable operations that run work inside Lambda MicroVMs and manage their lifecycle. For engineering teams building AI software factories, automated security scanners, or CI/CD workflows that execute untrusted or agent-generated code, the launch links year-long checkpointed orchestration directly to serverless VM-isolated sandboxes.

AWS What's New announcement page titled AWS Lambda now supports orchestrating MicroVMs with Lambda durable functions, posted on November 25, 2026.
AWS What's New announcement published November 25, 2026 detailing the developer preview extension for orchestrating Lambda MicroVMs with Lambda durable functions in TypeScript and Python. · Original source

Bridging Year-Long Workflows and VM-Isolated Sandboxes

Teams operating coding agents and automated build pipelines routinely face an architectural split between control-plane durability and execution-plane isolation. As recent industry moves toward external sandboxes for coding agents and MicroVM-isolated agent evaluation benchmarks illustrate, executing model-generated or untrusted code safely calls for virtual-machine isolation boundaries rather than shared container runtimes. At the same time, multi-step agent loops—such as generating a patch, installing dependencies, running test suites, and waiting for human review—can span hours or days.

AWS addresses this split by combining two serverless primitives:

  • Lambda durable functions allow multi-step applications and AI workflows to run for up to one year with automatic checkpointing, configurable retry strategies with exponential backoff and jitter, and deterministic failure recovery. Because waits suspend execution without active compute charges, an orchestrator can pause for timers, webhooks, or human-in-the-loop callbacks without paying for idle runtime.
  • Lambda MicroVMs provide a serverless compute primitive with VM-level isolation, near-instant launch and resume, and state preservation tailored for user-generated or AI-generated code.

With the new MicroVM extension, the durable function manages the MicroVM lifecycle directly and executes each sandbox task as a durable operation. The orchestrator checkpoints progress after each operation, retries failed tasks automatically, and refreshes MicroVM tokens as needed.

Single Tasks, Stateful MicroVM Sessions, and Parallel Fan-Out

The developer preview supports two execution modes depending on whether an agent workflow requires a clean environment per step or persistent state across turns:

  1. Individual MicroVM tasks: A durable function dispatches a standalone job into a MicroVM to run untrusted code in an isolated boundary and capture the result as a checkpointed step.
  2. Stateful MicroVM sessions: A durable function launches a MicroVM session in which sequential tasks share the same files and memory. Operators who already share build files with Lambda MicroVM sessions and verify cleanup can now wrap multi-stage compile, test, and verification loops inside a single durable execution.

A single durable function can also orchestrate multiple MicroVMs in parallel using the SDK’s batch, parallel, and map operations with configurable concurrency controls and completion policies. Workflows can be triggered directly from event sources such as Amazon SQS or Amazon EventBridge. Inside the MicroVM image, an optional compute-worker library receives tasks from the orchestrator, emits periodic heartbeats, and reports task results.

SDK Package Architecture Across TypeScript and Python

To use the preview, developers add the extensions package to their Lambda durable function alongside the core Durable Execution SDK, and bundle the MicroVM worker library into their MicroVM image. In the JavaScript monorepo README, AWS lists @aws/durable-execution-sdk-js-extensions and @aws/durable-execution-sdk-js-compute-worker as experimental alpha packages whose APIs may change without a major version bump. While the AWS announcement confirms that both the extensions package and the MicroVM worker library are available for TypeScript and Python, the Python repository’s top-level README table currently lists only the core, testing, OpenTelemetry, and telemetry-exporter packages.

Layer JavaScript / TypeScript Package Python Package Role in Workflow
Core Orchestrator @aws/durable-execution-sdk-js aws-durable-execution-sdk-python Checkpointed steps, waits, callbacks, child contexts, and parallel execution
MicroVM Extension @aws/durable-execution-sdk-js-extensions Extensions package for Python named in the AWS announcement (not yet listed in the Python repo README) Custom durable operations (microvm in JS) to dispatch jobs and manage MicroVM lifecycle
Inside-VM Worker @aws/durable-execution-sdk-js-compute-worker MicroVM worker library for Python named in the AWS announcement (not yet listed in the Python repo README) Runs inside the MicroVM (microvm subpath in JS) to receive tasks, send heartbeats, and report results
Testing & Replay Lint @aws/durable-execution-sdk-js-testing, @aws/durable-execution-sdk-js-eslint-plugin aws-durable-execution-sdk-python-testing Local and cloud test runners (LocalDurableTestRunner, pytest helpers) and deterministic replay checks
Observability & MCP @aws/durable-execution-sdk-js-otel, @aws/durable-execution-sdk-js-telemetry-exporter, @aws/durable-execution-sdk-js-telemetry-mcp aws-durable-execution-sdk-python-otel, aws-durable-execution-sdk-python-telemetry-exporter OpenTelemetry spans, execution record export (CloudWatch Logs, S3, DynamoDB), and read-only MCP telemetry queries

Note that the Python telemetry exporter package is published on PyPI as aws-durable-execution-sdk-python-telemetry-exporter, while the JavaScript repository also includes a read-only Model Context Protocol (MCP) server (@aws/durable-execution-sdk-js-telemetry-mcp) so AI assistants can inspect execution telemetry records directly.

Deterministic Replay and Invocation Requirements

Understanding the Durable Execution SDK’s replay model is essential before wiring MicroVM operations into an agent loop. A durable function does not stay active while waiting on a timer, callback, or external job. When execution can continue, Lambda invokes the handler again from the beginning and the SDK replays prior progress:

  • For any step or durable operation that already completed, the SDK returns the saved checkpoint result without re-running the step’s function.
  • At the first operation that has not yet finished, the SDK executes the operation and checkpoints its output.

Because code outside durable steps runs again on every replay, top-level handler logic must be strictly deterministic. Generating random values, UUIDs, or timestamps outside a step will produce different values on replay and break execution determinism. The JavaScript SDK ships @aws/durable-execution-sdk-js-eslint-plugin to catch non-deterministic calls at edit time, and LocalDurableTestRunner (with skipTime: true) to test multi-invocation replay locally without deploying to AWS.

import {
  withDurableExecution,
  DurableContext,
} from "@aws/durable-execution-sdk-js";

const handler = async (event: { userId: string }, context: DurableContext) => {
  context.logger.info("Starting workflow", { userId: event.userId });

  // Wrap non-deterministic calls and external work inside checkpointed steps
  const orderId = await context.step("create-order-id", async () =>
    crypto.randomUUID(),
  );

  // Waits suspend the function with no active compute charges
  await context.wait({ seconds: 5 });

  const result = await context.step("process-order", async (stepCtx) => {
    stepCtx.logger.debug("Processing checkpointed order");
    return { orderId, userId: event.userId, status: "PROCESSED" };
  });

  return result;
};

export const lambdaHandler = withDurableExecution(handler);

In Python, developers structure workflows using @durable_execution, @durable_step, DurableContext, and StepContext:

from aws_durable_execution_sdk_python import (
    DurableContext,
    StepContext,
    durable_execution,
    durable_step,
)
from aws_durable_execution_sdk_python.config import Duration

@durable_step
def validate_order(step_ctx: StepContext, order_id: str) -> dict:
    step_ctx.logger.info("Validating order", extra={"order_id": order_id})
    return {"order_id": order_id, "valid": True}

@durable_execution
def handler(event: dict, context: DurableContext) -> dict:
    order_id = event["order_id"]
    validation = context.step(validate_order(order_id), name="validate_order")
    if not validation["valid"]:
        return {"status": "rejected", "order_id": order_id}

    context.wait(duration=Duration.from_seconds(5), name="await_confirmation")
    return {"status": "approved", "order_id": order_id}

When invoking a durable function, Lambda requires a qualified identifier—a numbered version or alias (or $LATEST for non-production testing). Unqualified function names or ARNs without a suffix are rejected to enforce deterministic replay behavior. Asynchronous invocation (--invocation-type Event) combined with --durable-execution-name enables idempotent executions lasting up to one year:

aws lambda invoke \
  --function-name my-durable-function:$LATEST \
  --invocation-type Event \
  --durable-execution-name agent-build-run-01 \
  --cli-binary-format raw-in-base64-out \
  --payload '{"userId": "12345"}' \
  response.json

Availability and Developer Preview Guardrails

The MicroVM orchestration extension is available across all AWS Regions that support both Lambda durable functions and Lambda MicroVMs. Because developer preview features and alpha packages may change without a major version bump, AWS advises against using the extension for production workloads. Teams can prototype sandboxed coding-agent pipelines, security scanners, and CI/CD runners today and file feedback through the JavaScript and Python Durable Execution SDK GitHub repositories.

Sources

  1. AWS Lambda now supports orchestrating MicroVMs with Lambda durable functions - AWS
  2. GitHub - aws/aws-durable-execution-sdk-js: Lambda durable functions SDK, Testing SDK and fully functional examples · GitHub
  3. GitHub - aws/aws-durable-execution-sdk-python: Lambda durable functions SDK · GitHub