跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

提交记录
修改README.md+23 −1看文件
@@ -33,7 +33,7 @@ echo "source $(pwd)/claude-vm.sh" >> ~/.bashrc # or bash
3333claude-vm-setup
3434```
3535
36删除:Creates a VM template with dev tools, Docker, Chromium, and Claude Code pre-installed. You'll be prompted to authenticate Claude during setup.
36新增:Creates a VM template with dev tools, Docker, Chromium, and Claude Code pre-installed. During setup, Claude will launch once for authentication. After it responds, type `/exit` to continue with the rest of the setup. (We haven't found a way to automate this step yet.)
3737
3838### Run Claude in a VM
3939
@@ -94,6 +94,28 @@ Ports opened inside the VM (e.g. by Docker containers) are automatically forward
9494| Containers | docker |
9595| AI | Claude Code, Chrome DevTools MCP server |
9696
97新增:## Why a VM?
98新增:
99新增:Running an AI agent with full permissions is powerful but risky. Here's how the options compare:
100新增:
101新增:| | No sandbox | Docker | VM (agent-vm) |
102新增:|---|---|---|---|
103新增:| Agent can run any command | Yes | Yes | Yes |
104新增:| File system isolation | None | Partial (shared kernel) | Full |
105新增:| Network isolation | None | Partial | Full |
106新增:| Can run Docker inside | Yes | Requires DinD or socket mount | Yes (native) |
107新增:| Kernel-level isolation | None | None (shares host kernel) | Full (separate kernel) |
108新增:| Protection from container escapes | None | None | Yes |
109新增:| Browser / GUI tools | Host only | Complex setup | Built-in (headless Chromium) |
110新增:
111新增:Docker containers share the host kernel, so a motivated agent could exploit kernel vulnerabilities or misconfigurations to escape. A VM runs its own kernel — even if the agent gains root inside the VM, it can't reach the host.
112新增:
113新增:A VM also avoids the practical headaches of Docker sandboxing. Docker runs natively inside the VM without Docker-in-Docker hacks or socket mounts. Headless Chromium works out of the box without fiddling with `--no-sandbox` flags or shared memory settings. Lima automatically forwards ports from the VM to your host, so if the agent starts a server on port 3000, it's immediately accessible at `localhost:3000`. The agent gets a normal Linux environment where everything just works.
114新增:
115新增:Finally, using a VM means you don't need Node.js, npm, Docker, or any other dev tooling installed on your host machine. The only host dependency is Lima. All the tools (and their vulnerabilities) live inside the VM.
116新增:
117新增:For AI agents running with `--dangerously-skip-permissions`, a VM is the only sandbox that provides meaningful security.
118新增:
97119## License
98120
99121MIT
修改claude-vm.sh+1 −1看文件
@@ -73,7 +73,7 @@ claude-vm-setup() {
7373
7474 # Authenticate Claude (saves token in template, inherited by clones)
7575 echo "Setting up Claude authentication..."
76删除: limactl shell "$CLAUDE_VM_TEMPLATE" bash -lc "claude setup-token"
76新增: limactl shell "$CLAUDE_VM_TEMPLATE" bash -lc "claude 'Ok I am logged in, I can exit now.'"
7777
7878 # Configure Chrome DevTools MCP server for Claude
7979 echo "Configuring Chrome MCP server..."