fix(sandbox): 收敛沙箱 SSH 暴露并保留 GitHub 访问#579
Merged
Merged
Conversation
- Remove the default read-only SSH bind mount from sandbox create. - Keep GitHub access on the gh/HTTPS token path. - Cover docker run mounts with a regression test and docs updates. Co-Authored-By: Codex <noreply@openai.com> Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
Author
审查摘要
更新时间:2026-07-07 18:54:17+08:00 ✅ 人工验证已通过
关键技术决策
审查历程
测试结果
由 codex 自动生成 · 内部追踪:TASK-20260705-200010 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 相关问题 / Related Issue
Issue 链接 / Issue Link: Closes #576 👈👈
📋 变更类型 / Type of Change
📝 变更目的 / Purpose of the Change
当前默认沙箱会把宿主机
~/.ssh只读挂载到容器/home/devuser/.ssh,导致个人 SSH config、known_hosts、私钥、pem 文件和跳板机配置进入通用 agent 沙箱。本次变更收敛默认暴露面:移除通用 SSH 挂载,同时保留既有gh auth token->GH_TOKEN的 GitHub CLI / HTTPS token 访问路径。📋 主要变更 / Brief Changelog
ai sandbox create中宿主~/.ssh到容器/home/devuser/.ssh的默认只读挂载。/home/devuser/.ssh,且/workspace、/share/common、/share/branch核心挂载仍存在。.ssh示例替换为非敏感.cache示例,保留 WSL2/native/SELinux 覆盖。gh/ HTTPS token,既有沙箱需删除并重建以移除旧挂载。🧪 验证变更 / Verifying this Change
测试步骤 / Test Steps
node --experimental-strip-types --no-warnings --test tests/integration/cli/sandbox-core.test.tsnpm run test:corenpm testnpm run typechecknpm run test:core测试覆盖 / Test Coverage
📸 截图 / Screenshots
N/A
✅ 贡献者检查清单 / Contributor Checklist
基本要求 / Basic Requirements:
代码质量 / Code Quality:
测试要求 / Testing Requirements:
文档和兼容性 / Documentation and Compatibility:
📋 附加信息 / Additional Notes
0.8.3.git@github.com:*SSH workflow;如后续确有需要,应单独设计 GitHub 专用 SSH 通道。ai sandbox rm <branch>后重新ai sandbox create <branch>。docker inspect的 Mounts 不包含/home/devuser/.ssh,并确认gh auth status仍可用。审查者注意事项 / Reviewer Notes:
重点关注 Docker run 参数删除
.ssh挂载后,GitHub CLI 是否仍通过GH_TOKENenv-file 满足访问需求,以及文档中默认沙箱边界、dotfiles 保护和既有沙箱重建说明是否清晰。Generated with AI assistance