产品

Simon Willison 推出外部沙箱模式,让编码智能体安全执行代码

精选理由

Simon Willison 和 Prime Radiant 发了三个开源沙箱服务器,让 Claude Code、Codex 这类编码智能体跑代码时隔离在沙箱里,还带域名白名单代理和密钥替换。想试本地模型又怕被提示注入搞坏机器的开发者可以直接上手。

Simon Willison 与 AI 研究实验室 Prime Radiant 合作发布外部沙箱模式,代码在专属沙箱内运行,智能体本身留在沙箱外,降低本地模型被提示注入攻击后破坏机器的风险。

正文

项目提供三个实现:external-sandbox-v86 用 v86 在 WebAssembly 中运行 Alpine Linux 的 Node.js 服务器;external-sandbox-container 基于 Apple Containers 的 Python 服务器;external-sandbox-quicksand 使用微软 Quicksand 库,把 QEMU 和 Alpine Linux 打包进 Python 包。三者暴露同一套 localhost API。

沙箱附带可选的 HTTP/HTTPS 白名单代理,可精确控制智能体代码能访问哪些主机,并支持凭据替换机制,让代码调用需要认证的 API 时无需把密钥交给智能体。Pi、Claude Code 和 Codex 都可配置为将执行代码的请求发往沙箱。

原文 · Simon Willison’s Weblog

External sandboxes for coding agents I've been exploring new ways to sandbox code that is executed by agents, with a focus on making it safer to try out local models without worrying that a mistake or prompt injection attack might cause them to take damaging actions on a machine. I worked on this project with Prime Radiant , the AI research lab behind Superpowers and other projects . My post on the Prime Radiant blog introduces the external sandbox pattern, where code executed by the agent runs inside a dedicated sandbox while the agent itself lives outside of that sandbox. To demonstrate this pattern we've released three sandbox server implementations: external-sandbox-v86 runs a Node.js server which then uses v86 to run Alpine Linux inside WebAssembly. external-sandbox-container is a Python web server which runs the sandbox in Alpine Linux inside an Apple Containers instance. external-sandbox-quicksand is another Python web server, this time using Microsoft's Quicksand sandboxing library, which bundles QEMU and Alpine Linux in a Python package! Each of these implementations offers the same localhost API. You can then configure Pi, Claude Code, or Codex to send API calls to that sandbox any time they want to execute code. The sandboxes also include an optional HTTP/HTTPS allow-list proxy, so you can control exactly which hosts your agent's code is allowed to communicate with - plus a credential replacement mechanism to make authenticated API calls without sharing a secret with the agent. Here's the UI you can use to reconfigure that proxy while the sandbox is still running: I continue to be fascinated by the challenge of safely running untrusted code. This external sandbox pattern provides a neat way to experiment with different approaches. Tags: sandboxing , security , ai , webassembly , generative-ai , llms , coding-agents , claude-code , codex , pi

产业坐标与信源核验

本条情报归属 AITOP「产品」核心栏目,重点聚焦北美前沿实验室与硅谷科技巨头。在跨区域产业观察坐标中,该动态直接关联「AI 开发者工具链、Coding Agent 与工程化实践」研究主线,反映出当前技术演进与商业落地的最新风向。涉及核心实体与技术议题包括:Claude Code、Codex、沙箱、编码智能体,读者可通过下方标签进入对应专题页查阅历史脉络与关联对比。

信源核验说明:本文原始线索采编自「Simon Willison’s Weblog」,经 AITOP 多维评分管线结构化提炼。