Skip to content

agentHost: retire legacy sandbox policy enforcement - #339396

Merged
Ross Wollman (rwoll) merged 4 commits into
mainfrom
rwoll/revert-legacy-sandbox-policy
Oct 2, 2026
Merged

Ross Wollman (rwoll) merged 4 commits into
mainfrom
rwoll/revert-legacy-sandbox-policy

Conversation

@rwoll

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

Copy link
Copy Markdown
Member

Summary

Retire legacy VS Code sandbox policies from the Copilot Agent Host policy contract and roll back the mandatory legacy sandbox requirement added by #339144. Enterprise sandbox enforcement in Agent Host should use Copilot managed settings, not migration of the old preview device policies.

  • Remove the connection-owned legacy sandbox requirement, while retaining native managed sandbox enforcement and the later session-restoration/reconciliation fixes.
  • Mark nine legacy sandbox settings deprecated, keep their migration notices visible, and preserve their defaults. Add deprecation and replacement guidance to the four device-policy descriptions and generated catalog.
  • Classify those four retired policies as notApplicable, rather than outstanding Agent Host parity gaps. Update diagnostics, tests, and contributor documentation together. New Agent Host sandbox controls are not deprecated.

Admin and user impact

ChatAgentSandboxEnabled: on no longer guarantees sandboxing in Agent Host. Existing setting forwarding remains, so it can supply an On default, but a session Off selection can override it.

To require sandboxing in Copilot Agent Host, use native managed sandbox.enabled: true. Use sandbox.allowBypass: false when bypass must be prohibited. Outbound network restrictions use sandbox.userPolicy.network.allowOutbound.

Local harness behavior is unchanged. Native managed restrictions, permitted-bypass controls, restored-session reconciliation, and other legacy permission translations remain intact. notApplicable records the retirement of the legacy policy contract; it does not mean forwarded settings have no effect or certify enforcement parity.

The deprecated device policies are ChatAgentSandboxEnabled, ChatAgentSandboxAllowNetwork, ChatAgentSandboxAllowUnsandboxedCommands, and ChatAgentSandboxAllowAutoApprove.

Validation

  • Rebased onto current main; core compilation completed with zero errors.
  • 528 focused tests passed, covering native sandbox enforcement, restoration, bypass/fail-closed behavior, ordinary forwarding, connection lifecycle, deprecation metadata, catalog classifications, and diagnostics.
  • A test-only follow-up fixes two stale CI expectations. Both failures were reproduced locally, then the affected suites passed 69 tests in Electron and 68 in WebKit, including unchanged Local/Copilot rollout selection.
  • Targeted hygiene and whitespace checks passed.
  • Canonical Workbench and Agents policy-export check passed.

Live MDM deployment was not exercised. Release notes and sandbox migration guidance have also been updated locally in vscode-docs for separate publication.

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

Roll back the connection-owned sandbox requirement from #339144 while preserving native managed sandbox enforcement, restoration and ordinary setting forwarding. Deprecate the legacy settings and device policies, and mark the retired policy surface not applicable to Agent Host.

*🤖 Authored with GitHub Copilot on behalf of @rwoll.*

Co-authored-by: Copilot <[email protected]>
@vs-code-engineering

vs-code-engineering Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Raymond Zhao (@rzhao271)

Matched files:

  • src/vs/workbench/contrib/preferences/test/browser/settingsTree.test.ts

Anthony Kim (@anthonykim1)

Matched files:

  • src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration.ts
  • src/vs/workbench/contrib/terminalContrib/chatAgentTools/test/common/terminalChatAgentToolsConfiguration.test.ts

Reviewed-head: 12996d7
Pull-request: #339396
Approved-by: rwoll via PR Sign-Off
Requested-by: copilot

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.

Copilot review overview

🔵 Needs a closer look

Removing an enterprise sandbox enforcement guarantee warrants maintainer sign-off, especially without live deployment migration validation.

Review effort: Balanced
Findings: None

What changed in this PR

Retires legacy sandbox policy enforcement in Copilot Agent Host in favor of native managed settings, while preserving Local behavior.

Changes:

  • Removes connection-owned mandatory sandbox requirements while retaining ordinary setting forwarding.
  • Deprecates nine legacy settings and updates four device-policy descriptions and classifications.
  • Aligns diagnostics, tests, and contributor guidance with the retired policy contract.
