Add sandbox unsandboxed auto-approval setting#315410
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds explicit configuration for whether agent terminal commands may leave the sandbox and whether sandboxed/unsandboxed commands can be auto-approved, wiring those settings through command preparation, sandbox wrapping, auto-retry behavior, and tests.
Changes:
- Introduces new sandbox settings for allowing unsandboxed commands and for auto-approving sandboxed vs unsandboxed executions.
- Updates
run_in_terminalto respect the new settings across explicit unsandbox requests, blocked-domain fallbacks, and automatic unsandbox retries. - Expands unit tests for both the tool and the sandbox service to validate the new configuration combinations.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/terminalContrib/chatAgentTools/test/electron-browser/runInTerminalTool.test.ts | Adds coverage for unsandbox gating and separate auto-approval behavior for sandboxed vs unsandboxed runs and retries. |
| src/vs/workbench/contrib/terminalContrib/chatAgentTools/test/browser/terminalSandboxService.test.ts | Verifies sandbox wrapping stays enforced when unsandboxed commands are disabled (explicit requests and blocked-domain cases). |
| src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.ts | Gates unsandboxed fallback behavior on the new “allow unsandboxed commands” setting. |
| src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration.ts | Contributes configuration schema + policy metadata for the new sandbox settings. |
| src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts | Applies the new settings to auto-approval decisions and to automatic unsandbox retry elicitation. |
| src/vs/workbench/contrib/terminal/terminalContribExports.ts | Exposes the new sandbox setting IDs via terminal contrib exports. |
| src/vs/platform/sandbox/common/settings.ts | Defines new AgentSandboxSettingId values for the added settings. |
Copilot's findings
- Files reviewed: 7/7 changed files
- Comments generated: 2
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
pwang347
approved these changes
May 11, 2026
Copilot AI
pushed a commit
that referenced
this pull request
May 11, 2026
* Add sandbox unsandboxed auto-approval setting * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Update sandbox policy data * Reject disabled unsandboxed terminal requests --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> (cherry picked from commit 8ead54a) Co-authored-by: dileepyavan <52841896+dileepyavan@users.noreply.github.com>
dileepyavan
added a commit
that referenced
this pull request
May 11, 2026
…#315848) Add sandbox unsandboxed auto-approval setting (#315410) * Add sandbox unsandboxed auto-approval setting * Potential fix for pull request finding * Update sandbox policy data * Reject disabled unsandboxed terminal requests --------- (cherry picked from commit 8ead54a) Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
fixes #313210
Summary
Adds a dedicated setting for auto-approving agent terminal commands that run outside the sandbox and wires the sandbox settings together across command preparation, sandbox wrapping, automatic retry, and tests.
This change makes the terminal sandbox approval behavior explicit for three related controls:
chat.agent.sandbox.allowUnsandboxedCommandsAgentSandboxSettingId.AgentSandboxAllowUnsandboxedCommandstruechat.agent.sandbox.autoApproveUnsandboxedCommandsAgentSandboxSettingId.AgentSandboxAutoApproveUnsandboxedCommandsfalsechat.agent.sandbox.allowUnsandboxedCommandsis also enabled.chat.agent.sandbox.allowAutoApproveAgentSandboxSettingId.AgentSandboxAllowAutoApprovetrueImplementation details
AgentSandboxAutoApproveUnsandboxedCommandssetting ID and contributes its configuration schema and policy metadata.chat.agent.sandbox.allowUnsandboxedCommands.chat.agent.sandbox.autoApproveUnsandboxedCommandsis enabled.chat.agent.sandbox.allowAutoApprove.Tests
Validation
npm run transpile-client