Sandscale vs Docker Sandboxes: a microVM on the developer's laptop, or one per run in the cloud
Docker Sandboxes and Sandscale both put agent code inside a microVM. They are aimed at different moments in an agent’s life. Docker Sandboxes, driven by the sbx CLI, are built around a developer running Claude Code or another coding agent against their own working tree, on their own machine or on Docker-managed cloud compute. Sandscale is built around a program (your orchestrator, a CI job, or an agent over MCP) starting a fresh box for each run and governing what happens in it. Plenty of teams could use both.
Docker Sandboxes 和 Sandscale 都是将代理代码置于微型虚拟机(microVM)中,但它们针对的是代理生命周期中的不同阶段。Docker Sandboxes 由 sbx 命令行工具驱动,旨在让开发者在自己的机器或 Docker 管理的云端计算资源上,针对自己的工作目录运行 Claude Code 或其他编码代理。Sandscale 则围绕程序(如编排器、CI 作业或通过 MCP 运行的代理)构建,为每次运行启动一个全新的沙箱并对其进行管控。许多团队可以同时使用这两者。
Docker facts below come from the Docker Sandboxes overview, architecture and security model pages, read in November 2026. The architecture and security pages describe local sandboxes; Docker has a separate page comparing local and cloud. Sandscale facts come from sandscale.dev.
以下关于 Docker 的事实摘自 2026 年 11 月查阅的 Docker Sandboxes 概述、架构和安全模型页面。架构和安全页面描述的是本地沙箱;Docker 另有页面对比本地与云端沙箱。关于 Sandscale 的事实则来自 sandscale.dev。
Isolation Docker says “the primary trust boundary is the microVM”. Inside, the agent has full control, including sudo, package installs and its own Docker Engine, with no path to the host’s Docker daemon. Docker lists five layers: hypervisor isolation with a separate kernel per sandbox, network isolation, Docker Engine isolation, workspace isolation and credential isolation. Sandscale gives each agent run its own Firecracker microVM with its own kernel; nothing is shared with the run next to it. The box starts from a template, runs the commands you send, and goes away when you stop it. Both are VM boundaries. The difference is what crosses them.
隔离性方面,Docker 表示“主要的信任边界是微型虚拟机”。在内部,代理拥有完全控制权,包括 sudo 权限、软件包安装以及独立的 Docker 引擎,且无法访问宿主机的 Docker 守护进程。Docker 列出了五层隔离:基于每个沙箱独立内核的虚拟机管理程序隔离、网络隔离、Docker 引擎隔离、工作空间隔离和凭据隔离。Sandscale 为每次代理运行提供独立的 Firecracker 微型虚拟机及其内核;不同运行之间不共享任何内容。沙箱从模板启动,执行发送的命令,并在停止后销毁。两者都属于虚拟机边界,区别在于跨越边界的内容。
What crosses the boundary This is where Docker’s design is most interesting, because a local sandbox exists to work on your files. Workspace. In direct mode, your working directory is mounted read-write through a filesystem passthrough, so “the agent edits your working tree in place”. Docker’s security page warns that this includes files that run implicitly later: Git hooks, CI configuration, IDE task configs, Makefile, package.json scripts. It notes that Git hooks live in .git/ and do not show up in git diff. Clone mode mounts your repository read-only and gives the agent a private clone. A mountless sandbox shares nothing.
跨越边界的内容是 Docker 设计中最有趣的部分,因为本地沙箱的存在是为了处理你的文件。在工作空间方面,直接模式通过文件系统透传以读写方式挂载工作目录,因此“代理可以直接修改你的工作树”。Docker 的安全页面警告称,这包括后续会隐式运行的文件:Git 钩子、CI 配置、IDE 任务配置、Makefile 和 package.json 脚本。它指出 Git 钩子位于 .git/ 目录中,不会出现在 git diff 中。克隆模式则以只读方式挂载仓库,并为代理提供一个私有克隆。无挂载沙箱则不共享任何内容。
Credentials. Docker’s host-side proxy injects authentication headers into outbound HTTP requests. The agent sees a sentinel value, and “the raw credential values never enter the VM”. Network. All outbound TCP goes through a proxy on the host and follows a deny-by-default policy. Docker also cautions that “the default allowed domains include broad wildcards”, such as *.googleapis.com, and suggests running sbx policy ls and removing what you do not need. UDP is blocked unless you enable an experimental feature; ICMP is blocked.
凭据方面,Docker 的宿主机代理会将身份验证标头注入到出站 HTTP 请求中。代理只能看到一个哨兵值,“原始凭据值永远不会进入虚拟机”。网络方面,所有出站 TCP 流量都通过宿主机上的代理,并遵循默认拒绝策略。Docker 还提醒,“默认允许的域名包含广泛的通配符”,例如 *.googleapis.com,并建议运行 sbx policy ls 命令以移除不需要的域名。除非启用实验性功能,否则 UDP 被阻止;ICMP 同样被阻止。
MCP. Agents connect to an MCP gateway on the host side. Local stdio MCP servers run on the host, not in the VM, so Docker advises treating them as trusted host integrations. Sandscale has no host to share. Files go in and out through the API (writeFile, a project upload, reads back), so nothing the agent writes lands in your working tree until you choose to apply it. The network starts as none; allowlist uses your organization’s egress allowlist and package registry presets. Secrets come from Vault into the sandbox’s environment in memory and end with the run. They are kept out of prompts, logs, the API’s answer and the audit log, but code inside the box can read them. Docker’s proxy-injection design keeps the credential out of the VM entirely, and if that property matters to you, it is a point in Docker’s favour.
MCP 方面,代理连接到宿主机侧的 MCP 网关。本地 stdio MCP 服务器运行在宿主机而非虚拟机中,因此 Docker 建议将其视为受信任的宿主机集成。Sandscale 没有可共享的宿主机。文件通过 API(writeFile、项目上传、读取)进出,因此在用户选择应用之前,代理写入的内容不会进入工作树。网络初始状态为无;允许列表使用组织的出站允许列表和软件包注册表预设。密钥通过 Vault 进入沙箱的内存环境,并随运行结束而销毁。它们不会出现在提示词、日志、API 响应和审计日志中,但沙箱内的代码可以读取它们。Docker 的代理注入设计将凭据完全排除在虚拟机之外,如果这一特性对你很重要,这是 Docker 的一个优势。
Lifecycle and persistence Docker sandboxes “persist until explicitly removed”. Stopping an agent keeps the VM, installed packages, Docker images and files; sbx rm deletes it all. That suits a developer who returns to the same environment every day. Sandscale sandboxes are disposable by default, with a lifetime you set (timeoutSeconds, server default one hour). Pause keeps memory and files on every plan, and snapshots let new sandboxes start from a saved point. For a persistent cloud machine, Sandscale has workspaces, which sleep when idle.
生命周期与持久性方面,Docker 沙箱“在显式删除前一直存在”。停止代理会保留虚拟机、已安装的软件包、Docker 镜像和文件;sbx rm 命令会删除所有内容。这适合每天回到相同环境的开发者。Sandscale 沙箱默认是即用即弃的,生命周期由用户设定(timeoutSeconds,服务器默认为一小时)。所有方案都支持暂停以保留内存和文件,快照功能则允许新沙箱从保存点启动。对于持久化的云端机器,Sandscale 提供工作空间,在空闲时会自动休眠。
Cost and governance Docker says the sbx CLI and local sandbox compute “are free to use, including for commercial work”. Cloud sandboxes use a pay-as-you-go subscription, and organization-wide control of network, filesystem and MCP policies for local sandboxes is “available on a separate paid subscription”. We have not quoted cloud prices because the pages we read do not list them. Sandscale bills in awake vCPU-hours on a plan: Free includes 100 a month, Pro ($25 a month billed monthly) 1,500, Team ($48 per member a month billed monthly) 2,000 per member pooled. Paused time and idle time between tool calls do not count. Human approvals, a hash-chained audit log, Vault and DLP on prompts and MCP tool calls are on every plan, and Claude Code can run under your policy through its hooks. Team adds SSO, roles and audit export. See pricing and security.
成本与治理方面,Docker 表示 sbx 命令行工具和本地沙箱计算资源“可免费使用,包括商业用途”。云端沙箱采用按需付费订阅,而针对本地沙箱的网络、文件系统和 MCP 策略的组织级控制则“需要单独付费订阅”。我们未引用云端价格,因为所查阅页面未列出。Sandscale 按活跃 vCPU 小时计费:免费版每月包含 100 小时,Pro 版(每月 25 美元)包含 1,500 小时,Team 版(每成员每月 48 美元)包含每成员 2,000 小时的共享额度。暂停时间和工具调用间的空闲时间不计费。人工审批、哈希链审计日志、Vault 以及针对提示词和 MCP 工具调用的 DLP 功能在所有方案中均提供,Claude Code 可通过钩子在你的策略下运行。Team 版增加了 SSO、角色管理和审计导出功能。详情请见定价与安全页面。
Which one fits Situation Better fit A developer runs Claude Code on their own repo and wants it off the bare host Docker Sandboxes, local The agent needs its own Docker Engine to build and run containers Docker Sandboxes (each has an isolated daemon) Credentials must never enter the VM Docker Sandboxes (host proxy injection) Your service starts many short agent runs from code, each needing a fresh box Sandscale You need approvals, a hash-chained audit log and DLP across a team, without a separate subscription per feature Sandscale Agent PRs from CI need to run tests somewhere other than the runner Sandscale (see running untrusted PR code) The two also combine: a developer can work in a Docker sandbox locally while the same agent’s automated runs in CI or production go to Sandscale. Two honest caveats on our side: Sandscale runs in the US (N. Virginia) today, with Europe (Frankfurt) announced and not open yet, and our service levels page says there is no availability commitment or service credit yet. Originally published on the Sandscale blog.
适用场景对比:开发者在自己的仓库运行 Claude Code 并希望将其与宿主机隔离,更适合 Docker Sandboxes(本地);代理需要独立的 Docker 引擎来构建和运行容器,更适合 Docker Sandboxes(每个都有独立的守护进程);凭据绝对不能进入虚拟机,更适合 Docker Sandboxes(宿主机代理注入);服务需要从代码启动多次短时间的代理运行,且每次都需要全新的沙箱,更适合 Sandscale;团队需要审批、哈希链审计日志和 DLP,且不想为每个功能单独订阅,更适合 Sandscale;CI 中的代理 PR 需要在运行器之外的地方运行测试,更适合 Sandscale(参见运行不受信任的 PR 代码)。两者也可以结合使用:开发者可以在本地使用 Docker 沙箱工作,而同一代理在 CI 或生产环境中的自动化运行则使用 Sandscale。我们诚实地提出两点注意事项:Sandscale 目前仅在美国(北弗吉尼亚)运行,欧洲(法兰克福)区域已宣布但尚未开放;我们的服务水平页面显示目前尚无可用性承诺或服务抵扣。本文最初发布于 Sandscale 博客。