Cubs vs Docker Sandboxes
Cubs vs Docker Sandboxes: one hour or open-ended
Docker Sandboxes does the isolation properly: a microVM per agent, with the network policy and the credentials handled outside it. It also expires the machine.
The short version
Docker Sandboxes runs AI coding agents in isolated microVMs, locally or on Docker-managed cloud compute, driven by the `sbx` CLI. Cloud sandboxes expire after one hour by default; on expiration the service stops the sandboxes it can resume and deletes the rest. Local sandbox compute is free, cloud compute is pay-as-you-go. Cubs is one persistent computer sized once and metered per second. For untrusted code, the microVM boundary is worth more than persistence. For a project you return to for weeks, the expiry is the first thing that breaks.
| Dimension | Docker Sandboxes | Cubs |
|---|---|---|
| Machine | A microVM with its own kernel, created per sandbox by the `sbx` CLI. Runs on your machine or on Docker-managed cloud compute, with separate credentials and lifecycle controls for each. | One persistent Linux computer sized 2 to 32 vCPU, with 2 GB RAM and 15 GB NVMe per vCPU, shared by every agent you run on it. |
| Stays running | Cloud sandboxes expire after one hour by default. On expiration the service stops the sandboxes it can resume and deletes the rest, so check the timeout action before trusting one with work. | Runs until you pause or delete it. No expiry timer and no timeout action to interpret. Pausing stops the processes and keeps the disk. |
| Size and price | Local sandbox compute and the CLI are free, including commercial use. Cloud compute is billed pay-as-you-go on a Docker Agentic Platform subscription; model charges are separate. See their billing docs for rates. | $6 per vCPU per month running, $2 paused. A 4 vCPU machine with 8 GB RAM and 60 GB SSD is $24/month, about $0.0329/hour. |
| Billing | A subscription for cloud access plus metered cloud compute. Local usage costs nothing beyond the machine you already own. | Prepaid credit metered per second. $25 to start with no card, and the machine pauses at zero rather than accruing a bill. |
| Agents included | None bundled. The isolation is the product; you pick the agent and configure it for the sandbox. | None bundled either. Install the agent, sign in as yourself, and the provider bills the model usage separately. |
| Your own tools | Kits package tools and configuration into reusable sandbox environments, and an MCP gateway wires up servers. Organisations can centrally manage network, filesystem and MCP policy. | apt, dotfiles, editors over SSH, private keys, installed once and kept. No policy layer to configure before the first clone. |
| Reaching it | The `sbx` CLI, with integrations that connect editors and applications to a sandbox over SSH, plus configurable port and network policy per sandbox. | SSH with a key, plus terminals, previews and forwarded ports in a browser tab and on a phone, with nothing to proxy first. |
When to choose Docker Sandboxes
- The code is generated and you do not want it anywhere near your home directory. A kernel boundary per task is the requirement.
- You need centrally managed policy: which hosts an agent may reach, which MCP servers it may use, enforced by an admin rather than by the agent.
- Local compute is free and you mostly run agents on the machine you are sitting at, so the cloud expiry never applies.
When to choose Cubs
- The agent has to keep a checkout, a local database and a toolchain for weeks, not for the length of one task.
- Several agents should share one machine, one set of credentials and one build cache instead of one sandbox each.
- You want a host your editor and your ssh config treat like any other server, with no CLI in the middle.
Docker solved the part everyone else skips
Most agent platforms treat isolation as a checkbox: run the agent in a container, call it sandboxed. Docker Sandboxes does something harder. Each agent gets a microVM with its own kernel, so a container escape is not the end of the story. Credentials are handled outside the sandbox, with API keys brokered on the way out rather than sitting in the environment. Organisation admins can set network, filesystem and MCP policy centrally, across every developer’s machine.
That is a security design, not a hosting convenience, and it is better than what most of this category ships. If your concern is that an agent will exfiltrate a token or reach a host it should not, this is the page in the comparison that takes the concern seriously.
Then it expires the machine
Cloud sandboxes expire after one hour by default. Their documentation is precise about the consequence: on expiration the service stops the sandboxes that can be resumed and deletes the rest. The advice is to check the timeout action before relying on a sandbox to retain your work.
An hour is a task. It is a generous hour, and for the workflow the product is aimed at, running an untrusted snippet and keeping the output, it is exactly right. It is also shorter than a test suite on a large repository, shorter than an install of a modern toolchain, and much shorter than the interval between Monday and Tuesday.
What the boundary costs in practice
Ephemerality is a feature until the thing being resumed is not code but state. A five-hour suite that failed at hour four has to start again. A forty-minute install step is paid again, every sandbox. Do that three times a day and you have bought a strong isolation model and paid for it in wall-clock time rather than money.
The cheapest way to have both is to separate the concerns. Keep the untrusted execution in a sandbox, where the kernel boundary does the work. Keep the working copy, the branch, the venv and the local database on a machine you own, so the sandbox is a few minutes of compute rather than the address of your project.
That split is also how the pricing works out. Local sandbox compute is free on Docker’s product, so a hybrid setup costs you the machine and almost nothing else. An agent that needs isolation for a risky step gets it, and an agent that needs the same node_modules tomorrow still has them.
Where the disk lives
The single question that decides between these products is where the disk lives. On a metered sandbox it is a resource that exists for the sandbox’s lifetime, and its size is a parameter of the sandbox. On a computer you keep, it is part of the machine: 15 GB per vCPU, priced with the vCPU, surviving a pause, a credit exhaustion and a month of neglect.
That is also the honest limit of the comparison. Per-task kernel isolation is better than shared-tenancy isolation, and a page that pretends otherwise is selling something. If your agents execute code you would not run on your own laptop, sandboxes are the correct default and a persistent machine is a convenience you add on top for the parts you trust.
The reverse is true as well. A machine that never expires is not a security control. It is a machine with your keys on it, and an agent with your permissions can do anything you can. Persistence buys you time and a warm cache; it does not buy you a boundary.
How to run both without duplicating work
Practically, this looks like a clone you keep and a sandbox you throw away. The repository lives on the machine, because that is where your editor, your branches and your credentials already are. When an agent wants to try something with unclear blast radius, you copy the worktree into a sandbox, run it there, and bring back the diff.
The copy is cheap because a worktree is small; it is the node_modules that is large, and that is exactly the thing the sandbox reinstalls anyway. What you avoid paying twice for is everything else: the clone history, the branch structure, the local services and the configuration that makes the machine yours.
There is a second reason the split works, which is that the two products meter differently. Docker’s local sandbox compute is free, so the marginal cost of an extra sandbox on your own hardware is zero, and the only thing you are paying for is the machine in the cloud. That is an unusually clean division of labour between two vendors.
What to check on their side before you commit
Three things, all of which change. First, the expiration setting on a cloud sandbox and what the timeout action actually does to your files, because the default is one hour and the consequence differs between a sandbox that can resume and one that cannot. Second, the subscription tier required for cloud access, since the CLI and local compute are free but cloud compute sits behind an Agentic Platform subscription. Third, whether the Kits you build are reproducible enough that a rebuilt sandbox is genuinely the same environment, because that is the promise that makes ephemerality bearable.
None of those are criticisms. They are the questions to ask a product that has decided the machine should be temporary, and the answers decide whether temporary suits you.
Cubs is the persistent side of this argument and says so: one computer, sized once, metered per second, no expiry. It is not a sandbox platform, it does not isolate one task from another, and it will not protect you from an agent running rm -rf with your own permissions.
Sources
Docker Sandboxes documentation, read on the date above. We are not affiliated with them and they have not reviewed this page.
Questions
Questions
- Do Docker cloud sandboxes really expire after an hour?
- Yes, one hour by default. Their docs say on expiration the service stops the sandboxes that can be resumed and deletes the rest, so the important detail is which side your sandbox lands on.
- Is a microVM more isolated than a Cubs computer?
- Yes, meaningfully. A microVM has its own kernel per task; a single-tenant machine has its own hardware but no per-task boundary. If you run untrusted code, prefer the sandbox.
- Can Cubs run Docker inside it?
- No. Docker-in-Docker is not supported. If your workflow needs nested containers, that is a concrete reason to stay with a sandbox product, or with a full VM provider.
- How many agents can share one Cubs machine?
- As many as your CPU and memory allow. Agents are ordinary processes in terminals, and a git worktree per task keeps two of them off each other's checkout.
Read next
A computer that stays on
A machine that stays on, with your coding agents on it. $25 of credit to start, no card.