AI code-execution sandbox

AWS Fargate

AWS Fargate is serverless container compute for ECS and EKS that runs each task in a Firecracker microVM, a general-purpose primitive teams use to isolate untrusted or agent-generated code, priced at $0.04048 per vCPU-hour and $0.004445 per GB-hour (Linux/x86, US East).

Last verified 2026-08-10

Fargate is not marketed as an agent sandbox, but it is the same Firecracker microVM technology that purpose-built sandboxes (E2B, CodeSandbox) sit on, exposed directly as serverless containers. Teams already on AWS use it to run untrusted or model-generated code with hardware-level isolation and no servers to manage. It bills per second (1-minute minimum) on independently configurable vCPU and memory, ships 20 GB of ephemeral storage per task by default (EFS for persistence), and is cheaper on ARM/Graviton ($0.03238/vCPU-hour) or Fargate Spot (up to about 70% off). The trade-offs versus a purpose-built sandbox: task startup is measured in tens of seconds rather than sub-second, there is no GPU support, and there is no agent SDK or MCP endpoint, so more assembly is required. AWS's purpose-built alternative for agent code execution is Bedrock AgentCore Code Interpreter.

Key specs

IsolationFirecracker microVM
Price / vCPU-hr$0.04048
Pricing modelPer-second (vCPU + GB), 1-min minimum
GPUNo
Session limitLong-running tasks
Persistence20 GB ephemeral storage default (configurable); EFS for persistence
Languagesany
MCP supportn/a
IntegrationsAWS SDK, ECS/EKS API
DeploymentManaged cloud (AWS regions)
Free tierNo free tier
vCPU rate (Linux/x86)$0.04048/vCPU-hr
ARM rate$0.03238/vCPU-hr
Ephemeral storage20 GB default
IsolationFirecracker microVM

Strengths

  • Firecracker microVM isolation
  • Per-second billing, 1-minute minimum
  • Cheaper on ARM/Graviton ($0.03238/vCPU-hr) and Spot (up to ~70% off)
  • Integrates with existing AWS/ECS/EKS

Trade-offs

  • Not purpose-built for agents (no agent SDK, no MCP)
  • Task startup in tens of seconds, not sub-second
  • No GPU support
  • AWS-only, more assembly than a managed sandbox

Best for: Teams already on AWS/ECS/EKS wanting Firecracker-isolated container compute for longer-running or untrusted workloads.

Alternatives to AWS Fargate

See the full AWS Fargate alternatives comparison →

Sources: AWS Fargate pricing ↗ · Firecracker: lightweight virtualization (powers Fargate) ↗

Is AWS Fargate right for your workload?

Tell us your use case and we'll confirm the fit, flag anything to watch for, and get you real pricing from the AWS Fargate team. No spam.