Architecture
How pols turns an API call into a running VM, where each part runs, and how sandbox traffic is kept apart from the API and the website.
pols has three parts: a control plane that keeps the record of every sandbox, a runtime on each sandbox host that runs the VMs, and an edge that terminates TLS and routes traffic. All of them run on dedicated servers at Hetzner in Germany.
pols CLI · MCP server · TypeScript client · curl browsers, ssh
│ REST, org API key │
▼ ▼
edge ── api.pols.so · <sandbox>-<port>.on.pols.so · ssh.pols.so
│ │
▼ │ ports, desktop,
control plane (polsd + Postgres, reconciler) │ ssh over the host's
│ create, start, stop, fork, delete, │ private network
│ exec, files, computer use │
▼ ▼
sandbox host: KVM virtual machines (Cloud Hypervisor, Incus) on ZFS
Desired state and the reconciler
Lifecycle calls do not wait for the VM. POST /v1/sandboxes, stop, resume, fork and DELETE record what you want, the sandbox’s desired_state (running, stopped or deleted; the control plane itself sets standby for an idle sandbox), and return at once. A reconciler in the control plane then drives the host to that state, retries with backoff when something fails, and notices when a VM stopped on its own.
A sandbox’s status says where it actually is: pending, running, stopped, deleted, error or standby, which means its VM is frozen because it was idle, until the next call that needs it wakes it. A client waits until status equals desired_state; the CLI, the MCP server and the TypeScript client’s waitFor do that for you. A standby sandbox whose VM stopped is also settled: it stays at status=stopped with desired_state=standby. See Lifecycle.
Commands, file transfers and computer-use actions are different: they go straight to the running VM and answer when they are done.
The runtime
Each new sandbox is a KVM virtual machine run by Cloud Hypervisor. When no host has room for it in Cloud Hypervisor, it is placed in Incus (QEMU/KVM) instead; sandboxes made in Incus, including every sandbox made before 11 October 2026, stay there, and so do their forks.
A sandbox’s disk is a ZFS dataset, which is why copies are cheap: a new sandbox, a fork and a template are all clones of an existing disk and take well under a second to make. Booting the VM takes 3 to 4 seconds more on Cloud Hypervisor (about 13 on Incus), so pols keeps a few small VMs booted ahead of time: a new small sandbox usually comes from that pool and runs in under a second.
Each Cloud Hypervisor VM has its own network interface on the host, filtered by its address, and each sandbox has its own firewall rules for its egress policy. On Incus, every org gets its own Incus project, and each sandbox its own network ACL.
The edge
The edge runs on the sandbox host and serves every public name:
| Name | Serves |
|---|---|
api.pols.so |
the REST API |
<sandbox>-<port>.on.pols.so |
a published port |
<sandbox>-desktop.on.pols.so |
the desktop in the browser |
<sandbox>-cdp.on.pols.so |
the sandbox’s Chrome for Playwright or Puppeteer |
<name>.on.pols.so |
a published site, from the control plane’s own storage rather than the sandbox |
ssh.pols.so |
the SSH gateway |
<sandbox> is the sandbox’s host label, a generated name with a random suffix like braveotterk3f9 that never changes (see published ports), or its ID with - in place of _; both reach the same sandbox. The edge keeps no state of its own besides its certificates: for every request and every SSH login it asks the control plane whether, and where, the traffic may go.
All sandbox content, published sites included, is served under on.pols.so, never under pols.so or api.pols.so. A page served by a sandbox therefore cannot read the cookies of the website or the API.
Data and accounts
The control plane keeps its records in Postgres on the same infrastructure: orgs, users, sandboxes, templates, usage intervals and the vault, whose values are encrypted with a key kept outside the database. Of API keys, login links and sessions it stores only a SHA-256 hash.
Usage is metered from the running intervals: every start and stop is recorded in the same transaction as the status change. CPU is charged as the busy vCPU time the host measures, RAM while a sandbox runs or, on Incus, is in standby, and used disk above the free allowance in any state; see usage and billing.