File Description
src/​vs/​workbench/​test/​browser/​actions/​policyDiagnosticsMarkdown.test.ts Updates readiness output expectations.
src/​vs/​workbench/​contrib/​terminalContrib/​chatAgentTools/​test/​common/​terminalChatAgentToolsConfiguration.test.ts Tests deprecation metadata and unchanged defaults.
src/​vs/​workbench/​contrib/​terminalContrib/​chatAgentTools/​common/​terminalChatAgentToolsConfiguration.ts Adds deprecations and replacement guidance.
src/​vs/​platform/​agentHost/​test/​node/​sessionSandbox.test.ts Tests overridable defaults and native requirements.
src/​vs/​platform/​agentHost/​test/​node/​protocolServerHandler.test.ts Retains permission lifecycle coverage without legacy sandbox contributions.
src/​vs/​platform/​agentHost/​test/​node/​agentHostPolicySupport.test.ts Checks retired policy classifications.
src/​vs/​platform/​agentHost/​test/​node/​agentHostManagedSettingsService.test.ts Removes legacy requirement aggregation tests.
src/​vs/​platform/​agentHost/​test/​node/​agentHostBootstrap.test.ts Verifies permissions remain separate from sandbox policy.
src/​vs/​platform/​agentHost/​test/​electron-browser/​agentHostProtocolClient.test.ts Checks legacy requirements are no longer transmitted.
src/​vs/​platform/​agentHost/​test/​common/​agentHostPolicyReadiness.test.ts Excludes retired policies from readiness gaps.
src/​vs/​platform/​agentHost/​node/​protocolServerHandler.ts Removes legacy sandbox notification handling.
src/​vs/​platform/​agentHost/​node/​agentServiceFoundation.ts Removes obsolete configuration-service dependency.
src/​vs/​platform/​agentHost/​node/​agentHostManagedSettingsService.ts Removes client sandbox requirement aggregation.
src/​vs/​platform/​agentHost/​node/​agentConfigurationService.ts Resolves sandbox requirements from runtime policy only.
src/​vs/​platform/​agentHost/​common/​meta/​vscode/​agentSandboxPolicyMeta.ts Clarifies runtime ownership in documentation.
src/​vs/​platform/​agentHost/​common/​agentHostPolicySupport.ts Marks four retired policies not applicable.
src/​vs/​platform/​agentHost/​common/​agentHostPolicyReadiness.ts Removes retired-policy gap handling.
src/​vs/​platform/​agentHost/​browser/​agentHostProtocolClient.ts Stops forwarding legacy mandatory requirements.
src/​vs/​platform/​agentHost/​AGENTS.md Documents runtime-only mandatory enforcement.
build/​lib/​policies/​policyData.jsonc Updates exported descriptions and classifications.
.github/​skills/​policy-and-managed-settings/​policy-support-maintenance.md Clarifies retired-policy classification boundaries.
.github/​skills/​policy-and-managed-settings/​legacy-permission-policy.md Documents retirement and migration guidance.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 734b233a Current: fc9bdb53

Changed (2)

sessions/accountMenu/WeeklyLimitOnly/Light
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/DiscoverPluginsLoadingMore/Light
Before After
before after

3 insignificant change(s) omitted (≤20 px, Δ≤2). See CI logs for details.

Keep rollout-selection coverage for all four retired sandbox policies while expecting no readiness gaps. Update the Settings editor renderer assertion for the completed deprecation notice without changing product behavior.

*🤖 Authored with GitHub Copilot on behalf of @rwoll.*

Co-authored-by: Copilot <[email protected]>
Reviewed-head: 8642ef8
Pull-request: #339396
Approved-by: rwoll via PR Sign-Off
Requested-by: copilot
@rwoll
Ross Wollman (rwoll) merged commit a76ce4f into main Oct 2, 2026
35 checks passed
@rwoll
Ross Wollman (rwoll) deleted the rwoll/revert-legacy-sandbox-policy branch October 2, 2026 22:42
@vs-code-engineering vs-code-engineering Bot added this to the 1.141.0 milestone Oct 2, 2026
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Nov 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants