New:Upstash has a remote MCP server
·11 min read

Cloud Computers for AI Agents: How to Give an AI Agent Its Own Computer (2026)

Ali Tarık ŞahinAli Tarık ŞahinSoftware Engineer @Upstash
https://upstash.com/blog/cloud-computer-for-ai-agents
Summary

An AI agent that can only call APIs is limited to what those APIs expose. Give it a computer, a shell, a filesystem, a browser and git, and it can do the work a person would do at a terminal.

  • The short answer. For a coding agent or a per-user agent, use a cloud computer built for agents rather than a plain VM. Upstash Box is a persistent cloud computer with coding agents built in: run an agent, give it a browser and a repository, and get results back through an API.
  • If the agent has to control desktop applications, not just web pages, pick a sandbox with a full desktop over VNC: E2B Desktop or Daytona Computer Use.
  • If you want full root on a long-lived VM, Fly Sprites, or a VM you run yourself if you are ready to own its security.

"Give the agent a computer" became the default way to build capable agents this year. Claude Code, Codex and OpenCode are all agents that expect a terminal. Browser agents expect Chromium. Personal agents like OpenClaw and Hermes expect a machine that stays on. The question is no longer whether the agent gets a computer, but which one.

What a cloud computer for an AI agent needs

A laptop has all of this by default. A cloud computer for an agent should too, plus the safety you don't need when you are the only user:

NeedWhy the agent needs it
Shell and filesystemTo install packages, run builds and tests, and execute the code it writes
Files that persistSo it can stop today and continue tomorrow without cloning and installing again
IsolationSo a wrong command or a malicious package can't reach your machine, your network or other users
Egress control and secrets off the machineSo code the model just wrote can't read your API keys or send data anywhere it likes
A browserTo read JavaScript-rendered pages, test the app it built, and fill in forms
GitTo clone a repo, commit, and hand work back as a pull request
Always on, or pause and resumeAlways on for a personal agent that answers messages, pause and resume for work that comes in bursts
An API to drive itSo your app can create one computer per user or per task and get results back

Three ways to give an agent a computer

1. Rent a VM. A VPS on Hetzner, DigitalOcean or EC2 is cheap and familiar. It is also a computer with no agent features: you install the agent, harden SSH, set up a firewall, keep secrets out of reach of generated code, and build per-user provisioning yourself. Fine for one personal agent you trust, hard to run safely for many users.

2. Use a desktop sandbox. E2B Desktop and Daytona's Computer Use give the agent a full graphical desktop over VNC, which an agent needs to operate desktop applications like an office suite or an IDE's GUI. For web pages it isn't needed: a headless browser can also take screenshots, click and type. If your agent works through APIs, a terminal and the web, the desktop is overhead.

3. Use a cloud computer built for agents. An agent sandbox with a persistent filesystem and an SDK: you create a machine per user or per task with one call, and pausing, snapshots, network policy and logs come with it. This is the fit for coding agents, personal agents and per-user agents in a product.

How the options compare

OptionIsolationFiles persistBrowserAgent built inBilling
Upstash BoxContainerYes; auto-pause or keep-aliveHeadless Chromium with AI actionsYes: Claude Code, Codex, OpenCode, Cursor, customActive CPU, memory free
E2BFirecracker microVMYes, while paused; 1h / 24h session cap by planDesktop/VNC, cloud browsersNoWall-clock vCPU + RAM
DaytonaContainer by default; VM classesYes; disk billed when stoppedComputer Use desktop / VNCNoWall-clock vCPU + RAM
Fly SpritesFirecracker microVMYes (100 GB)NoCLIs preinstalled, no run APIActual CPU and RAM while active
NorthflankKata or gVisorYes (volumes)NoNoWall-clock vCPU + RAM
Your own VMWhatever you configureYesYou install itYou install itFixed monthly

Box's weak spots, plainly: it is a hardened container rather than a VM with its own kernel, it runs in AWS us-east-1 only, it has no GPUs, and custom Docker images are still planned. If you need a separate kernel per untrusted tenant or a GPU next to the agent, pick from the other rows. Details and sources for every provider are in our 15-provider sandbox comparison.

The lifecycle of an agent's computer: create, work, save, pause, return

A cloud computer for an agent is not used once and thrown away. A user starts a project today, comes back tomorrow, and expects the repo, the installed dependencies and the agent's context to still be there. This walkthrough follows one Upstash Box through that whole lifecycle.

1. Create the computer

One call creates an isolated Linux machine with a coding agent, a headless browser and git credentials set up. Store box.id against your user; that is their workspace from now on.

import { Agent, Box, ClaudeCode } from "@upstash/box"
 
const box = await Box.create({
  runtime: "node",
  agent: { harness: Agent.ClaudeCode, model: ClaudeCode.Sonnet_5 },
  browser: true,
  git: { token: process.env.GITHUB_TOKEN },
})
 
await saveWorkspace(userId, box.id) // your own database

2. Put it to work on a coding task

The agent runs inside the box, so you send a task and get a result back instead of building an agent loop. Pass a Zod schema and the result comes back as typed data, along with what the run cost.

import { z } from "zod"
 
await box.git.clone({ repo: "https://github.com/your-org/your-app" })
await box.cd("your-app")
await box.git.exec({ args: ["checkout", "-b", "fix/signup-form"] })
 
