Repository navigation
Replies: 1 comment 1 reply
Independent confirmation on
|
| Effective | Requested | Justification | Expected result | Approver calls |
|---|---|---|---|---|
danger-full-access |
danger-full-access |
empty | keep danger-full-access |
0 |
danger-full-access |
workspace-write |
empty | keep danger-full-access (no downgrade) |
0 |
workspace-write |
workspace-write |
empty | keep workspace-write |
0 |
workspace-write |
danger-full-access |
empty | invalid justification |
0 |
workspace-write |
danger-full-access |
non-empty, allowed | return danger-full-access |
1 |
workspace-write |
danger-full-access |
non-empty, no service | requires approval |
0 |
workspace-write |
danger-full-access |
non-empty, rejected | user rejected |
1 |
read-only |
workspace-write |
non-empty, allowed | return workspace-write |
1 |
Tool-level coverage should include at least one Bash/Pwsh call and one Edit/Write call under an effective danger-full-access policy with all optional fields materialized.
Local verification of the proposed semantics
With the no-op check placed before reason validation, the exact first-attempt Bash and Edit calls shown above both completed with isError: false. A genuine workspace-write -> danger-full-access request still required a non-empty reason and invoked the approver exactly once.
This independently confirms the report and the safety argument in the original post on 0.1.1-rc.2.
Uh oh!
There was an error while loading. Please reload this page.
Problem
GPT-family models are heavily trained on shell-tool conventions where escalation fields (
with_escalated_permissions+justification) may ride any call speculatively. Under DSH they habitually attachsandbox_permissionstobashcalls whose effective mode already suffices, and the verbatim errorturns that trained habit into a hard failure loop: the model reads the error as a denial, escalates again (sometimes inventing a
justificationsuch as"none"to satisfy the non-empty check), and burns turn after turn without ever running the command.Observed live on
dsh web(0.1.0-rc.7, reproduced on 0.1.1-rc.1 sources) with GPT-series models in the executor role: every singlebashcall failed this way, across fresh sessions, and the model eventually routed around its own shell by delegating to subagents — which inherit the same habit.Prompt-level mitigation does not stick. We tried twice with increasingly explicit persona rules (down to "when you see
not strictly wider, drop both fields and resend"); the habit is trained in, and the tool description's own escalation clause ("escalating up front is fine only when this session already denied the same access") reinforces the loop after the first error, because the model misreads the argument error as a denial.Why a no-op is safe
A non-widening request is behaviorally identical to the call the model should have made:
A non-widening request never prompts a human);justification+ user approval throughctx.approvalare all still required before anything runs wider.The only thing that changes is that a semantically meaningless argument stops being a hard error that burns the call.
sandbox_permissions(any justification state)not strictly widererror, command never runsjustificationonly valid together with sandbox_permissionserrorjustificationComplete implementation, ready to take
Since external PRs are not accepted at this stage, we put the full change on a public branch — feel free to cherry-pick or reimplement:
https://github.com/Rogers-F/deepseek-harness/tree/fix/tolerate-non-widening-sandbox-escalation
Scope (15 files, +104/−98):
packages/sandbox/sandbox/src/escalation.ts—approveEscalationresolves a non-widening request as a no-op grant of the call's effective mode; the justification checks move into the widening path (an approval prompt still never fires without a reason);validateEscalationArgsis removed since the widening path now owns its guards and a lone justification drives nothing.tool-bash/tool-pwsh/tool-fs— enter escalation onsandbox_permissionsalone and delegate the judgment toapproveEscalation.pnpm typecheckclean; lefthook staged gates pass).Happy to rework it behind a config switch instead of the new default if you'd prefer, or adjust in any other direction — the branch is there to be taken, not to be merged as-is.
中文摘要
问题:GPT 系模型被 Codex 风格的 shell 工具约定(
with_escalated_permissions+justification可随时预防性携带)深度训练过,在 DSH 里会习惯性地给bash调用带上sandbox_permissions。当会话已是最宽模式时,not strictly wider硬报错会让模型把"参数错误"误读成"沙箱拒绝",于是反复升权、连环失败,一条命令都跑不成,最终绕道子代理(子代理同样带这个习惯)。提示词层面压制两轮均告失败——这是训练进权重里的惯性。方案:未拓宽的升权请求改为无操作放行(按当前模式照常执行,不弹任何审批)——它与"模型本该发出的那次调用"行为完全等价,安全面零变化;真正要求拓宽的请求完整保留 fail-closed 链路:严格更宽 + 非空理由 + 用户审批,缺一不可。
完整实现已放在上面的公开分支(含 4 个包的源码、测试、中英文档同步,相关 230 个测试全绿),欢迎直接 cherry-pick;如果团队倾向做成配置开关而非默认行为,我们也乐意配合调整。
All reactions