Simplify agent sandbox settings#323224
Open
dileepyavan wants to merge 5 commits into
Open
Conversation
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @anthonykim1Matched files:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the agent terminal sandbox settings model by splitting sandbox enablement from “allow all network domains”, while preserving legacy configuration compatibility via normalization and migrations. It also forwards the new setting through to the agent-host schema and SDK config generation, and updates UI + tests accordingly.
Changes:
- Converts
chat.agent.sandbox.enabled/chat.agent.sandbox.enabledWindowsfromoff|on|allowNetworkto booleans and introduceschat.agent.sandbox.allowNetworkas the separate opt-in. - Adds normalization + configuration migrations to keep legacy enum/boolean inputs working and to forward the canonical agent-host
on|off|allowNetworkvalues. - Updates terminal sandbox runtime behavior, agent-host schema forwarding, UI toggle persistence, docs strings, and related tests/fixtures.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/test/browser/componentFixtures/chat/renderChatInput.ts | Updates chat input fixture to use boolean sandbox enablement. |
| src/vs/workbench/contrib/terminalContrib/chatAgentTools/test/common/sandboxSettingsReader.test.ts | Adds test coverage for boolean enabledWindows normalization. |
| src/vs/workbench/contrib/terminalContrib/chatAgentTools/test/browser/terminalSandboxService.test.ts | Updates Windows sandbox routing tests for split enablement vs allow-network. |
| src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration.ts | Converts sandbox settings to boolean, adds the new allowNetwork setting + policy metadata. |
| src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/sandboxSettingsReader.ts | Forwards/normalizes new sandbox keys (including allowNetwork) for agent-host propagation. |
| src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.ts | Ensures sandbox config refresh reacts to allowNetwork changes. |
| src/vs/workbench/contrib/terminal/terminalContribExports.ts | Exposes the new AgentSandboxAllowNetwork setting id via terminal contrib exports. |
| src/vs/workbench/contrib/terminal/common/terminalConfiguration.ts | Adds migrations from legacy enum values to new booleans + allowNetwork. |
| src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.ts | Updates permission picker toggle to persist boolean + choose enabledWindows on Windows. |
| src/vs/workbench/contrib/chat/browser/chat.shared.contribution.ts | Updates network domain setting docs to reference chat.agent.sandbox.allowNetwork. |
| src/vs/platform/sandbox/test/common/terminalSandboxEngine.test.ts | Updates sandbox engine tests for independent enablement and allow-network behavior. |
| src/vs/platform/sandbox/common/terminalSandboxEngine.ts | Updates runtime enablement/allow-network evaluation for the new setting model. |
| src/vs/platform/sandbox/common/settings.ts | Introduces chat.agent.sandbox.allowNetwork id and shared normalization helpers. |
| src/vs/platform/agentHost/node/copilot/sandboxConfigForSdk.ts | Updates SDK config generation to honor enabled + allowNetwork combination. |
| src/vs/platform/agentHost/common/sandboxConfigSchema.ts | Extends agent-host sandbox schema + mapping with the new allowNetwork key. |
| build/lib/policies/policyData.jsonc | Updates generated policy catalog output to reflect the new/updated settings. |
Review details
- Files reviewed: 16/16 changed files
- Comments generated: 2
- Review effort level: Low
Comment on lines
+486
to
+490
| "key": "chat.agent.sandbox.allowNetwork", | ||
| "name": "ChatAgentSandboxAllowNetwork", | ||
| "category": "IntegratedTerminal", | ||
| "minimumVersion": "1.117", | ||
| "localization": { |
92ec394 to
f4bf05b
Compare
lszomoru
previously approved these changes
Jun 27, 2026
alexdima
approved these changes
Jun 27, 2026
roblourens
approved these changes
Jun 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Simplifies agent sandbox configuration by separating sandbox enablement from unrestricted network access while retaining enum-backed enablement settings. The permission-picker checkbox maps its checked state to those enum values, keeping persisted configuration explicit and easy to maintain.
Settings changes
Enablement remains an enum
chat.agent.sandbox.enabledandchat.agent.sandbox.enabledWindowsremain string settings with two supported values:"off": disables sandboxing."on": enables sandboxing with standard filesystem and network restrictions.The settings default to
"off".enabledWindowsis the Windows-specific equivalent; Linux and macOS useenabled.Unrestricted network access is independent
Adds
chat.agent.sandbox.allowNetwork, a restricted boolean setting defaulting tofalse.When sandboxing is enabled, setting
allowNetworktotruepermits all network domains while retaining filesystem sandbox restrictions. This replaces the old third enablement-state value,"allowNetwork", so enablement and network policy are configured independently.The setting’s policy metadata and generated policy data use minimum version
1.127. Network-filter descriptions now refer to the dedicated setting.Compatibility and migration
"off"and"on"values remain valid without migration."allowNetwork"values on either enablement key migrate to the corresponding"on"value.chat.agent.sandbox.allowNetwork: trueunless that new setting already has an explicit user value, preserving user intent.on | off | allowNetworkrepresentation for backward compatibility.Runtime and forwarding
"on"as enabled and consults the newallowNetworksetting before falling back to the legacy"allowNetwork"value.allowNetworkkey.enabled: "on"plusallowNetwork: truecombination, while preserving legacy compatibility.allowNetworkchanges.Permission picker behavior
The Sandboxing for terminal checkbox remains boolean at the UI boundary, but persists enum values:
chat.agent.sandbox.enabledWindows.chat.agent.sandbox.enabled.Tests and validation
enabledWindows: "on"and independently verify that this does not grant unrestricted network access.Validation completed:
Core Typecheck watch task: 0 errors.
ESLint for modified TypeScript files.
Pre-commit hygiene hook.
Focused unit tests:
42 passing.