Repository navigation
Sandbox escalation error when session is already at danger-full-access #4383
Replies: 3 comments
|
Verified against rc.2 (HEAD b150a55) β this is the third independent report of the same family: #3519 (hytime, 2026-08-20, same-mode 1. rc.2 confirms every claim
2. The gap: #4359's patch collapses only the equal-mode caseZergZFZ's fix ( That fixes your first error string ( The redundant-request tolerance must therefore use the same predicate as the strict-wider check: collapse whenever 3. Regression matrix additionYour "additional coverage" list (model-visible schema, approval prompt count β zero for redundant, background/foreground) maps onto the 11-check matrix already posted in #4359. Worth adding the narrower-redundant rows β |
|
Additional reproduction from a Linux/WSL2 installation using the published CLI:
A simple request to run The installed DSH implementation confirms that the source bash schema only marks This reproduces the issue outside a delegated subagent and with an OpenAI Responses-compatible custom provider. The robust fix should preserve fail-closed behavior for genuine widening while treating same-mode (and, as noted above, otherwise non-widening) requests as no-op execution under the standing policy. It should also keep the malformed lone- |
|
Same defect as #4359 (the strictly-wider check can never accept the mode the call already holds, and danger-full-access has no wider mode). Fixed in our fork by treating a same-mode request as an idempotent grant - a one-line guard before the strictly-wider check returns the effective mode; no prompt, no error, identical to omitting the parameter. Semantics discussed on #4359. |
Uh oh!
There was an error while loading. Please reload this page.
Sandbox escalation error when session is already atΒ
danger-full-accessSummary
When a session's effective sandbox mode isΒ
danger-full-access, the bash, pwsh, and filesystem tools still advertiseΒsandbox_permissionsΒ +ΒjustificationΒ parameters in their tool schema. If the model attaches these parameters (which it does frequently), every such call fails with:or, for a narrower redundant request:
This wastes tokens on failed tool calls and retry loops, especially in subagent scenarios where the child session inherits the parent'sΒ
danger-full-accessΒ override viaΒsource: 'delegation'Β events.Root Cause
Three components share the same pattern:
1. Schema is registry-global, effective mode is per-call
escalationModesΒ is determined once at plugin load time:ESCALATION_TARGETSΒ is alwaysΒ['workspace-write', 'danger-full-access']Β regardless of the session's current effective mode. The source comment inΒescalation.tsΒ (lines 37-41) explains this is intentional β schema is registry-global, effective mode is per-call, so the enum can't be narrowed without stranding sessions that were switched to a narrower mode.2.Β
validateEscalationArgsΒ runs before effective mode is resolvedInΒ
validateBashArgsΒ /ΒvalidatePwshArgs:This is called at the top ofΒ
validateXxxArgs,Β beforeΒresolveSandboxPolicy(exec)Β runs in theΒexecuteΒ path. So even if the escalation request is redundant, an empty or missingΒjustificationΒ throws first:3.Β
approveEscalationΒ has no redundant-request toleranceInΒ
escalation.tsΒ (lines 162-163):WIDER_MODESΒ has no entry forΒ'danger-full-access', soΒWIDER_MODES['danger-full-access']Β isΒundefined, falling back toΒ[]. Any mode the model requests will fail the check.4. Subagent inheritance amplifies the problem
child-agent.tsΒ (lines 199-204) captures the parent's explicit sandbox override and seeds it into the child asΒsource: 'delegation'. The child's approval policy is also pinned toΒ'never'. So a subagent of aΒdanger-full-accessΒ parent:danger-full-accessΒ as its effective mode'never')sandbox_permissionsΒ in the tool schemaAffected Files
File | Package -- | -- packages/sandbox/sandbox/src/escalation.ts | @deepseek-ai/dsh-sandbox packages/shell/tool-bash/src/index.ts | @deepseek-ai/dsh-tool-bash packages/shell/tool-pwsh/src/index.ts | @deepseek-ai/dsh-tool-pwsh packages/fs/tool-fs/src/sandbox.ts | @deepseek-ai/dsh-tool-fsAdditional coverage:
All reactions