Nitro Sandboxes on AWS ECS: what isolated and confidential tasks are for
AWS ECS Managed Instances can now run each task in its own Nitro Sandbox. What isolated and confidential mode protect against, how they compare with Fargate and Nitro Enclaves, and which workloads need them.
On 9 November 2026 AWS added isolated and confidential tasks to AWS ECS. Under the hood each task runs in its own Nitro Sandbox, a lightweight virtual machine on the instance, managed by the Nitro Hypervisor. The feature is available on ECS Managed Instances only.
Until now you had to pick a side. Fargate gives every task its own isolation boundary, but you can’t choose instance types, pack tasks tightly or use Capacity Reservations. EC2 and Managed Instances give you all of that, but every task on a host shares one kernel. Nitro Sandboxes remove that trade-off: several tasks share one Managed Instance, and each still gets its own VM.
This post covers what the two new modes protect against and who needs them. A setup guide with the full configuration follows in a later post.
The problem with a shared kernel
Containers on one host are processes that share the host’s Linux kernel. Namespaces and cgroups keep them apart, but a kernel bug or a misconfigured container can let one task break out. Once out, it can read the memory, files and credentials of every other task on that host.
For most teams this is an acceptable risk, because every task on the cluster belongs to them. It stops being acceptable when the code in a task isn’t yours, or when the data in it must not be seen even by the people who run the hosts. The Fargate vs EC2 post covers the wider trade-offs between the two models.
What a Nitro Sandbox is
A Nitro Sandbox is a small VM that runs on an EC2 instance. The instance gives up some of its vCPUs and memory, and the Nitro Hypervisor turns them into a separate machine with its own kernel. Several sandboxes can run on one instance. With ECS, each task gets one sandbox, and ECS creates and removes it with the task.
Because each sandbox has its own kernel, escaping a container only gets an attacker into that one sandbox. The task next to it is behind a hardware-backed VM boundary, not just a namespace.
Unlike Nitro Enclaves, which talk to the outside world through a single local socket, sandboxes get normal network and block devices. Your containers run as they always have, with networking, ephemeral storage and access to AWS services.
Isolated mode vs confidential mode
You pick the mode per task definition, in a new trustedExecutionConfiguration block. There are three values:
isolationMode | Protects a task from | Host can read task memory | Attestation |
|---|---|---|---|
SHARED (default) | Nothing beyond normal container isolation | Yes | No |
ISOLATED_SANDBOX | Other tasks on the same instance | Yes | No |
CONFIDENTIAL_SANDBOX | Other tasks, the host and AWS operators | No | Yes |
Isolated mode is about neighbours. Each task sits in its own VM, so a compromised task can’t reach the memory or storage of another task. The host itself is still trusted: the instance can read the sandbox’s memory. Use it when you trust whoever runs the hosts, but not every workload on them.
Confidential mode goes further. Nitro moves the sandbox’s memory out of the host, so neither the host, your own operators nor AWS operators can read it. Each sandbox also gets a Nitro Security Module that produces a signed attestation document, a cryptographic proof of exactly what code runs inside. AWS KMS can check that proof and release a key only to a sandbox whose measurements match the values you expect. A confidential task definition must include an attestationPolicy that says which containers may run and which runtime settings are attested.
In a task definition, the switch is a few lines:
{
"family": "untrusted-runner",
"requiresCompatibilities": ["MANAGED_INSTANCES"],
"trustedExecutionConfiguration": {
"isolationMode": "ISOLATED_SANDBOX"
}
} The capacity provider has to allow it as well. Managed Instances capacity providers get a nitroEnclavesEnabled setting, and only instances launched with it can run sandboxed tasks. Running tasks report their mode in a trustedExecutionSummary field, so you can check what a task actually runs with.
ECS Exec keeps working in both modes. In isolated mode the host is still trusted, so nothing changes. In confidential mode the attestation policy has to allow the one command that starts the ECS Exec agent. If the task or its service sets enableExecuteCommand, generate the policy with ecs-nitro-sandbox-genpolicy --allow-exec-command, or the task is denied at startup. Adding it later means regenerating the policy.
How it compares
| Fargate | Managed Instances | Managed Instances + Nitro Sandbox | Nitro Enclaves | |
|---|---|---|---|---|
| Isolation per task | VM boundary | Shared kernel | VM boundary | Separate enclave |
| Choose instance types | No | Yes | Yes, supported types only | Yes |
| Capacity Reservations | No | Yes | Yes | Yes |
| Hidden from the host | No | No | Confidential mode | Yes |
| Attestation | No | No | Confidential mode | Yes |
| Network and storage inside | Yes | Yes | Yes, but no per-task EBS volumes | No, local socket only |
Nitro Enclaves are still the better fit for small, tightly scoped jobs, such as a signing service that only ever sees one key. Nitro Sandboxes are for whole containerised applications that need the same kind of protection.
Use cases
Multi-tenant platforms
A SaaS product that runs work for each customer, such as report generation, data imports or customer-supplied plugins, usually has a choice: one cluster per customer, or shared hosts and a lot of trust in container isolation. Isolated mode gives each customer’s task its own VM while they share instances, so you keep the bin-packing savings without the shared kernel. Mode: isolated.
AI agents and code that you didn’t write
Agents that write and run code, notebook backends, online code playgrounds and grading systems all run code nobody reviewed. That code will eventually try something it shouldn’t. Isolated mode keeps that inside one VM. Combine it with tight security groups and a task role with almost no permissions, since the sandbox protects the host, not the AWS APIs the task can call. Mode: isolated.
Shared CI runners and build jobs
Build jobs run whatever is in the repository and its dependencies. When many teams share one cluster of runners, a malicious dependency in one build shouldn’t be able to read another team’s secrets from a neighbouring task. Mode: isolated.
Regulated data
Health records, payment data and personal data often come with rules about who can access them, including administrators. Confidential mode means the people and systems that manage the hosts can’t read the data while it’s being processed. Attestation gives auditors a record of which image handled it. Mode: confidential.
Protecting models and proprietary code
If you ship a model or an algorithm to run near a customer’s data, confidential mode keeps the weights or code in memory the host can’t read. With a KMS key policy tied to the attestation document, the model’s decryption key is only released to your unmodified image. Mode: confidential.
Secrets only a verified image may use
The same KMS check works for any secret: database credentials, signing keys, API tokens. Instead of trusting everything that can assume the task role, the key policy also requires a matching attestation. A changed image, or the same image started outside a sandbox, gets nothing. Mode: confidential.
When not to use it
- GPU workloads. GPU passthrough into a Nitro Sandbox isn’t available yet.
- Fargate or plain EC2 capacity. The feature is limited to Managed Instances. Fargate already isolates each task, but has no confidential mode.
- Workloads that need instance storage. The sandbox setting can’t be combined with local storage on the capacity provider.
- Service Connect or host networking. Sandboxed tasks need the
awsvpcnetwork mode and don’t support Service Connect. Load balancers, VPC Lattice and per-task security groups still work. - Per-task EBS volumes. You can’t attach an EBS volume to a sandboxed task, including volumes with
configuredAtLaunch. Each task gets 20 GiB of encrypted ephemeral storage instead. - One team, one trusted workload. If every task on the cluster is yours and the data isn’t regulated, the shared kernel is a risk you’re probably already accepting elsewhere.
Capacity works differently
Sandboxes change how many tasks fit on an instance:
- Memory is dedicated. Each sandbox reserves its full memory when it starts and returns it only when it stops. There is no overcommit, and ECS adds some overhead per sandbox: a task with 2 vCPU and 8 GiB takes about 8.7 GiB of the instance.
- vCPUs are capped. The vCPUs of all sandboxes on one instance can add up to at most five times the instance’s vCPU count.
- Half the vCPUs on SMT instances. On instances with two threads per core, which covers most Intel and AMD types, two sandboxes never run on the same physical core at the same time. Sandboxed tasks get about half the instance’s advertised vCPUs: four one-vCPU tasks on a 4 vCPU Intel instance share two cores. Request CPU in multiples of 2 vCPUs, or use Graviton, which has one thread per core.
- Sizes are fixed. A sandbox can’t grow or shrink while it runs, so a task with a new size is always a new task.
- Some host resources are still shared. The instance’s connection tracking table and DNS resolver serve every sandbox on it. A noisy task can use them up for its neighbours.
- Supported instance types only. Sandboxes run on instance types that support Nitro Enclaves. That covers most current general purpose, compute and memory optimised families, usually without the smallest and the metal sizes.
In practice the limit is memory, or physical cores on SMT instances, so expect fewer tasks per instance than with shared mode. The right-sizing post helps you set task sizes that don’t waste reserved memory.
Summary
Isolated mode gives each task on a Managed Instance its own VM, so a broken or hostile task can’t reach its neighbours. Confidential mode also hides the task from the host and from AWS, and lets KMS release keys only to a verified image. Both keep the instance choice and bin-packing of Managed Instances.
Start with isolated mode for anything that runs code you didn’t write. Move to confidential mode when the question is no longer “what if a task is hostile” but “who else could read this data”. Region availability, pricing and the full list of instance types are in the AWS documentation and the EC2 Nitro Sandboxes guide.