# Best platforms for long-running AI agents (2026): Archil, Modal, E2B, Daytona, AWS and more

Source: https://archil.com/compare/best-platforms-for-long-running-ai-agents

Where to run an AI agent that works for hours, compared: Archil sandboxes and serverless tool calls, Modal, E2B, Daytona, Northflank, Fly.io, AWS Lambda and Fargate, and Vercel. Run limits, pause and resume, billing and GPUs, from each vendor's docs.

[All comparisons](https://archil.com/compare)

# Best platforms for long-running AI agents (2026)

The best platforms for long-running AI agents keep the agent's state when compute stops, either by pausing a sandbox with its memory or by keeping the workspace on storage that any machine can pick up. Archil does both: tool calls run as serverless commands against a persistent disk, and Firecracker sandboxes pause with memory and processes intact, so compute bills only while the agent works. Pick Modal when the agent needs GPUs, E2B or Daytona for an established sandbox API, and AWS Lambda durable functions, Step Functions or Fargate when everything has to stay in your AWS account.

Updated November 2026. Competitor facts are from each vendor's own docs and pricing pages.

## The short list

1.  [Archil](#archil): Best for agents that work for hours in bursts, where state must outlive every machine and idle time shouldn't bill
2.  [Modal](#modal): Best for agents that need GPUs, or that mix agent sandboxes with inference and training in one platform
3.  [E2B](#e2b): Best for agents that pause between user turns and must resume with exactly the same memory and files
4.  [Daytona](#daytona): Best for long-lived development environments that stop when idle and come back with their files
5.  [Northflank](#northflank): Best for teams that want agents, services and databases on one platform, in Northflank's cloud or their own
6.  [Fly.io Machines](#fly-io-machines): Best for agents that run as ordinary long-lived processes close to users, in many regions
7.  [AWS Lambda and Fargate](#aws-lambda-and-fargate): Best for teams that must keep agent compute inside their AWS account and already run on Lambda or ECS
8.  [Vercel](#vercel): Best for agents built into a Vercel app, with short tool calls and occasional sandboxes

## Side by side

| Platform | Longest single run | Pause and resume | Kept after a stop | Billing basis | GPUs |
| --- | --- | --- | --- | --- | --- |
| Archil | Sandbox session 24 h, then it pauses; tool calls 5 min each | Yes, with memory and processes | Root filesystem and mounted disks | Sandboxes per vCPU-hour and GiB-hour while running; tool calls per 1,000 | Not offered |
| Modal | Functions 24 h; Sandboxes 5 min by default, up to 24 h | Memory snapshots (alpha) restore into a new sandbox | Volumes; filesystem snapshots | Per second for CPU and memory | Yes |
| E2B | 1 h per session on Hobby, 24 h on Pro | Yes, filesystem and memory | Paused sandboxes, with no expiry | Per vCPU-second and GiB-second | Not documented |
| Daytona | No limit unless you set one; stops after 15 min idle by default | VM sandboxes, with memory | Filesystem; volumes | Per second for vCPU, memory and storage | Yes, in ephemeral GPU sandboxes |
| Northflank | No limit stated for sandboxes | Pause scales to zero; ephemeral storage is lost | Volumes | Per second for vCPU and memory | Yes |
| Fly.io Machines | No limit stated | Suspend with memory, recommended for 2 GB or less | Root filesystem and volumes | Per second while running | Yes; Fly says it is scaling back GPU plans |
| AWS Lambda and Fargate | Lambda 30 min; durable functions up to 1 year; Lambda MicroVMs 8 h; Fargate no limit stated | Durable functions suspend during waits; MicroVMs suspend with memory and disk | EFS or S3 Files mounts; EBS or EFS on Fargate | Lambda per request and GB-second; Fargate per second, 1 min minimum | Not on Fargate |
| Vercel | Functions 300 s (Hobby), 800 s (Pro); Sandbox 45 min (Hobby), 24 h (Pro) per session | Sandboxes restore the filesystem, not memory | Persistent sandbox filesystem; Drives | Active CPU time plus memory | Not documented |

## What to look for

-   ### How long one run can last
    
    Limits range from minutes to a day. AWS Lambda stops a function at 30 minutes; Vercel Functions at 300 s on Hobby and 800 s on Pro. Modal Functions, E2B Pro sandboxes, Vercel Sandbox on Pro and Archil sandboxes allow sessions of up to 24 hours. An agent that runs longer needs a way to stop and pick up where it left off.
    
-   ### What survives when compute stops
    
    Some platforms pause a VM with memory and running processes (Archil, E2B, Daytona VM sandboxes, Fly.io Machines). Others keep only the filesystem (Vercel Sandbox, Daytona container sandboxes), or nothing unless you attach a volume (Northflank, Fargate, Cloudflare Sandbox).
    
-   ### What you pay while the agent waits
    
    Most of an agent's wall-clock time is spent waiting on the model. A sandbox that stays up between tool calls bills for that wait. Per-call execution, or a sandbox that pauses when idle, doesn't.
    
-   ### Where the loop runs and where tools run
    
    The agent loop can live in your backend or a durable workflow engine, and only the tool calls need an isolated machine. See [two places to run an agent](https://archil.com/guides/building-agents/two-places-to-run-an-agent).
    
-   ### Isolation and hardware
    
    Agent-written code should run in a VM boundary (Firecracker or gVisor), not a shared-kernel container. Check GPU support if the agent trains or serves models.
    

## Each option in detail

### 1. Archil

[docs.archil.com](https://docs.archil.com/compute/sandboxes/introduction)

**Best for:** agents that work for hours in bursts, where state must outlive every machine and idle time shouldn't bill

Archil gives an agent two ways to run code, both on the same [durable disk](https://archil.com/product/filesystem). [Serverless tool calls](https://archil.com/product/tool-calling) run one command in a fresh Firecracker microVM with the disk mounted and bill per call, so nothing runs between turns. [Persistent sandboxes](https://archil.com/product/sandboxes) are Firecracker microVMs whose root filesystem is an Archil disk: stop keeps the files and installed packages, pause also keeps memory and running processes, and a fork copies a running sandbox in milliseconds.

#### Strengths

-   Stopped and paused sandboxes don't accrue compute charges; a sandbox pauses after 30 minutes idle by default
-   Commands inside a sandbox have no time limit; a session pauses at 24 hours with its processes intact
-   Tool calls cost $0.05 per 1,000, with execution included
-   The workspace disk also mounts in E2B, Daytona, Modal and Vercel Sandbox, and is readable over S3
-   Egress firewall and credential brokering keep API keys out of the sandbox (Developer plan and up)

#### Tradeoffs

-   No GPUs; use Modal, Daytona or Northflank for GPU work
-   Public sandboxes and tool calls run only in three AWS regions (us-east-1, us-west-2, eu-west-1); other clouds need [BYOC](https://docs.archil.com/reference/byoc)
-   A tool call is capped at 5 minutes, 2 vCPU and 4 GiB; longer work belongs in a sandbox
-   Sessions last at most 30 minutes on the Free plan

### 2. Modal

[modal.com](https://modal.com/docs/guide/sandbox) · [Archil vs Modal](https://archil.com/compare/modal)

**Best for:** agents that need GPUs, or that mix agent sandboxes with inference and training in one platform

Modal runs Functions for up to 24 hours and Sandboxes for 5 minutes by default, raisable to 24 hours. Sandboxes run under gVisor or in a VM with its own kernel. State outlives a sandbox through Volumes and filesystem snapshots; memory snapshots, in alpha, restore into a new sandbox and expire after 7 days.

#### Strengths

-   GPUs from T4 to B300, billed per second
-   Functions scale to zero when idle
-   One platform for agents, inference, batch jobs and training

#### Tradeoffs

-   No pause in place: taking a memory snapshot terminates the sandbox
-   GPU sandboxes require the gVisor runtime
-   Volumes need explicit commit and reload to share changes; see [Archil vs Modal](https://archil.com/compare/modal)

### 3. E2B

[e2b.dev](https://e2b.dev/docs) · [Archil vs E2B](https://archil.com/compare/e2b)

**Best for:** agents that pause between user turns and must resume with exactly the same memory and files

Every E2B sandbox is a Firecracker microVM. Pausing saves both the filesystem and memory, and paused sandboxes have no time-to-live. Sessions last up to 1 hour on Hobby and 24 hours on Pro; billing is per vCPU-second and GiB-second while running.

#### Strengths

-   Pause and resume keep memory, with no expiry on paused sandboxes
-   Established SDKs for code interpreters and agent tools
-   Paused sandboxes aren't billed for compute

#### Tradeoffs

-   Pausing takes time in proportion to memory (E2B cites about 4 s per GiB)
-   No GA shared volume; Volumes are in private beta
-   Sandbox disk is 10 GiB on Hobby and 20 GiB and up on Pro

### 4. Daytona

[daytona.io](https://www.daytona.io/docs/en/sandboxes) · [Archil vs Daytona](https://archil.com/compare/daytona)

**Best for:** long-lived development environments that stop when idle and come back with their files

Daytona sandboxes have no maximum lifetime unless you set one. They auto-stop after 15 idle minutes by default and auto-archive after 7 days stopped. VM sandboxes can pause with memory; container sandboxes keep the filesystem but not memory on stop. Volumes are FUSE mounts shared across sandboxes.

#### Strengths

-   No lifetime cap; stopped sandboxes are kept until deleted
-   GPU sandboxes with up to 8 GPUs
-   Per-second billing for vCPU, memory and storage

#### Tradeoffs

-   Container sandboxes can't pause; memory is lost on stop
-   GPU sandboxes are ephemeral
-   Sandbox disk tops out at 10 GB; see [Archil vs Daytona](https://archil.com/compare/daytona)

### 5. Northflank

[northflank.com](https://northflank.com/docs/v1/application/sandboxes/sandboxes-on-northflank-cloud)

**Best for:** teams that want agents, services and databases on one platform, in Northflank's cloud or their own

Northflank runs CPU sandboxes in microVMs and GPU sandboxes under gVisor, with no fixed session limit. Pausing scales a sandbox to zero and stops compute charges; ephemeral storage is wiped, so durable state goes on a volume.

#### Strengths

-   No session time limit stated
-   Persistent NVMe volumes, up to 64 TB
-   GPUs, and bring-your-own-cloud deployment

#### Tradeoffs

-   Pause doesn't keep memory or ephemeral files
-   Volumes keep billing while a sandbox is paused

### 6. Fly.io Machines

[fly.io](https://fly.io/docs/machines/overview/)

**Best for:** agents that run as ordinary long-lived processes close to users, in many regions

Fly Machines are Firecracker microVMs billed by the second while running, with no stated run limit. Suspend snapshots the whole VM, memory included, and resumes in a few hundred milliseconds; Fly recommends it for Machines with 2 GB of memory or less. [Sprites](https://sprites.dev) are Fly's agent-focused sandboxes with a persistent 100 GB disk.

#### Strengths

-   Suspend and resume with memory
-   Volumes and stopped root filesystems are cheap to keep
-   Many regions

#### Tradeoffs

-   Suspend is recommended only for small Machines
-   A Fly Volume attaches to one Machine
-   Fly has said it is scaling back its GPU plans

### 7. AWS Lambda and Fargate

[docs.aws.amazon.com](https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html)

**Best for:** teams that must keep agent compute inside their AWS account and already run on Lambda or ECS

A Lambda invocation runs for at most 30 minutes. Lambda durable functions run a workflow for up to a year and suspend during waits without compute charges, and Step Functions Standard workflows also run for up to a year. Lambda MicroVMs, built for sandboxes, run for up to 8 hours and suspend with memory and disk. Fargate runs containers with no stated time limit and attaches EBS or EFS.

#### Strengths

-   Durable functions and Step Functions keep the agent loop's state for up to a year
-   Lambda mounts Amazon EFS or Amazon S3 Files for shared files
-   IAM, VPC and billing stay in one AWS account

#### Tradeoffs

-   Fargate has no GPUs and no pause; AWS retires tasks for platform maintenance, and standalone tasks aren't replaced
-   Several products to assemble: compute, storage and orchestration are separate
-   A plain Lambda function can't hold a sandbox open past 30 minutes

### 8. Vercel

[vercel.com](https://vercel.com/docs/sandbox) · [Archil vs Vercel Sandbox](https://archil.com/compare/vercel-sandbox)

**Best for:** agents built into a Vercel app, with short tool calls and occasional sandboxes

Vercel Functions run for up to 300 s on Hobby and 800 s on Pro, with 1,800 s in beta, and bill Active CPU, so time spent waiting on a model isn't billed as CPU. Vercel Sandbox runs Firecracker microVMs for up to 45 minutes per session on Hobby and 24 hours on Pro; persistent sandboxes save the filesystem when stopped and restore it on resume. [Vercel Workflow](https://vercel.com/docs/workflows) can pause for minutes or months and resume.

#### Strengths

-   Active CPU pricing for Functions and Sandbox
-   Sandbox, Workflow and the app in one project

#### Tradeoffs

-   Sandbox resume restores files, not memory or running processes
-   A Drive takes one writer at a time; see [Archil vs Vercel Sandbox](https://archil.com/compare/vercel-sandbox)

## Long-running is two problems

An agent that runs for hours has a loop (prompt, model call, tool call, repeat) and a workspace (the files and packages its tools touch). The loop's state is small and can live in your database or a durable workflow engine such as Temporal, AWS Step Functions, Vercel Workflow or Cloudflare Workflows. The workspace is large and has to survive between tool calls.

Platforms on this page mostly answer the second problem. Archil's [Temporal guide](https://docs.archil.com/guides/agents/temporal) shows the split: the workflow holds the loop, and each activity runs in its own sandbox on a persistent disk.

## Which one should you use?

| If you need | Pick |
| --- | --- |
| Hours of work in bursts, with no compute billed while the agent waits | Archil |
| GPUs in the agent's sandbox | Modal, Daytona or Northflank |
| Exact memory state after a pause, with no expiry | E2B or Archil |
| One workspace that several agents or machines write at once | Archil |
| Everything inside your AWS account | AWS Lambda durable functions or Step Functions, with Fargate or Lambda MicroVMs |
| Your own cloud, with sandboxes next to services and databases | Northflank, or Archil BYOC |
| An agent inside a Vercel app | Vercel Functions and Workflow, with Vercel Sandbox |

## Questions people ask

### What is the best platform for long-running AI agents?

One that keeps the agent's state when compute stops. Archil keeps the workspace on a durable disk and pauses sandboxes with memory, Modal is the pick for GPUs, E2B for exact pause and resume, and AWS durable functions or Step Functions when everything must stay in AWS.

### How long can an AWS Lambda function run?

30 minutes per invocation, per AWS's limits page. Lambda durable functions can run a workflow for up to one year, suspending during waits, and Lambda MicroVMs run for up to 8 hours.

### Can an agent sandbox run for more than 24 hours?

On Daytona and Northflank, yes: neither sets a lifetime limit. On E2B Pro, Modal, Vercel Sandbox Pro and Archil, a session lasts up to 24 hours. Archil pauses the sandbox at that point with processes intact, and resuming starts a new session.

### Do I pay for a sandbox while the agent waits on the model?

On most platforms, yes, while the sandbox is running. Archil serverless tool calls bill per call, so nothing runs between turns, and Archil sandboxes pause when idle and accrue no compute charges while paused or stopped. Vercel bills Active CPU, which excludes idle waiting but still bills memory.

### Which agent platforms have GPUs?

Modal, Daytona (ephemeral GPU sandboxes), Northflank and Fly.io document GPUs. Archil and Fargate don't offer them.

### Should the agent loop run inside the sandbox?

It doesn't have to. Running the loop in your backend or a durable workflow and sending only tool calls to a sandbox keeps API keys out of the sandbox and lets the loop survive a sandbox restart. See [how to build agents](https://archil.com/guides/building-agents).

## How we chose

We picked platforms that teams use to run agents for longer than one request, and compared what each documents: run limits, what pause and stop keep, billing basis, GPUs and isolation. Every competitor fact comes from that vendor's own docs or pricing page as of the date above; where a vendor doesn't say, the table says so. Archil makes Archil, which is ranked first because it covers both halves of the problem, but it isn't the right pick for GPU work or for teams that must stay inside AWS.

## Related

-   [Best persistent sandbox platforms for AI agentsWhich sandboxes keep files and installed packages across restarts.](https://archil.com/compare/sandbox-providers)
-   [Best storage for AI agentsShared and persistent file systems for agents, and why agent memory is a separate problem.](https://archil.com/compare/best-storage-for-ai-agents)
-   [How to run agent tool calls without keeping a VM openPer-call execution against a persistent disk.](https://archil.com/article/how-to-run-agent-tool-calls-without-keeping-a-vm-open)
-   [What does an idle agent sandbox cost per hour?What you pay while an agent waits on its model.](https://archil.com/article/what-does-an-idle-agent-sandbox-cost-per-hour)

Or see [every comparison](https://archil.com/compare).
