Replies: 10 comments 4 replies
|
补充一组 macOS + Luna 的复现证据,现象与本讨论一致。 环境:
复现:
额外验证:
期望:
未包含任何 token、私有路径或会话内容。 |
|
补充一组 macOS + GPT-5.6 Terra 的复现与验证证据,现象与本讨论一致。 环境:
复现:
实际捕获到的完整 Bash 参数中, 本地验证性修复:
验证结果:
这支持方案 A:当请求的目标权限等于或低于当前有效权限时,应将升级字段视为冗余,而不是在命令执行前拒绝调用。未包含 token、私有路径或会话内容。 |
|
感谢 @MisonL、@luochenw 提供的 macOS + 第三方 provider 跨平台复现证据,以及 @t734070824 的最小修复线索(保持请求模式等于当前有效模式时直接放行)。三组验证共同确认了根因方向:模型沿用窄权限升级参数在最高权限模式下被误判为非法升级。感谢各位补全边界。 |
|
I’ve published a small compatibility shim that addresses this failure mode at the model-facing schema layer: https://github.com/xiaohj233/dsh-compat-shims/tree/main/packages/sandbox-schema-shim When the current session is already running with This prevents the model from generating redundant escalation arguments in Full Access mode, including the cases discussed above:
The shim does not modify the actual sandbox permissions, approval policy, or tool execution path. It’s intended as a plugin-based workaround that does not patch upstream files or alter the sandbox/approval execution path, until the issue is fixed upstream. |
|
我自己弄了个治标不治本思路解决了下,差不多就是在 DSH 的底层沙箱模块加一行兜底判断 改成: 改完后重启 DSH。GPT 系列模型有时会在工具调用里自动补 sandbox_permissions。 |
|
有一个插件不知道有没有用,而且这个非常影响使用,我添加litellm的gpt模型,一开启,必现 请帮我安装 DeepSeek Harness (DSH) 插件「dsh-sandbox-escalation-fix」。
|
|
Follow-up with a tested fix, since external PRs appear to be disabled on this mirror: branch Root cause. Fix. Make non-widening requests idempotent instead of fatal:
This is safer than the Included. Rank-based check ahead of the strict-widening gate; updated escalation specs in Happy to adjust if maintainers prefer a different shape — the branch is a single commit and cherry-picks cleanly onto |
|
用它自家模型就没有问题 |
|
I can reproduce this on Windows PowerShell with:
Expected: Actual: sandbox escalation to "danger-full-access" is not strictly wider than this call's Impact: Suggested direction: 我在 Windows PowerShell 环境复现了该问题:
预期行为: 当当前会话已经处于 实际行为: Web 工具接口要求调用时传入 |
|
我甚至用codex开sol去改dsh的配置搞了2个小时,然后才搜到这个页面bug,掉了20根头发。疯了真的是 |
Uh oh!
There was an error while loading. Please reload this page.
摘要
#340 的现象("开启 full access 前提下,运行期提示
sandbox escalation to "workspace-write" is not strictly wider than this call's current "danger-full-access" mode")的根因不是权限比较逻辑算错,而是升级表面的三个设计缺口叠加:①dsh-sandbox的WIDER_MODES阶梯表(read-only → workspace-write → danger-full-access)按设计在 danger-full-access 上没有更宽的合法目标,任何带sandbox_permissions的重试都会抛这条错误;② 但工具的sandbox_permissions字段无论当前模式一律广告(schema enum 是注册表全局的ESCALATION_TARGETS,代码注释自陈这是为了"默认模式是 full access 但会话被切窄"的场景而保留的全局面);③ 模型此前在较窄模式下收到过 denial + "retry with sandbox_permissions"提示,用户切到 full access 后模型照提示重试 → 触发降级升级 → 一条读起来像"产品自己判定自己权限不够"的错误。用户因此误判"full access 有时不生效"。根因(源码定位,rc.6)
dsh-sandbox/lib/index.jsWIDER_MODES(L29-32):danger-full-access无键 →approveEscalation(L94)!(WIDER_MODES[effectiveMode] ?? []).includes(mode)→ 抛"not strictly wider"。判定本身正确:从 full access 升级到 workspace-write 是降级。
ESCALATION_TARGETS恒为两个目标;工具 schema 的 enum 是注册表全局,无法按会话当前模式裁剪(L34-40 注释解释了保留全局面的理由)。
escalationHintMarker(L75-77)教模型"retry with sandbox_permissions (the narrowest wider mode that suffices)"。
会话切到 full access 后,模型照旧重试 → 撞 L94 的拒绝。
对用户读起来就是"权限系统出了 bug"(权限模式是不是有 bug,full access 有时不生效 #340 的标题即如此解读)。
复现步骤
workspace-write,让模型执行一次会被拒的写入 → 收到[sandbox: file access denied ...]+ escalation 提示。danger-full-access(此后该写入本可直接成功)。sandbox_permissions: "workspace-write"+ justification 重试。sandbox escalation to "workspace-write" is not strictly wider than this call's current "danger-full-access" mode(权限模式是不是有 bug,full access 有时不生效 #340 原文)——尽管此时不带该参数的同一调用完全能成功。
建议修复
方案 A(推荐)· 降级升级静默放行:
approveEscalation在判定"非严格更宽"时,先判断
mode是否等于/窄于effectiveMode——若是,直接返回effectiveMode(视为多余的升级参数,不弹审批、不报错),调用按当前更宽模式正常执行。
语义完全正确:请求者想获得的能力当前已经有了。
方案 B · 按会话模式裁剪提示面:当前模式为
danger-full-access时,denial提示不再附带 escalation hint(该模式本无 denial,此路径主要影响 A 之外的
直接升级尝试),并在错误文案中明确"当前已是最宽模式,无需升级"。
方案 C(文案):把 L94 的错误拆成两条:请求模式窄于当前 → "this call
already runs under the wider mode X; sandbox_permissions is unnecessary";
请求模式并列/未知 → 保留现有文案。至少消除"产品 bug"的误读。
影响
报告错误结论
均属 escalation 表面问题而非边界穿透)
环境
验证材料
First analysis of discussion #340. Happy to open a PR with fix option A.
All reactions