You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pwsh advertises non-widening sandbox escalation options in danger-full-access sessions
#138
In a Windows Web UI session whose effective sandbox mode is already danger-full-access, the agent repeatedly adds sandbox_permissions to ordinary pwsh calls. The calls are rejected before execution because the requested mode is equal to or narrower than the current mode.
The strict-widening validation is correct and should remain fail-closed. The problem is that the tool surface still advertises escalation fields/options in a context where no wider mode exists, and the validation error does not give the agent an explicit recovery action.
Effective session mode: Full access (danger-full-access)
Provider / model: github-copilot / gpt-5.6-sol
Reproduction
Start a session in Full access mode and ask the agent to inspect a local repository or run a read-only GitHub CLI command. The agent emitted these calls:
{
"command": "gh pr diff 15504 --repo microsoft/copilot-intellij --name-only",
"description": "List pull request changed files",
"timeoutMs": 30000,
"workdir": "C:\Users\junshanchen\code\copilot-intellij",
"run_in_background": false,
"sandbox_permissions": "danger-full-access",
"justification": "No escalation is intended; this is a read-only network query."
}
Result:
Error: sandbox escalation to "danger-full-access" is not strictly wider than this call's current "danger-full-access" mode
It then tried a narrower mode:
{
"command": "Get-Location; git status --short --branch; git remote -v",
"description": "Inspect repository state and remotes",
"timeoutMs": 20000,
"workdir": "C:\Users\junshanchen\code\copilot-intellij",
"run_in_background": false,
"sandbox_permissions": "workspace-write",
"justification": "x"
}
Result:
Error: sandbox escalation to "workspace-write" is not strictly wider than this call's current "danger-full-access" mode
Running the first command again withoutsandbox_permissions and justification succeeds.
Expected behavior
For an effective danger-full-access session, ordinary commands should be issued without escalation fields. If the model does make this invalid call, the tool result should make recovery unambiguous, for example:
The current mode is already danger-full-access; no wider mode exists. Retry the same command without sandbox_permissions and justification.
The next attempt should then execute normally.
Why this appears to be a harness/tool-contract issue
However, the optional sandbox_permissions field is exposed with the global escalation target enum whenever a sandboxing executor is mounted. In a session already running at danger-full-access, those advertised choices cannot produce a valid widening request. The shared validator correctly rejects them, but the agent can then repeat the malformed request instead of removing the fields.
Suggested improvement
Any of these would address the loop while preserving fail-closed behavior:
Do not advertise sandbox_permissions when the effective session mode has no strictly wider target, if per-session tool schemas are possible.
Otherwise, include the effective current mode and valid strictly-wider targets in runtime tool context.
For the non-widening validation error, explicitly instruct the agent to retry without both escalation fields when no wider target exists.
Add an agent-loop regression test for danger-full-access: after at most one invalid escalation attempt, the next call omits the two fields and executes.
Please do not silently strip escalation fields at execution time; retaining explicit validation is safer.
Acceptance criteria
In a danger-full-access session, an ordinary pwsh command either:
is emitted without sandbox_permissions / justification on the first attempt, or
recovers after one validation error by retrying without those fields,
and the command is not blocked by repeated non-widening escalation requests.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Summary
In a Windows Web UI session whose effective sandbox mode is already
danger-full-access, the agent repeatedly addssandbox_permissionsto ordinarypwshcalls. The calls are rejected before execution because the requested mode is equal to or narrower than the current mode.The strict-widening validation is correct and should remain fail-closed. The problem is that the tool surface still advertises escalation fields/options in a context where no wider mode exists, and the validation error does not give the agent an explicit recovery action.
Environment
0.1.0-rc.647f943859bef60e4160492346772ded9b24f765adanger-full-access)github-copilot/gpt-5.6-solReproduction
Start a session in Full access mode and ask the agent to inspect a local repository or run a read-only GitHub CLI command. The agent emitted these calls:
{ "command": "gh pr diff 15504 --repo microsoft/copilot-intellij --name-only", "description": "List pull request changed files", "timeoutMs": 30000, "workdir": "C:\Users\junshanchen\code\copilot-intellij", "run_in_background": false, "sandbox_permissions": "danger-full-access", "justification": "No escalation is intended; this is a read-only network query." }Result:
It then tried a narrower mode:
{ "command": "Get-Location; git status --short --branch; git remote -v", "description": "Inspect repository state and remotes", "timeoutMs": 20000, "workdir": "C:\Users\junshanchen\code\copilot-intellij", "run_in_background": false, "sandbox_permissions": "workspace-write", "justification": "x" }Result:
Running the first command again without
sandbox_permissionsandjustificationsucceeds.Expected behavior
For an effective
danger-full-accesssession, ordinary commands should be issued without escalation fields. If the model does make this invalid call, the tool result should make recovery unambiguous, for example:The next attempt should then execute normally.
Why this appears to be a harness/tool-contract issue
The current pwsh instructions correctly say:
Source:
packages/shell/tool-pwsh/src/index.tsHowever, the optional
sandbox_permissionsfield is exposed with the global escalation target enum whenever a sandboxing executor is mounted. In a session already running atdanger-full-access, those advertised choices cannot produce a valid widening request. The shared validator correctly rejects them, but the agent can then repeat the malformed request instead of removing the fields.Suggested improvement
Any of these would address the loop while preserving fail-closed behavior:
sandbox_permissionswhen the effective session mode has no strictly wider target, if per-session tool schemas are possible.danger-full-access: after at most one invalid escalation attempt, the next call omits the two fields and executes.Please do not silently strip escalation fields at execution time; retaining explicit validation is safer.
Acceptance criteria
In a
danger-full-accesssession, an ordinarypwshcommand either:sandbox_permissions/justificationon the first attempt, orand the command is not blocked by repeated non-widening escalation requests.
All reactions