【文章标题】:smolmachines / smolvm as a sandbox for untrusted Python & JavaScript

【文章标题】:smolmachines / smolvm 作为不可信 Python 和 JavaScript 的沙箱

【文章正文】: Research:

【文章正文】: 研究:

smolmachines / smolvm as a sandbox for untrusted Python & JavaScript

smolmachines / smolvm 作为不可信 Python 和 JavaScript 的沙箱

I tasked Claude Fable 5 running in Claude Code for web with the following research task:

我向在 Claude Code for web 中运行的 Claude Fable 5 布置了以下研究任务:

Put https://smolmachines.com through its paces as a fast secure sandbox. Explore what it would take to use this to run untrusted Python and JavaScript code in a way that is limited in what RAM and CPU time it can take up (protection against “while true”) with no network access and filesystem access only to designated files

对 https://smolmachines.com 进行全面测试,将其作为一个快速安全的沙箱。探索需要什么条件才能用它来运行不可信的 Python 和 JavaScript 代码,使其在 RAM 和 CPU 时间上受到限制(防止“while true”死循环),没有网络访问权限,并且只能访问指定文件。

Goal is to be able to use this to execute user-provided tasks for things like data transformations

目标是能够使用它来执行用户提供的任务,例如数据转换。

It quickly ran into a problem: the Claude Code for web environment can’t run

smol machines

. Quoting the

notes it wrote

:

它很快遇到了一个问题:Claude Code for web 环境无法运行 smol machines。引用它写的笔记:

This Claude Code container: Linux 6.18.5-fc-v20 (itself a Firecracker guest), 4 vCPU, 15GB RAM.

No /dev/kvm, no vmx/svm CPU flags

→ no nested virt.

smolvm machine run

fails as expected: “kvm not available”.

这个 Claude Code 容器:Linux 6.18.5-fc-v20(本身是一个 Firecracker 客户机),4 vCPU,15GB RAM。

没有 /dev/kvm,没有 vmx/svm CPU 标志

→ 没有嵌套虚拟化。

smolvm machine run

如预期失败:“kvm not available”。

Plan B: GitHub Actions ubuntu runners DO expose /dev/kvm → run the real test battery via a temporary workflow on this branch, collect logs, remove workflow in final commit.

备选方案:GitHub Actions 的 ubuntu 运行器确实暴露了 /dev/kvm → 通过此分支上的临时工作流运行真正的测试套件,收集日志,在最终提交中移除工作流。

And Plan B is

what it did

, installing smolvm and running

these tests

directly in a GitHub Actions runner against that branch.

而备选方案正是它所做的事情:安装 smolvm,并在 GitHub Actions 运行器中直接针对该分支运行这些测试。

That was a creative solution to the environmental limits posed by Claude Code for web. Another example of Fable being

relentlessly proactive

.

这是对 Claude Code for web 所施加的环境限制的一个创造性解决方案。这也是 Fable 一贯积极主动的又一个例子。

Tags:

research

,

sandboxing

,

ai

,

github-actions

,

generative-ai

,

llms

,

coding-agents

,

claude-mythos-fable

标签:

研究

,

沙箱化

,

人工智能

,

github-actions

,

生成式人工智能

,

大语言模型

,

编码代理

,

claude-mythos-fable