Hero image for Sandbox Your AI Agents: A 2026 Safety Checklist
By AI Tool Briefing Team

Sandbox Your AI Agents: A 2026 Safety Checklist


To sandbox AI coding agents, run every agent session in its own VM-level sandbox, with no cloud credentials, default-deny egress and external logging. The 10-point checklist below covers it.

We’ve spent most of 2026 documenting what happens when agents run loose. A reported 48,000-file deletion. A single hacker breaching 100+ companies with agents. A zero-click flaw across four coding tools. This post is the other half: the fix. And the newest piece of it is AWS Nitro Sandboxes, which gives each workload its own lightweight virtual machine.

If your team plans to hand agents real work in 2027, the question isn’t whether to sandbox AI coding agents. It’s which boundary you pick, and whether you’ve closed the holes around it.

Quick Verdict

OptionWhat you getBest for
Nitro SandboxesA child VM per pod, task or session, on your own EC2 instanceTeams already on AWS who want to run the infrastructure
Lambda MicroVMsIsolated execution with no instances to manageTeams who want zero infrastructure
AgentCore Code InterpreterManaged, containerized environment for agent-written code (not VM-grade by this post’s standard)Agents already built on Amazon Bedrock AgentCore, with lower-risk code
Plain containersShared host kernelTrusted code only. Not untrusted agents

Bottom line: If an agent writes and runs its own code, give every session its own VM-level boundary. Then fix the credentials, network and logging around it, because the sandbox alone won’t.

What is an AI agent sandbox?

An AI agent sandbox is an isolated environment where an agent’s generated code runs with its own filesystem, network rules and, ideally, its own operating system kernel. If the agent misbehaves, gets prompt-injected or runs a bad script, the damage stays inside the box instead of reaching your host, your credentials or other users’ sessions.

That last part matters. A container shares the host’s kernel. A virtual machine doesn’t. For code you wrote and reviewed, the difference is academic. For code a model improvised thirty seconds ago, it isn’t.

What AWS actually launched

Per AWS’s EC2 documentation, a Nitro Sandbox is a lightweight VM that runs alongside a parent EC2 instance, using vCPUs and memory the parent contributes. The Nitro System enforces the boundary. Reported launch coverage dates the announcement to around November 9, 2026; I haven’t matched that against AWS’s own announcement, so treat the date as approximate.

The AWS compute blog says the sandbox is separated from its parent, from other sandboxes and from AWS operators. Each one gets its own kernel. The docs add that code inside can’t read the parent’s memory and reaches it only through virtual devices.

Three ways to run them, per the docs: EKS runs each pod in its own sandbox, ECS does the same per task, and on a plain Amazon EC2 instance you launch them yourself with Firecracker. For agents that write and run code, the natural fit is one sandbox per session.

Cost. The docs say there’s no additional charge. You pay for the parent instance as usual. Flex instances (C7i-flex, M7i-flex and similar) aren’t supported, so check your instance family before you plan around it.

Confidential mode. This is the default, and it removes sandbox memory from the parent. Attestation lets AWS KMS release a key only to a verified sandbox image. The alternative, direct mode, lets the parent read sandbox memory. The docs say it’s for when the same trusted party runs both. For agents that touch customer data, you want confidential.

Where Nitro Sandboxes fall short

I like the design. I’d still read the limitations section before committing.

  • You need Nitro Enclaves enabled on the parent instance, and Firecracker is currently the only supported VMM.
  • No GPU passthrough, no snapshot/restore, no pause/resume, no live migration. Sessions that need to survive a restart need another plan.
  • Stopping the parent kills every sandbox on it.
  • Credential leakage through the parent. The docs warn that if the parent routes sandbox traffic (NAT, for example), a sandbox can reach the parent’s instance metadata service and read its IAM role credentials. IMDSv2 doesn’t stop this. AWS says to block traffic to 169.254.169.254 from sandboxes.
  • Noisy neighbors. One sandbox can exhaust shared network resources like the connection tracking table.

That IMDS item is the one I’d tape to a monitor. A hardware boundary with an open door to your IAM role isn’t a boundary.

How do you sandbox an AI coding agent? A 10-point checklist

