Hosting AI Agent Workers: EKS vs ECS vs Sandboxes

Comparison of ways to host AI agent workers on EKS, ECS and sandboxes

Running coding agents in volume soon outgrows a couple of personal computers, and a November 24 comparison looks at how to host AI agent workers in the cloud. It sets Amazon’s EKS and ECS against plain servers and hosted sandboxes, and the main fork is between long-lived machines and a throwaway sandbox for each job.

Why pulling work keeps networking simple

In the design under review, a worker calls out to a central service to lease a job, clones code from GitHub and sends results back. Nobody calls in. A worker can therefore live behind NAT, in a private subnet or in a sandbox with no public IP, and there are no load balancers or open ports to manage. Remaining decisions concern compute, isolation, state and credentials.

Two trays of square tiles sit beside five individual enclosures, with a tilted copper-striped tile between them.
Image: Ryan X. Charles

Shared machines or one sandbox per job

A long-lived machine hosts several workers that share caches and tooling. Each job has its own git worktree, but all of them compete for the same CPU, memory and network. A per-job sandbox is created for one task and deleted after.

  • Cost: an idle server costs as much as a busy one, so shared machines win when kept full. Sandboxes track usage, which suits bursty queues.
  • Isolation: a worktree separates files but not processes, so one runaway build can disturb its neighbors, and every job can see the machine’s credentials.
  • Speed: shared machines start instantly. Sandboxes must boot and fetch images unless snapshots or warm pools are prepared.
  • Heavy tests: large machines cope with compilation and headless Chrome. Small sandboxes can run out of memory.

Either approach works with pull-based workers. The sandbox variant simply needs a launcher that notices queued jobs and starts one sandbox for each.

Two trays of square tiles sit beside five individual enclosures, with a tilted copper-striped tile between them.
Image: Ryan X. Charles

Credentials and subscription rules

Teams running agents at scale tend to prefer flat-fee plans of around $200 a month over per-token API prices. For Claude Code, a setup command issues a year-long OAuth token for paid plans. If an API key is also set, it wins, so a worker can drift onto API billing unnoticed. Codex offers a beta device-code login or a copied auth file that OpenAI says to guard like a password.

Shared machines keep sign-ins on disk and refresh them in place, but every job sits beside every credential. Sandboxes receive a credential at startup and refresh it somewhere that disappears, so the master copy has to be stored elsewhere. In return, each job sees one credential only.

Terms also matter if you plan to host AI agent workers on subscriptions. Anthropic’s consumer terms bar account sharing and automated access without an API key or explicit permission, and OpenAI also prohibits sharing logins. The author found no wording that allows a firm to run many personal subscriptions as an unattended fleet. Team and enterprise plans are the sanctioned route.

EKS: flexible, with the most upkeep

The Kubernetes agent-sandbox project adds a Sandbox resource with templates, claims and warm pools. Version 1.0.12 came out on November 20, but the API remains v1beta1. Pausing a sandbox keeps its disks and drops running memory unless pod snapshots are added, which the project demonstrates only on Google’s GKE.

Strong isolation can need special hardware. Running Kata with Firecracker required bare-metal EC2 until February 2026, while gVisor works on regular nodes. The control plane costs $0.10 an hour, about $73 monthly.

People cost more. Qovery, a vendor of Kubernetes tooling, estimates 20 to 60 engineer-hours monthly for self-managed EKS versus 2 to 5 on Fargate, though those are projections. Emergent says it operates over 30,000 simultaneous agent environments as ordinary pods. For anyone wanting to host AI agent workers on Kubernetes, the gain is bin-packing and both shapes on one platform.

ECS and Fargate: easy, but with limits

ECS has no control-plane charge. Fargate isolates each task in its own Firecracker microVM, which makes it the least effortful way to get a sandbox per job on AWS.

Limits apply. Tasks reach 32 vCPU and 244 GB of memory with 200 GiB of scratch disk. No privileged containers or GPUs are allowed, so tests that need Docker fail unchanged.

It also costs more at steady load. A 4 vCPU, 16 GB task for a month is near $170 in us-east-1, against about $147 for a similar EC2 instance, a gap of 14% to 16% before discounts. ECS on EC2 narrows it.

Bedrock AgentCore Runtime gives every session a microVM lasting up to 8 hours and bills CPU at $0.0895 per vCPU-hour except while waiting on I/O, which favors agents that mostly wait for a model.

Questions to settle before picking a platform

Prices move fast, and the review notes a budget provider raised rates several times this year. Before choosing where to host AI agent workers, teams should check how full their machines stay, whether jobs need Docker and how each worker will receive its credential. Those answers point to shared boxes, Fargate or Kubernetes better than a price table does.

Source: Ryan X. Charles

Written by

Saksham Bhargava

Saksham Bhargava runs Alteroid and has been writing about consumer technology for over five years, covering iPhone, Android, Windows, AI tools and gaming. With an MCA and six years of hands-on web development experience, he tests the features he writes about on his own devices and focuses on clear, practical guides that solve real problems. Away from the screen, he enjoys travelling to places most tourists skip.