const run = await box.agent.run({
  prompt: "Fix the broken signup form validation and add a test. Run the test suite before you finish.",
  responseSchema: z.object({ summary: z.string(), testsPassed: z.boolean() }),
})
 
if (run.result.testsPassed) {
  await box.git.commit({ message: "fix: signup form validation" })
  await box.git.push({ branch: "fix/signup-form" })
  const pr = await box.git.createPR({ title: "Fix signup form validation", base: "main" })
  console.log(pr.url, run.cost.totalUsd)
}

Use box.agent.stream() instead of run() to show the agent's progress in your UI as it works.

3. Check the result in a real browser

Tests pass, but does the page work? The same box has Chromium, so the app the agent just fixed can be opened and checked without a second service:

await box.exec.command("nohup npm run dev > dev.log 2>&1 &")
await box.exec.command("until curl -sf localhost:3000 > /dev/null; do sleep 1; done")
 
const tab = await box.browser.tab.create("http://localhost:3000/signup")
await tab.act("type not-an-email into the email field")
await tab.act("click the sign up button")
const check = await tab.extract(
  "Is a validation error shown next to the email field?",
  z.object({ errorShown: z.boolean(), message: z.string() }),
)
const screenshot = await tab.screenshot() // PNG bytes, attach it to the PR or your UI

4. Save a starting point

Once an environment is set up, a snapshot captures its disk: the cloned repo, node_modules, build caches and the agent's configuration. New users or parallel workers start from it instead of cloning and installing again.

const snapshot = await box.snapshot({ name: "your-app-ready" })
const workerBox = await Box.fromSnapshot(snapshot.id)

5. Pause: automatic for bursty work

When nobody is using the box, it pauses. Files, the repo, installed packages and git state stay on disk; running processes such as the dev server stop. While paused there is no CPU charge, only storage at $0.10 per GB-month. You can also pause right away with box.pause().

6. Return the next day

The user comes back. Look up their box and give it the next task; a paused box wakes up on the next call with its workspace as they left it. Restart any servers it needs.

const box = await Box.get(await loadWorkspace(userId))
 
await box.agent.run({ prompt: "Add a password strength meter to the signup form" })

7. Work on a schedule

Some agents work on a cadence instead of on request. A schedule runs inside the box on a cron expression and wakes it if it is paused:

await box.schedule.agent({
  cron: "0 8 * * *",
  prompt: "Read yesterday's Sentry errors and open an issue for each new one",
})

8. Or stay on all the time

Bursty work wants auto-pause. An agent that must answer at any moment, like a personal assistant on WhatsApp or Telegram, needs a machine that never sleeps, because its gateway polls for messages from inside the box. A keep-alive box stays on, and initCommand starts your process again whenever it boots:

const assistant = await Box.create({
  runtime: "node",
  keepAlive: true,
  initCommand: "cd /workspace/home/assistant && npm start",
})

What it costs

The free plan includes 10 concurrent boxes, 5 CPU-hours a month and a $1 monthly model budget, with no card. After that a default box bills $0.10 per active CPU-hour for the small size (2 vCPU, 4 GB) with memory free. As an example, an hour in which the agent uses 10 core-minutes of real CPU is about $0.017 in compute. A keep-alive box is a flat $8 a month, and paused boxes pay only for storage. See Box pricing.

FAQ

What is a cloud computer for AI agents?

A remote machine an AI agent controls through a shell, a filesystem, a browser and git, the way a person uses a laptop. Unlike a plain VM it is built to be created per user or per task through an API, isolated from your systems, and paused when idle.

How do I give an AI agent its own computer?

Create one with an agent sandbox SDK and hand it to the agent. With Upstash Box, Box.create() returns an isolated Linux machine with a coding agent inside, and box.agent.run() gives it a task. You can also run your own agent loop against the box's shell and file APIs.

Does an AI agent need a desktop, or is a headless computer enough?

Headless is enough for coding agents, browser automation and most personal agents. A headless browser can take screenshots, click, type and fill in forms on web pages. A desktop over VNC is only needed when the agent has to operate desktop applications, where E2B Desktop and Daytona Computer Use fit.

How much does a cloud computer for an AI agent cost?

It depends on the billing model more than the rate. Agents spend most of their time waiting on the model, so active-CPU billing costs far less than wall-clock billing for the same work. On Upstash Box, an hour on a small box with 10 core-minutes of real CPU is about $0.017 in compute; storage for a paused box is billed separately.

Can an AI agent's computer stay on 24/7?

Yes. A keep-alive Upstash Box never pauses, for a flat $8 a month on the small size, and an init command restarts your server or gateway whenever the box boots. Personal agents like OpenClaw and Hermes run this way.

Is it safe to let an AI agent run commands on a cloud computer?

Safer than on your laptop, if the machine is isolated. A box is its own container that cannot reach your files, private networks, cloud metadata or other boxes, outbound traffic can be limited to an allowlist, and Attach Headers injects API keys on the host so the agent's code never sees them.

Sources

Checked in October 2026. Provider details follow our September 2026 comparison, which links each provider's docs and pricing pages. Upstash Box docs · Box pricing · Box browser · Keep-alive boxes