Here’s the order I’d work through it. The first three decide whether the rest matters.

  1. One sandbox per session. Never share one between users or tenants. Destroy it when the session ends.
  2. Use VM-level isolation for untrusted code. Nitro Sandboxes or Lambda MicroVMs qualify. Containers alone don’t, and that includes AgentCore Code Interpreter, which AWS describes as a containerized environment.
  3. Give the sandbox no cloud credentials by default. No instance role reachable from inside. Block the metadata endpoint explicitly.
  4. Deny outbound network by default. Allow-list the package registries and APIs the job needs. Data exfiltration and callbacks both travel over egress.
  5. Hand secrets in per task, scoped and short-lived. Where you can, release keys only to an attested sandbox via KMS.
  6. Mount only the repo the agent needs. Read-only where possible. Keep production data and your .git history out of reach, or backed up elsewhere.
  7. Cap CPU, memory, runtime and spend. A runaway loop should hit a wall, not your bill.
  8. Log every command and file write outside the sandbox. If the logs live inside, a compromised agent can edit them.
  9. Put a human gate on anything that leaves the box: merges, deploys, emails, payments.
  10. Rehearse the failure. Kill a sandbox mid-task and confirm nothing important was lost, and that you can tell what it did.

The other AWS options

Nitro Sandboxes are for teams that want to run the machinery. AWS’s own docs lay out the choice: if you want none of it, use Lambda MicroVMs. If you want your instance with AWS enforcing the boundary between workloads, use Nitro Sandboxes. Lambda MicroVMs launched in June 2026 and AWS documents them as a sandbox provider for Claude Managed Agents.

AgentCore Code Interpreter is the managed route for agents built on Amazon Bedrock AgentCore. AWS describes a containerized environment with a limited-network “sandbox” mode and a public-network mode. I haven’t found AWS documentation of microVM isolation for it, so by this post’s own standard it’s a convenience layer, not a VM-grade boundary. Read which mode you’ve enabled, because the second one is exactly the egress hole from checklist item 4.

What about non-AWS shops?

The principle travels even if the product doesn’t. Any VM-grade boundary per session (Firecracker microVMs, gVisor-style user-space kernels, or a vendor’s hosted sandbox) beats a shared-kernel container for untrusted code. I haven’t compared those against Nitro Sandboxes here, so I won’t rank them.

On the vendor side, Anthropic’s self-hosted Claude Code environments move sessions onto your own compute. That’s useful, but as we argued then, moving an agent onto your servers doesn’t contain it. The sandbox does.

Why this is urgent, not optional

Defaults are moving the wrong way. Claude Code’s auto mode stopped asking before running commands for Pro, Max and Team accounts. Banks are already reacting: Bloomberg reported that Goldman Sachs restricted some AI coding tools for bankers and traders, as we covered. Fewer permission prompts means the boundary has to live somewhere else.

Our take: the permission prompt was never a security control. It was a speed bump. A sandbox is the first thing in this stack that still holds when the model is wrong, or the plugin, or the prompt.

What a sandbox won’t fix

It won’t stop an agent from doing something stupid with the access you gave it. If you mount your production database credentials into a perfectly isolated VM, the VM will isolate that mistake beautifully.

It also won’t fix a poisoned prompt that convinces the agent to send legitimate data through your allowed egress. That’s why items 4, 8 and 9 exist.

Frequently Asked Questions

Are containers enough to sandbox AI agents? For untrusted, model-generated code, I’d say no. Containers share the host kernel, so a kernel-level escape reaches everything on the machine. Use a VM-level boundary.

Do Nitro Sandboxes cost extra? AWS’s documentation says no additional charge. You pay for the parent EC2 instance and other services you use. Flex instance types aren’t supported.

Can the sandbox be hidden from AWS operators and from my own admins? In confidential mode, per the docs, neither the parent instance nor its administrators can read sandbox memory. Direct mode doesn’t offer that.

Can an agent in a Nitro Sandbox use a GPU? Not currently. The docs list GPU passthrough as unavailable.

Which AWS option should I start with? Lambda MicroVMs if you want no infrastructure. AgentCore Code Interpreter if you’re already on AgentCore and the code is lower-risk, since it’s containerized rather than VM-grade. Nitro Sandboxes if you run your own instances and want control.

What’s the biggest mistake teams make? Isolating the code and leaving the credentials reachable. Check the metadata endpoint first.

The Bottom Line

Pick one boundary, make it per-session, and strip it of credentials, egress and write access it doesn’t need. Do that before your 2027 rollout, not after your first incident. For background on what agents are and how they work, start with our agents explainer.


Last updated: Nov 29 2026. Sources: AWS EC2 Nitro Sandboxes docs, AWS Compute Blog, AWS Lambda MicroVMs announcement, AgentCore Code Interpreter docs.