2026-09-23·by Sijie Wang#standmeet#architecture#design

sandbox-js-hardening

Owner 脚本沙箱加固

上级:structure

Owner 编写的 skill 脚本(skill_run_script,见 skills-progressive-disclosure)是不可信的,因此运行在强隔离的沙箱中:--network=none(无法外传数据)、--read-only 根文件系统(无法持久化)、--tmpfs /tmp 限量的临时空间(64 MB)、--memory=256m --cpus=0.5(失控循环被限流)、--rm(自动清理)。解释器采用三语言白名单python3 -c / node -e / bash -c)——不允许任意二进制程序,因此边界之外的 shell 注入面为零。这些都是 internal/capabilities/sandbox/sandbox.goDockerRunner 拼出来的 docker run 参数(这个包随领域模块拆分搬到了 capabilities/ 下;MCP 能力沙箱用的 bwrap 工作区是另一个包,capabilities/sandboxws)。

这与网络隔离的 MCP capability 沙箱(mcp-capability-plugins)出于同一种直觉:不可信代码被关在笼子里运行,只能通过狭窄的、明确声明的通道触达孿主机。

read next
about this entry

One of sijie's wiki entries. The AI on this site is grounded in the same corpus and answers in sijie's voice, with citations back to entries like this one — answering costs sijie money, so it waits behind a code: enter an access code →

sandbox-js-hardening