Repository navigation
Redundant same-mode sandbox_permissions may be better treated as a no-op #1292
Replies: 3 comments
|
沙箱权限冗余配置值得梳理——我们在第 13 章(安全与沙箱模型)整理了权限模型(工具权限分级/沙箱边界),配置的口径说明可参考:https://github.com/Electricitysheep/dsh-handbook/blob/main/docs/13-security.md |
|
I searched Discussions more carefully and found this overlaps with prior reports, especially #138, #468, #1141, #1149, #1201, and #1069. The common theme seems to be that models sometimes emit The small distinction I wanted to raise here is the same-mode case specifically, e.g. If maintainers consider this covered by the existing discussions, I am happy to treat this as a duplicate / supporting example. |
|
同意——同模式重复的 sandbox_permissions 应该 no-op(当前行为相当于隐式覆盖,易误导)。 权限模型的"最小权限/幂等"设计我们第 13 章有整理(工具权限分级/沙箱边界),可参考设计口径:https://github.com/Electricitysheep/dsh-handbook/blob/main/docs/13-security.md |
Uh oh!
There was an error while loading. Please reload this page.
Redundant same-mode
sandbox_permissionsmay be better treated as a no-opHi DeepSeek Harness team,
First, thank you for open-sourcing and documenting the sandbox/approval system. I ran into a small ergonomics issue while using the harness with a tool-calling model, and I wanted to raise it tentatively because it may be more of a UX/model-compatibility issue than a security bug.
Summary
When the current sandbox mode is already
workspace-write, a tool call that redundantly includes:fails with:
This is consistent with the current strict escalation semantics, but in practice it can be brittle for LLM tool callers. Some models may include optional fields from the schema even when they are redundant, especially after seeing previous examples or when trying to be explicit about the intended permission level.
Why this is inconvenient
In my session, the active policy was already
workspace-write. The model repeatedly includedsandbox_permissions: "workspace-write"in file/write/bash calls. Since this was not strictly wider than the current mode, the call failed before doing otherwise valid workspace-local work.This became especially inconvenient with a model like
gpt-5.6-sol, which tends to preserve optional schema fields once they appear in context. The model then had to learn to omit the field entirely, even though the requested mode was harmless and equal to the standing mode.The practical failure mode is:
workspace-write.sandbox_permissions: "workspace-write"and a justification.Current behavior
From the current implementation, this appears intentional:
validateEscalationArgs()requiressandbox_permissionsandjustificationto travel together.approveEscalation()requires the requested mode to be strictly wider than the effective mode.packages/sandbox/sandbox/tests/escalation.spec.tscover non-widening requests failing closed.So I understand this may have been designed as a conservative interpretation of the escalation fields.
Suggested behavior
Would you consider treating same-mode requests as a no-op?
For example:
before the strict-wider approval path.
That would preserve the important security behavior:
read-only -> workspace-write: still a real escalation, requires approval.workspace-write -> danger-full-access: still a real escalation, requires approval.Optionally, validation could also be relaxed so that a stray
justificationor same-modesandbox_permissionsdoes not fail a call before the effective mode is known. The non-empty justification requirement would still apply when the request is genuinely widening.Why this seems safe
A same-mode request does not grant any new capability. It only restates the existing effective sandbox mode.
Treating it as a no-op would make the tool interface more forgiving for models that sometimes over-specify optional fields, without weakening the approval boundary for actual privilege escalation.
Possible test cases
and existing tests should still pass for:
Context
This came up while using DSH in
workspace-writemode with a model that generated repeated tool calls containing redundantsandbox_permissions. The resulting errors were correct under the current implementation, but difficult for the model to recover from reliably.Thanks again for the work on the harness. I’m raising this as a small compatibility/ergonomics improvement rather than a hard correctness claim.
All reactions