在隔离的虚拟机中运行 Claude Code 以打开 PR
Run Claude Code in an isolated VM that opens PRs
Claude Code 已完成。作者在受限制的虚拟机中运行 Claude Code,其中密钥由 Infisical 提供。它只能在 Forgejo 上创建问题和 PR,CI 部署前合并是手动的。
做了什么
Claude Code runs in its own VM on a heavily restricted VLAN that can reach only the internet, the author's Forgejo instance, Infisical, and one-way SSH from the author's machine. Secrets come through Infisical, so the agent never sees them. Its Forgejo user can only create issues and PRs. The author merges manually, then CI packages and deploys to an app server VM.
效果如何
The source gives no measured results. It describes the setup as overkill but worth it to cut the risk of personal data exfiltration. Dev mode can still expose some secrets locally.
值得注意
In local dev mode the agent may still see secrets, so the Infisical protection only fully holds outside that mode.
试试这个 Prompt
Help me set up a locked-down virtual machine for running you on my project [repo name]. Give it only the permissions it needs: reading the code, getting secrets from [secrets manager], and opening issues and pull requests on [Git host], with no ability to merge. Walk me through the setup step by step, and finish by having it open a small test pull request. Pause and show me each command that changes my system or credentials before you run it.