Add sandbox settings auto-update control#327419
Open
dileepyavan wants to merge 1 commit into
Open
Conversation
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @anthonykim1Matched files:
|
benvillalobos
approved these changes
Jul 24, 2026
dmitrivMS
approved these changes
Jul 24, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds control over command-specific sandbox configuration updates and forwards it to the Agent Host.
Changes:
- Registers the
chat.agent.sandbox.settings.autoUpdatesetting. - Gates command-derived filesystem and runtime configuration.
- Adds disabled-behavior coverage.
Show a summary per file
| File | Description |
|---|---|
settings.ts |
Defines the setting ID. |
terminalChatAgentToolsConfiguration.ts |
Registers the setting. |
sandboxSettingsReader.ts |
Includes it in sandbox configuration updates. |
sandboxConfigSchema.ts |
Maps it into Agent Host configuration. |
terminalSandboxEngine.ts |
Gates command-specific adjustments. |
terminalSandboxService.test.ts |
Tests disabled behavior. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 4
- Review effort level: Medium
| const currentRuntimeConfiguration = getTerminalSandboxRuntimeConfigurationForCommands(this._os, this._commandAllowListCommandDetails); | ||
| const currentRuntimeConfiguration = getTerminalSandboxRuntimeConfigurationForCommands(this._os, currentCommandDetails); | ||
| const nextRuntimeConfiguration = getTerminalSandboxRuntimeConfigurationForCommands(this._os, normalizedCommandDetails); | ||
| const shouldRefreshConfig = this._commandAllowListKeywords.length === 0 |
| } | ||
| }, | ||
| [AgentSandboxSettingId.AgentSandboxSettingsAutoUpdate]: { | ||
| markdownDescription: localize('agentSandbox.autoUpdate', "Controls whether the effective sandbox configuration is automatically adjusted based on the terminal command being executed. When disabled, only explicitly configured sandbox settings are used. This applies only when {0} is enabled.", `\`#${AgentSandboxSettingId.AgentSandboxEnabled}#\``), |
| [AgentSandboxSettingId.AgentSandboxWindowsEnabled]: AgentHostSandboxKey.WindowsEnabled, | ||
| [AgentSandboxSettingId.AgentSandboxAllowNetwork]: AgentHostSandboxKey.AllowNetwork, | ||
| [AgentSandboxSettingId.AgentSandboxAllowUnsandboxedCommands]: AgentHostSandboxKey.AllowUnsandboxedCommands, | ||
| [AgentSandboxSettingId.AgentSandboxSettingsAutoUpdate]: AgentHostSandboxKey.AutoUpdateSettings, |
Comment on lines
+864
to
+865
| ok(!config.filesystem.allowRead.includes('/home/user/.gnupg'), 'Disabled auto update should omit command runtime read paths'); | ||
| ok(!config.filesystem.allowWrite.includes('/home/user/.gnupg'), 'Disabled auto update should omit command runtime write paths'); |
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
chat.agent.sandbox.settings.autoUpdatesettingautoUpdateSettingsValidation
npm run typecheck-clientgit diff --checkThe focused Electron unit test could not run in this environment because no X display or
xvfb-runis available.