Blog · AI Governance

AI Agent Sandboxing: 4 Runtime Choices, Controls Beyond Isolation

AETHER Pulse·14 October 2026·9 min read

AI Agent Sandboxing: 4 Runtime Choices, Controls Beyond Isolation

Engineer testing an AI agent sandbox

For high-assurance agent execution, consider Kata Containers for stronger isolation and gVisor for lower-latency sandboxes. No sandbox is sufficient alone: you also need short-lived agent identity, credential proxying, and hardened egress. Kubernetes RuntimeClass lets operators select a sandboxed runtime for a pod.


TL;DR:

  • Kata Containers uses a guest kernel for stronger isolation, while gVisor narrows syscall exposure but still reaches the host kernel; test compatibility and latency.
  • Give runs short lived identities tied to run IDs, broker credentials at call time, and validate hostnames and source addresses at egress.
  • On Kubernetes, use RuntimeClass with node selectors for prepared sandbox nodes, then cap CPU, memory, and ephemeral storage to contain runaway workloads.
  • Run syscall compatibility, network bypass, credential lifecycle, and kernel escape tests in CI, repeating them after runtime or kernel upgrades.
  • Record each run’s identity binding, image digest, policy version, and event traces with tamper safeguards so reviewers can reconstruct agent actions.

Table of Contents

What is AI agent sandboxing, and what are you defending against?

A sandbox for AI agents is an ephemeral, isolated execution environment with controlled interfaces and a stable, auditable identity. A sandbox can let an agent run code, access files, and use network resources under configured controls. LangChain's documentation describes sandboxes as a security control with deny-by-default rules until explicit grants are configured.

The threats you design against fall into four groups:

  • Kernel escape: untrusted code reaches the host kernel and breaks out of its container.
  • Network bypass: DNS spoofing or IP sharing defeats egress policy.
  • Runtime escape: the agent attacks the language interpreter to reach builtins it should not have.
  • Credential exposure: secrets available to an agent may be at risk if the sandbox is compromised.

Your security goals follow from that list: least privilege, auditable identity, deterministic evidence, and defense in depth. Treat the sandbox as one layer. The surrounding plumbing, such as local APIs, metadata services, and shared host directories, is where practitioner guidance in the Agent Governance Toolkit says naive boundaries tend to fail.

How do microVMs, gVisor, hardened containers, and WASM compare?

Pick by isolation boundary first, then syscall compatibility, then cold-start and density cost. A trade study of Kata Containers and gVisor describes the core split: Kata uses a hardware VM with its own guest kernel, while gVisor implements a user-space kernel with a smaller syscall surface that still reaches the host kernel.

  • MicroVMs (such as Kata): a VM-level kernel boundary provides stronger isolation than gVisor, with performance trade-offs to consider. Consider them for workloads where stronger isolation is a priority.
  • gVisor (user-space kernel): its Sentry implements a user-space kernel with a smaller syscall surface than a hardware VM approach. The host kernel is still reachable, so consider the trade-offs between isolation and performance for your workload.
  • Hardened containers: assess their isolation and compatibility against your workload and threat model before choosing them.
  • WASM runtimes: consider them when the workload can be adapted to run under WASM.

Evaluate runtime compatibility and operational trade-offs through testing before choosing a sandbox.

Which controls matter beyond isolation?

Isolation protects the host from the agent. These controls protect everything the agent is allowed to reach. NIST's concept paper on agent identity and authorization warns that agents create distinct identity challenges and recommends treating them as constrained, auditable actors with unique, short-lived identities instead of reusing human or developer credentials.

  1. Issue a short-lived identity per agent run. Bind it to the run ID and log that binding so every action traces back to one sandbox instance.
  2. Proxy credentials through a broker. Run a broker or on-host proxy that injects tokens at call time. Never bake long-lived secrets into the sandbox image or environment.
  3. Harden the egress gateway. Consider egress controls such as domain-validated proxies and source-address validation. Empirical tests found that DNS spoofing and IP-sharing attacks bypassed network isolation unless gateways validated source addresses and enforced hostname-level verification.
  4. Apply filesystem and mount policy. Use read-only overlays, avoid shared host paths, and expose a minimal set of devices. ClawBase's write-up on permission-aware file access covers pre-action file controls in more depth.
  5. Harden the language runtime. Block dynamic package installs and lock down builtins. In Python, sandbox escapes often target the interpreter, for example through exception frame traversal that exposes builtins and lets code call exec.

Pro Tip: Route secret access through a credential broker, and scope credentials to the agent's run.

How do you wire this into Kubernetes?

