技巧精选

smolmachines用作不信任Python与JavaScript代码沙盒

smolmachines / smolvm as a sandbox for untrusted Python & JavaScript

精选理由

Willison测试smolmachines当不信任Python和JavaScript代码的沙盒,用GitHub Actions直接跑测试,和之前在Claude Code for web上的方法不一样,现在能更好地执行用户任务了。

AI 摘要

使用Claude Fable 5在Claude Code for web环境中测试smolmachines时,发现该环境因无KVM支持无法运行smolvm;转而在GitHub Actions Ubuntu runner上直接安装smolvm并运行测试,成功解决环境限制问题;这种测试方法为执行用户提供的任务提供了灵活的执行方案。

原文 · Simon Willison’s Weblog

smolmachines / smolvm as a sandbox for untrusted Python & JavaScript

Research: smolmachines / smolvm as a sandbox for untrusted Python & JavaScript I tasked Claude Fable 5 running in Claude Code for web with the following research task: 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 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 : 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". 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. And Plan B is what it did , installing smolvm and running these tests directly in a GitHub Actions runner against that branch. That was a creative solution to the environmental limits posed by Claude Code for web. Another example of Fable being relentlessly proactive . Tags: research , sandboxing , ai , github-actions , generative-ai , llms , claude-mythos-fable