Platforms for Running AI-Generated Code in Isolated Environments
The isolation mechanism you choose sets both your security boundary and performance ceiling.

Choosing a platform for running AI-generated code comes down to one question beneath all the others: which isolation mechanism sits between that code and the rest of the system, because that mechanism is what actually produces the security boundary and the performance ceiling everything else works within. The security model that actually holds up here runs on zero-trust principles: every action an agent takes has to be explicitly permitted, not assumed safe until it's proven otherwise. SDKs, pricing tiers, and integration catalogs matter for day-to-day developer experience, but they sit on top of something more fundamental: the isolation mechanism that defines the actual security boundary and sets the performance ceiling everything else has to work within. Three families of isolation technology compete to be that boundary: microVMs, gVisor, and hardened or namespaced containers, and the rest of this piece builds outward from how each one actually works.
Isolation mechanisms
Standard containers are built on a common container runtime and its open packaging spec, and they rely on Linux namespaces and cgroups to separate processes while still sharing the host kernel underneath. Containers remain a reasonable choice for trusted, vetted code running in single-tenant environments, but they were never built to hold untrusted, AI-generated code safely in a multi-tenant setting, and stretching them to do so asks more of shared-kernel isolation than it can deliver.
gVisor takes a different approach by inserting a user-space kernel, a process called the Sentry, between the application and the host kernel. Hundreds of system calls could reach the host directly, but gVisor intercepts them and only lets a minimal, vetted subset through. Boot time stays in the low milliseconds because there's no guest kernel to start up, so you get a syscall-level isolation boundary that's meaningfully stronger than a shared-kernel container but still short of a full virtual machine. That profile makes gVisor a good match for compute-heavy AI workloads, where full VM isolation feels like overkill but you still need broad Linux API compatibility, so you see it in multi-tenant SaaS products and CI/CD pipelines where many jobs from different customers run side by side.
Firecracker microVMs push isolation a step further by giving each workload its own Linux kernel running inside KVM, with minimal device emulation to keep things lightweight. Boot time runs around 125 milliseconds, and because each workload gets a dedicated kernel, an attacker who wants to reach another tenant's data has to escape both the guest kernel and the hypervisor, not just a shared kernel namespace. Kata Containers extend this idea into Kubernetes: Kata orchestrates VMMs like Firecracker, Cloud Hypervisor, or QEMU, so that from the orchestrator's point of view each workload looks like an ordinary container, while underneath it is a full virtual machine with its own kernel. Boot time runs around 200 milliseconds. The combination suits regulated industries and multi-tenant Kubernetes environments that want VM-level security without giving up container-style workflows.
V8 isolates and WebAssembly are at the opposite end of the spectrum, built for simple, high-frequency tool calls like API requests, data transformation, and validation at very large scale. The CNCF security whitepaper makes the general point that for an untrusted workload running in a multi-tenant environment, a VM-based sandbox deserves consideration, and that's precisely the threat model AI agents introduce by design. Across all four approaches, isolation strength and startup speed move in close to opposite directions: the stronger the boundary, the more milliseconds it tends to cost at launch, and that tension is why no single mechanism wins outright before a workload is even specified.
What the isolation choice costs in latency
Startup latency isn't a cosmetic detail buried in a benchmark table. For an interactive agent product, or for any workload making high-frequency tool calls, the time a sandbox takes to spin up can decide whether the product feels responsive or whether it feels broken. These numbers describe cold starts, when a sandbox gets built from nothing, but cold starts tell only part of the story.
Snapshot-based startup changes the picture substantially. The result: a P75 cold start of 1.9 to 2.0 seconds for container images between 200MB and 2GB, compared with 5.4 to 30 seconds under the prior approach. So the underlying isolation mechanism's raw latency works as a ceiling, not a fixed floor. Engineering effort applied to snapshotting and resuming can push effective startup time down by an order of magnitude, so a comparison that stops at cold-start milliseconds alone will overstate how far apart two platforms actually are in practice.
What matters is matching the benchmark to the workload. If a tool-call sandbox spins up fresh for every single invocation, cold start is what matters most, because you pay that cost repeatedly, on every call, not just once. Which number to chase depends on how the agent actually behaves in session, and that behavior is the subject of the next section.
How workload type should drive isolation selection
You need to classify a workload clearly before you compare platforms, because the isolation technology that fits a short-lived data-transformation call is rarely the one that fits a multi-hour coding session. Session duration and statefulness form the first axis worth sorting by. Ephemeral, per-invocation sandboxes suit isolated code execution, quick tests, and short analysis jobs, spinning up and getting discarded without needing to remember anything. If a PR review agent fires a few times throughout the day, it cannot afford to clone an entire repository from scratch on every single invocation. That cold-start cost compounds with each call and turns a cheap operation into an expensive one over the course of a day.
Concurrency and scale form a second axis. One might argue that WASM's limitations are a minor inconvenience, easily worked around, but any workload that needs Python, shell access, or filesystem interaction simply disqualifies V8 isolates and WASM outright, no workaround changes that.
Tenant model and trust level form a fourth axis. Compliance and governance requirements form the last axis, and they can override every other consideration: regulated industries like healthcare, finance, and government impose constraints that can disqualify a platform outright if it can't demonstrate the right certifications or data-residency controls. Running through these five axes before opening a single vendor comparison saves the work of evaluating platforms that were never going to fit the workload.
Platform profiles: what each option provides at the isolation and infrastructure layer
AWS Bedrock AgentCore became generally available with its next-generation Runtime in September 2026. Isolation runs on per-session Firecracker microVMs, giving each session a dedicated kernel. Around that core sit a Gateway component that turns APIs, Lambda functions, and MCP servers into agent-ready tools, an Identity layer with OAuth 2.0 and integrations for Okta and Entra ID, and a Code Interpreter for sandboxed execution. Bedrock Guardrails, added in June 2026, evaluates outputs at the gateway layer for prompt injection attempts, harmful content, and sensitive data exposure. One real constraint: a session's microVM has a maximum lifetime of 8 hours, so sessions persist but the underlying compute has to be reprovisioned past that window. On compliance, AgentCore holds ISO/IEC 27001, 27017, 27018, and 27701, HITRUST, IRAP, HIPAA eligibility, and FedRAMP authorization at both Class C and Class D, with availability in AWS GovCloud. For GDPR, it runs in Frankfurt, Ireland, London, Paris, and Stockholm, keeping data in the EU with correct region pinning and storing execution traces in CloudWatch within the same region. Teams new to AWS IAM should expect a heavier initial setup, the cost of the governance depth on offer.
Northflank runs production sandbox infrastructure on Kata Containers and gVisor, giving teams a choice of isolation tier depending on the workload. Its defense-in-depth model layers isolation boundaries, resource limits, network controls, permission scoping, and monitoring together, and it fits teams already running on Kubernetes who want VM-level security without giving up container-style workflows, including regulated multi-tenant environments.
Cloudflare's Sandbox SDK runs on microVMs and Linux containers for VM-level isolation, but it inherits the same language constraint as V8 isolates: it fits JavaScript and TypeScript workloads well, while Python or shell-dependent agents won't fit the model. It's a strong match for JavaScript-native tool calls, API transformation, and data validation at edge scale, particularly for teams already on Cloudflare Workers.
One platform in this space runs on microVMs inspired by the technology behind AWS Lambda, giving each workload hardware-enforced, kernel-level separation. The product stack spans Agents Hosting, Batch Jobs, MCP Servers Hosting, and a Model Gateway for routing and cost control across LLMs, with custom templates and Volumes providing long-term persistent storage separate from standby state, plus custom domains, outbound proxy routing, and static IPs in private preview.
A separate category of purpose-built infrastructure runs each workload in a fully separated, isolated environment, provisions sandboxes in under 25 milliseconds, and holds SOC 2, HIPAA, and ISO 27001 certification, with a HIPAA BAA available as a paid add-on. Its customers tend to be AI-native startups and teams building agents that execute AI-generated code directly, and if you need fast provisioning, indefinitely stateful agents, and enterprise compliance, you get that without retrofitting tooling built for human developers onto a production agent workload.
Statefulness as a first-class infrastructure requirement, not an afterthought
An agent that forgets everything between calls isn't really a stateful agent at all, it's a stateless function that has to rebuild its entire context from zero every time it runs, and that rebuilding breaks multi-step and long-horizon work before it can get started. What does statefulness actually demand at the infrastructure layer? A persistent filesystem across sessions, so installed packages, intermediate files, and cloned repositories survive between invocations. Memory state that can be suspended and resumed without a full reinitialization. An agent can snapshot and restore its state to pick up where it left off.
The rise of multi-agent systems makes this demand sharper. Consider AgentCore's 8-hour session limit on its Firecracker microVMs: sessions persist, but the compute underneath has to be reprovisioned once that window closes. The platform is stateful only within a bounded window. One might ask: has your team actually confirmed whether its chosen platform's persistence is bounded or indefinite, or is that an assumption nobody has tested yet?
How enterprise compliance requirements interact with isolation architecture
Compliance now functions as a procurement gate for regulated enterprises evaluating agent infrastructure, not a checklist to work through after a platform is already live.
Isolation architecture and compliance interact directly, not as separate evaluation tracks, because the platform's topology determines which frameworks it can even attempt to satisfy. The managed-payments capability AgentCore introduced, letting agents autonomously pay for APIs and services with session-level spending limits, opens a new compliance surface on its own: autonomous financial transactions by an agent may trigger regulatory obligations that vary by jurisdiction and transaction type, and those obligations sit well outside the EU AI Act's enforcement framework for high-risk AI systems, which itself carries substantial penalties proportional to a company's global revenue for serious violations.
The strongest objection to microVM isolation
The case for microVMs as the default choice for multi-tenant AI agents has a real weak point, and you should take it seriously. For high-frequency, short-duration tool calls, VM startup overhead, even at a modest 125 milliseconds, compounds across thousands of calls into latency that can change a product's unit economics. You might think a few hundred milliseconds here and there shouldn't matter much, but multiply that by every tool invocation in a high-volume pipeline and the number stops looking trivial.
V8 isolates are a legitimate alternative under a specific, narrow set of conditions: the workload is JavaScript or TypeScript only, the tasks are simple, things like API requests, data transformation, and validation, the scale is large enough that per-call latency is the binding constraint, and the platform already runs on an edge network like Cloudflare Workers, where sub-millisecond isolate startup gets architecturally exploited.
But that counter-argument has a ceiling of its own. And the security gap between V8 isolates and microVMs matters most in multi-tenant environments, where a misconfiguration or a zero-day in the JavaScript engine could expose one tenant's data to another, so this is a real operational risk for any platform serving many customers on shared infrastructure.
The honest reading: V8 isolates win for JavaScript-native, high-frequency, edge-deployed tool calls, and microVMs win for nearly everything else an AI agent workload commonly needs. What should decide the question isn't a vendor's marketing position but the architecture of the agent itself, which loops back to the workload classification laid out earlier: trust level, runtime needs, and tenant model, not a general preference for one mechanism over another.
Using isolation type as the first filter when shortlisting platforms
Isolation mechanism isn't one line item among many on a comparison spreadsheet, it's the first filter, because it sets the outer bounds on security, latency, and workload compatibility before any other feature gets evaluated. A practical sequence follows from everything laid out above.
Step one classifies the workload by trust level and runtime needs. JavaScript-only, high-frequency, edge-deployed tool calls make V8 isolates a valid and genuinely faster choice.
Step three applies compliance requirements as a hard filter, not a late-stage check. Regulated data in healthcare, finance, or government calls for confirming specific certifications, HIPAA eligibility, FedRAMP, SOC 2 Type II, before evaluation even begins, not after a platform has already been selected.
Step four evaluates operational fit last. Configuration overhead is a genuine cost for teams unfamiliar with IAM-heavy platforms, and it belongs in the actual time-to-production estimate rather than getting left out in favor of comparing per-unit compute prices alone.
What falls out of working through these four steps in order is a simple observation: infrastructure purpose-built for AI-generated code, designed from the ground up for this threat model rather than adapted from developer tooling or general-purpose serverless compute, tends to satisfy more of these filters by default. This is a structural consequence of where the defaults were set in the first place: built for the agent threat model from day one.


