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 advertisesandbox_permissions+justificationparameters 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-accessoverride viasource: 'delegation'events.Root Cause
Three components share the same pattern:
1. Schema is registry-global, effective mode is per-call
escalationModesis determined once at plugin load time:ESCALATION_TARGETSis always['workspace-write', 'danger-full-access']regardless of the session's current effective mode. The source comment inescalation.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.
validateEscalationArgsruns before effective mode is resolvedIn
validateBashArgs/validatePwshArgs:This is called at the top of
validateXxxArgs, beforeresolveSandboxPolicy(exec)runs in theexecutepath. So even if the escalation request is redundant, an empty or missingjustificationthrows first:3.
approveEscalationhas no redundant-request toleranceIn
escalation.ts(lines 162-163):WIDER_MODEShas no entry for'danger-full-access', soWIDER_MODES['danger-full-access']isundefined, 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 assource: 'delegation'. The child's approval policy is also pinned to'never'. So a subagent of adanger-full-accessparent:danger-full-accessas its effective mode'never')sandbox_permissionsin 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