Repository navigation
Sandboxed agent cannot distinguish sandbox ro-bind from a real read-only filesystem — suggest an in-sandbox identity marker #9906
Replies: 3 comments
|
The argv is exactly what you observed, and it is not an accident of one profile. 1. What the sandbox actually builds
2. EROFS is the bubblewrap dialect, not a universal one
That matters for your report because Landlock keeps 3. One correction: the model already has a mode signalThe report's statement that there is no direct signal available inside the sandbox is true for the shell and for syscalls, but not for the agent. 4. On your three suggestions#1 ( #2 (translate #3 (tool-description caveat) — cheap and correct. The denial marker is taught in the tool description; the mount-table caveat is not. 5. The half no marker can fixWhen a real disk goes remount-ro, Recommendation: #1 + #3 now, and keep #2 out. If it helps, the |
|
Recommendation ① from this thread is now a published plugin:
It shadows The program on the inside can then act on it: if [ -n "$DSH_SANDBOX_MODE" ] && [ "$errno" = EROFS ]; then
echo "the dsh sandbox blocked this write; the disk is fine" >&2
fiWhy the marker goes there and not at
|
|
Publication status update: Verified through the registry's own version endpoint:
It shadows the instance's Two details from building it that matter for anyone reusing the idea:
|
Uh oh!
There was an error while loading. Please reload this page.
现象
bwrap --ro-bind / / ...下,agent 在 bash 内观测findmnt//proc/mounts会看到根盘为ro——这与内核因 ext4 错误 remount-ro 在现象上完全不可区分。真实案例(今天刚发生):agent 向工作区外的 Obsidian vault 写文件报
EROFS,据此误判为系统级文件系统故障并向用户发出紧急告警。排查后发现根盘始终正常(dmesg 无任何 ext4/remount 记录)——ro只是沙箱命名空间视图。舱内没有任何直接信号能区分这两种情况,判别只能靠「内核日志无对应记录」这类间接证据。影响
任何在沙箱 bash 里做系统诊断的 agent 都可能把沙箱视图当成系统真相,向外发虚警;更糟的是,真发生磁盘 remount-ro 时,沙箱内反而看不出来(
/反正永远是 ro),故障会被沙箱视图掩盖。判别参考(当前可用的 workaround)
沙箱内可用两步判别,无需出舱:
EXT4-fs error/Remounting filesystem read-only:真 remount-ro 必然留痕,沙箱 ro-bind 一条内核记录都不会有建议(按实现成本排序,任一即可)
--setenv DSH_SANDBOX_MODE=<policy>(复用现有DSH_*托管环境变量通道),agent 一条echo $DSH_SANDBOX_MODE即可自证观测位置EROFS时,翻译为现有的[sandbox: file access denied under <mode> mode]格式,与 shim 拦截消息保持一致环境
dsh 0.2.1-alpha.2,Linux,workspace-write 模式
All reactions