English
Docs menu

Pethost Agent Sandboxes docs

Updated · 2 min read

A sandbox is a Linux microVM for code, coding agents and a desktop with Chrome: a Firecracker VM with its own kernel, and root inside. It starts from a template in about 0.15 s, pauses with its memory and processes when nothing happens in it, wakes at the next call in about 0.1 s, and stops to object storage when it stays idle longer. You pay by the second for what each state holds.

RUNNING

In its server's memory

Runs your processes and answers every call.

$0.018 an hour, SMALL

Idle 5 min: it pauses

The next call wakes it

PAUSED

On its server's disk

Keeps memory, processes and disk.

$0.0054 an hour, SMALL

Idle 30 min: it stops

STOPPED

In object storage

Keeps its disk; its processes end.

$0.03 a GiB a month

ResumeSandbox starts it again, its files as it left them

The default lifecycle. Each timer can be changed or turned off, and a sandbox is never deleted unless you ask: lifecycle and idle.

Where to start

In numbers

  • 0.15 s to start a sandbox, measured through a panel 16 ms from its server
  • 0.1 s to wake a paused one, at its next call
  • $0.018 an hour for 2 vCPUs and 4 GiB, by the second
  • 30% of that price while it is paused

What a sandbox does

  • Commands, files and a terminal. Run a command and wait for its port, edit a file by exact replacement, stream output, or open a terminal in a browser: commands and files.
  • Ports. Any port at https://<port>-<id>.<server>, public or behind a token: ports and previews.
  • Coding agents. Claude Code, Codex and OpenCode are installed. One call gives an agent a prompt, another streams each tool call it makes: coding agents.
  • A desktop. Chrome on a 1280×800 screen, which starts at its first use: click, type and take a screenshot in one call, or watch it live: computer use.
  • Templates, forks and volumes. Save a sandbox's disk and start new ones from it (templates); copy a running sandbox, memory and all, into up to 100 copies (forks); keep data on a disk outside any sandbox, on one server (volumes).
  • Secrets and egress. API keys the sandbox never holds, and an allow-list of where it may connect: secrets and egress.
  • SSH and observability. Plain ssh, scp and ssh -L (SSH), and each sandbox's metrics, events and usage (observability).

Agent Sandboxes and App Platform

Pethost has two kinds of workspace. App Platform is a plan's machine for your Docker Compose apps, at a flat price a month: its docs are the App Platform docs. Agent Sandboxes is what these pages are about: microVMs that your code or your agent starts, uses and stops through an API, billed by the second. Each workspace is of one kind, and one account can have both.

Every page

Start

  • How Pethost Agent Sandboxes work

    What a sandbox is, its three states RUNNING, PAUSED and STOPPED, what wakes it, the two APIs, and where its memory, processes and files live.

  • Quickstart: your first sandbox

    Create a sandbox, run a command, write a file, open a port and clean up: from Python, TypeScript, Go, Rust, the pethost CLI or your agent.

  • Connect an agent to sandboxes over MCP

    Give Claude Code, Codex, Cursor or Claude sandboxes as tools: add the Pethost Agent Sandboxes MCP server and sign in to a workspace of sandboxes.

Concepts

Tasks

Reference

Try Pethost Agent Sandboxes

A 7-day trial with $1 of usage and 4 vCPUs, with a card. Then a plan from $20 a month, which includes as much usage.

Start the trial