Kubernetes RuntimeClass is the practical hinge. Setting runtimeClassName in the pod spec selects a handler such as kata, runsc (gVisor), or a WASM shim, and documented k3s patterns pair it with nodeSelectors for sandbox nodes and containerd handler configuration.

  • Select the runtime per pod: define one RuntimeClass per handler and schedule onto nodes prepared for it, so a pod never lands where its runtime is missing.
  • Size warm pools deliberately: keep a small pool of pre-booted microVMs to hide cold-start latency, and size it against the memory each idle VM holds. Too small and latency returns; too large and you pay for idle capacity.
  • Label nodes and constrain scheduling: dedicate sandbox nodes with labels and taints, and keep general workloads off them. This also shrinks the attack surface on those hosts.
  • Bound the blast radius: set resource quotas, ephemeral storage limits, and CPU and memory limits on every sandbox pod, so a runaway or hostile agent exhausts its own budget, not the node's.

A pod spec can pair runtimeClassName with a nodeSelector for the sandbox pool and other controls suited to your environment. Test syscall compatibility against the chosen runtime before production, not after.

How do you test that the sandbox actually holds?

Test the sandbox with a playbook, and consider running those tests in CI:

  1. Run syscall compatibility suites early. Catch gVisor and WASM gaps before agents hit them in production.
  2. Fuzz inputs and network paths. Feed malformed tool inputs and unusual network behavior into the sandbox, and wire the fuzzers into CI so regressions fail the build.
  3. Run red-team scenarios. Attempt kernel-escape techniques, DNS spoofing, and IP-sharing bypasses against your egress gateway, since those were the paths that succeeded in published bypass tests.
  4. Automate lifecycle tests. Cover warm-pool creation and teardown, and test how the credential broker handles expired or replayed identities.
  5. Re-run on every runtime or kernel upgrade. An isolation boundary can shift when a handler or host kernel changes.

What evidence should a sandbox run leave behind?

Collect enough that a reviewer can reconstruct what an agent did without trusting the agent.

  • Audit records per run: consider recording identity binding, image digest, policy version, and provenance metadata, with safeguards against tampering.
  • Telemetry: consider collecting traces and event records to support forensics.
  • Retention and tamper-evidence: set retention to match your compliance needs, and align records with your incident response playbooks. We cover logging obligations in our guide to audit evidence without customer data.
  • SLOs and alerting: define expected behavior, such as egress volume and tool-call rates, and alert on anomalies.

What do standards and research say?

The recommendations above rest on a small body of guidance. NIST's concept paper argues agents need distinct identity and authorization controls. The Agent Governance Toolkit documents policy-as-code, sandboxing primitives, signed audit, and operational controls. On isolation, the Kata and gVisor trade study finds VM-based microVMs give stronger isolation at higher overhead, while gVisor narrows syscall exposure but still shares the host kernel. Empirical bypass results show that egress policy fails without gateway hardening. We map this guidance to evidence in our NIST-to-evidence reporting piece.

MicroVM and gVisor isolation tradeoffs

Where should a team start?

Start with identity, credential proxying, and egress gateway hardening, because they limit damage under any runtime. Add VM-level isolation for workloads with a high blast radius or regulatory exposure. Instrument for evidence early: retrofitting audit trails after an incident is far more expensive than emitting them from the first run.

— Eleye

Where does agentless governance fit alongside sandboxes?

Sandboxes control what an agent can do at runtime. They do not tell a risk or compliance team which agents exist, who they act as, or what evidence proves oversight. Aetherpulse

AETHER Pulse is presented as a complement to runtime controls for teams seeking agent governance and audit evidence. If you need audit-readiness or regulator reporting next to your runtime controls, explore our plans, or talk to us about a design-partner engagement or an Article 26 readiness audit on our pricing page.

Where does agentless governance fit alongside sandboxes? — overview diagram

FAQ

How do you build a sandbox for an AI agent?

Pick an isolation boundary, such as a microVM or gVisor, and run the agent in an ephemeral environment with deny-by-default network and file access. Add a short-lived identity, a credential broker, and a hardened egress gateway. In Kubernetes, select the runtime through RuntimeClass.

Is ChatGPT an AI agent?

A chat model alone responds to prompts. It becomes an agent when it is wired to tools and can plan and act, such as running code or calling APIs. That tool access is exactly why sandboxing matters.

Which open source runtimes can sandbox AI agents?

Kata Containers and gVisor are the common open source choices for isolating agent workloads, and both integrate with Kubernetes through RuntimeClass, as this k3s guide shows. WASM runtimes are a third option when you can adapt the workload.

Is isolation enough to keep an agent contained?

No. Surrounding plumbing such as metadata services and shared directories can let an agent escalate or exfiltrate data, as the Agent Governance Toolkit notes. Pair isolation with identity, credential, and egress controls.

Sources

Recommended

Working on Article 26 readiness, deployer-side governance evidence, or AI agent risk at a regulated firm? We'd value 15 minutes of your perspective.

Start a conversation