Skip to content

Agents: explain policy-required sandboxing when it is unavailable - #344815

Merged
Ross Wollman (rwoll) merged 2 commits into
mainfrom
agents/sandbox-required-unavailable-banner
Oct 28, 2026
Merged

Ross Wollman (rwoll) merged 2 commits into
mainfrom
agents/sandbox-required-unavailable-banner

Conversation

@rwoll

@rwoll Ross Wollman (rwoll) commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

When organization policy requires terminal sandboxing (no bypass) and the machine can't run the sandbox, the Agents window banner said only "Sandboxing might not work as expected". It never mentioned the policy, so users couldn't tell why Disable Sandboxing was missing or that they need a host fix or their admin.

The banner now says "Sandboxing is required by your organization but isn't available on this machine", then: "Terminal commands can't run until this machine meets the sandbox requirements or your admin changes the policy.", followed by the host reason. It offers only Troubleshooting Guide. "Required" uses the same check that locks the permissions picker's sandbox toggle. Unmanaged, bypass-allowed, and fail-closed cases are unchanged.

Before: Insiders 1.145.0 (ea8056df) After: this branch
sandbox-banner-before.mp4
sandbox-banner-after.mp4

Recorded on Ubuntu 24.04 with user namespaces blocked, no slirp4netns, and /etc/github-copilot/managed-settings.json set to {"sandbox": {"enabled": true, "allowBypass": false}}.

Validation: npm run typecheck-client passed. npm run eslint on the changed files passed. ./scripts/test.sh --run src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostSandboxNotification.test.ts: 124 passing.

Related: #337535, #339841, #337331

🤖 Authored with GitHub Copilot on behalf of Ross Wollman (@rwoll).

When organization policy requires terminal sandboxing without a bypass and
the host cannot run the sandbox, the Agents window banner now says that the
organization requires sandboxing, keeps the host reason and Troubleshooting
Guide, and explains that terminal commands can't run until the machine meets
the requirements or the admin changes the policy. It never offers Disable
Sandboxing in this case. Unmanaged, bypass-allowed and fail-closed cases keep
the existing banner.

The required signal reuses the permissions picker's managed-floor check
(host-published session policy, or local renderer policy for the local
desktop host).

Co-authored-by: Copilot <[email protected]>

*🤖 Authored with GitHub Copilot on behalf of @rwoll.*
Copilot AI balanced review requested due to automatic review settings October 28, 2026 18:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the policy-specific sandbox warning change.

No open issues 🎉

What changed in this PR

Clarifies the Agent Host sandbox warning when organization policy requires sandboxing but the host cannot provide it, explaining why terminal commands are blocked and what must change.

Changes:

  • Reuses the permissions picker’s policy check to identify required sandboxing.
  • Adds localized policy-specific guidance while preserving existing behavior for unmanaged, bypass-allowed, fail-closed, and legacy-policy cases.
  • Adds tests for banner content, actions, live policy changes, and local renderer policy.
File Description
src/​vs/​workbench/​contrib/​chat/​test/​browser/​agentSessions/​agentHostSandboxNotification.test.ts Tests policy-specific warnings and updates across policy states.
src/​vs/​workbench/​contrib/​chat/​browser/​agentSessions/​agentHost/​agentHostSandboxNotification.ts Tracks required sandboxing and displays explanatory banner text.

Review effort: Balanced

Host sandbox reasons can be long and end with a bare URL, which buried the
explanation and ran it into the link when appended after the reason.

Co-authored-by: Copilot <[email protected]>

*🤖 Authored with GitHub Copilot on behalf of @rwoll.*
@rwoll Ross Wollman (rwoll) changed the title Explain policy-required sandboxing in the unavailable sandbox banner Agents: explain policy-required sandboxing when it is unavailable Oct 28, 2026
@rwoll
Ross Wollman (rwoll) marked this pull request as ready for review October 28, 2026 21:15
@rwoll
Ross Wollman (rwoll) enabled auto-merge (squash) October 28, 2026 21:15
@rwoll
Ross Wollman (rwoll) merged commit fcc1d13 into main Oct 28, 2026
51 checks passed
@rwoll
Ross Wollman (rwoll) deleted the agents/sandbox-required-unavailable-banner branch October 28, 2026 21:47
@vs-code-engineering vs-code-engineering Bot added this to the 1.145.0 milestone Oct 28, 2026
@rwoll Ross Wollman (rwoll) added agent-sandbox bug Issue identified by VS Code Team member as probable bug on-testplan labels Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-sandbox bug Issue identified by VS Code Team member as probable bug on-testplan

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants