11-19 更新 实时
首页/ 技术栈/ 正文

面向编程智能体的外部沙箱

技术栈 来源:Simon Willison 2026-11-18 06:52 0 阅读 机器翻译
面向编程智能体的外部沙箱

2026年11月17日 - Link Blog

面向编程智能体的外部沙箱。我一直在探索为智能体执行的代码提供沙箱的新方式,重点是让本地模型的试用更加安全,无需担心一次失误或提示注入攻击会让它们在这台机器上做出破坏性操作。

我与 Prime Radiant 合作开展了这个项目,这家 AI 研究实验室打造了 Superpowers 及其他项目。

我在 Prime Radiant 博客上发布的文章介绍了外部沙箱模式:智能体执行的代码在专用沙箱内运行,而智能体本身则位于该沙箱之外。

为演示这一模式,我们发布了三个沙箱服务器实现:

external-sandbox-v86 运行一个 Node.js 服务器,再由该服务器使用 v86 在 WebAssembly 中运行 Alpine Linux。

external-sandbox-container 是一个 Python Web 服务器,它在 Apple Containers 实例中运行位于 Alpine Linux 内的沙箱。

external-sandbox-quicksand 是另一个 Python Web 服务器,这次使用 Microsoft 的 Quicksand 沙箱库,该库把 QEMU 和 Alpine Linux 打包进了一个 Python 包中!

这些实现各自都提供相同的 localhost API。之后你可以配置 Pi、Claude Code 或 Codex,让它们在需要执行代码时,随时把 API 调用发送到该沙箱。

这些沙箱还包含一个可选的 HTTP/HTTPS 允许列表代理,因此你可以精确控制智能体的代码被允许与哪些主机通信——此外还有一套凭证替换机制,使其无需把密钥交给智能体,也能发起经过认证的 API 调用。下面是你可以用来在沙箱仍在运行时重新配置该代理的界面:

我始终对「安全运行不可信代码」这一挑战着迷。这种外部沙箱模式提供了一种简洁的方式,来试验各种不同做法。

发布于 2026 年 11 月 17 日晚上 10:52

这是 Simon Willison 发布的一篇链接帖,发布于 2026 年 11 月 17 日。

每月赞助我 10 美元,即可获得一份精选的月度邮件摘要,汇总当月最重要的 LLM 进展。

付钱给我,让我少给你发点!

译文由英文原文机器翻译,术语按行业惯例统一,可在文末展开原文核对。

查看英文原文(External sandboxes for coding agents)

17th November 2026 - Link Blog

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:

The network policy page with allowed destinations, the policy JSON editor and recent proxy activity

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.

Posted 17th November 2026 at 10:52 pm

This is a link post by Simon Willison, posted on 17th November 2026.

Sponsor me for $10/month and get a curated email digest of the month's most important LLM developments.

Pay me to send you less!

原文为英文,正文由自动抓取并保留原文。

本文由采集器自动同步

原文发布于 Simon Willison(External sandboxes for coding agents),标题、摘要与正文由机器翻译,术语按行业惯例统一,未经人工逐句校订。

阅读原文 ↗