Repository navigation
sandbox: assign sandbox profiles to agent hosts (experimental) - #349390
Merged
Dileep Yavanmandha (dileepyavan) merged 13 commits intoNov 23, 2026
Merged
Conversation
Add Sandbox: Manage Sandbox Profiles, a dialog for creating, editing, and deleting named presets of the sandbox settings. Profiles are stored locally in the user profile. Saved profiles open read-only until edited, and new profiles start from the current effective settings. Remote Environments gains a Sandbox Profile column. The selection is stored per host address, and the existing sandbox forwarder sends the profile's settings to that host when it connects or the profile changes. Hosts without a profile keep the default VS Code settings, and managed policy values are never overridden. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Saving a stale draft can recreate a profile deleted in another window and reactivate its previous sandbox settings through retained per-host assignments.
3 open issues
What changed in this PR
Adds device-local sandbox profiles to VS Code so individual remote agent hosts can use named settings presets without Agent Host or protocol changes.
Changes:
- Adds a modal profile editor with settings controls and inline JSON editing.
- Adds per-host profile selection and settings forwarding that preserves managed-policy values.
- Adds accessibility help, verbosity configuration, and focused regression tests.
| File | Description |
|---|---|
| sandboxProfiles.test.ts | Tests profile persistence, naming, and editing state. |
| agentHostSandboxForwarder.test.ts | Tests assignments, deletion, updates, and policy precedence. |
| terminal.chatAgentTools.contribution.ts | Registers the editor, command, and accessibility help. |
| sandboxProfilesInput.ts | Manages profile drafts, validation, and persistence. |
| sandboxProfilesEditor.ts | Implements profile management and settings controls. |
| sandboxProfiles.css | Styles the profile editor and controls. |
| agentHostSandboxForwarder.ts | Overlays assigned profiles on forwarded settings. |
| remotesWidget.test.ts | Tests the profile column and offline assignment. |
| remotesWidget.ts | Adds the Sandbox Profile table column. |
| remotesTable.ts | Renders and synchronizes per-host profile selectors. |
| remotesWidget.css | Styles selectors and truncates long names. |
| accessibilityConfiguration.ts | Registers sandbox-profile accessibility verbosity. |
| remotes.contribution.ts | Documents profile selection in accessibility help. |
| sandboxProfiles.ts | Provides shared profile storage and assignment helpers. |
| accessibleView.ts | Adds the sandbox-profile accessibility provider identifier. |
Review effort: Balanced
Port the Sandbox Profile column to the redesigned Remote Environments table. Co-authored-by: Copilot <[email protected]>
Contributor
Screenshot ChangesBase: Changed (27) |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Sandbox profiles and the active profile are now root config values on the agent host, so every client connected to it sees and can change them; the last write wins. New sessions use the active profile's values over the host's sandbox values, and managed policy still applies on top. - Host: add sandboxProfiles and activeSandboxProfile to the sandbox config schema; resolve the active profile for session sandbox config. - Manage Sandbox Profiles edits one host's profiles, with Use for New Sessions and an Active marker; deleting the active profile clears it. - The Remote Environments Sandbox Profile column sets the host's active profile and is disabled while a host is disconnected. - Remove the client-side profile storage and the forwarder overlay, so a reconnecting client never replaces another client's selection. - Hide Add Item in read-only profile lists. Co-authored-by: Copilot <[email protected]>
Sandbox profiles are now created in a per-machine library (application-shared,
not synced) that both VS Code and the Agents window read. Remote Environments
lists the library for each host; assigning sends the host a copy under the
single `sandboxProfile` root config key (`{}` clears it to Default). Other
devices connecting to the host see "X (on host)" and can save it to their own
profiles. Editing a profile updates connected hosts using it; deleting keeps the
hosts' copies. Managed policy still wins and reconnects never overwrite the
assignment.
Also restores a dedicated wrapper for the Remote Environments dropdown so its
chevron renders inside the box.
Co-authored-by: Copilot <[email protected]>
Sandbox profiles are now behind chat.agent.sandbox.profiles.enabled, an experimental setting that is off by default and can be enabled by an experiment. It controls the Manage Sandbox Profiles command and the Sandbox Profile column in Remote Environments; hosts keep applying a profile that is already assigned. A profile assigned to a remote environment can no longer be deleted. Each environment's last-known assignment is remembered, so disconnected environments also count. Co-authored-by: Copilot <[email protected]>
chat.agent.sandbox.profiles.enabled is an internal experimental flag: it can be set in settings.json or by an experiment, but is not listed in the Settings editor. Co-authored-by: Copilot <[email protected]>
The Remote Environments picker now uses an element-anchored hover with a pointer, like the row's other controls, instead of the select box's mouse hover of the selected option. The hover explains why the picker is disabled (disconnected, or a server without sandbox profiles), and a disabled picker is dimmed. Adds a hideSelectedOptionHover select box option so callers can provide their own hover. Co-authored-by: Copilot <[email protected]>
Remove the client-side assignments tracker and its persisted copy of each host's assignment. The host's sandboxProfile setting is the only source of truth; clients read it while connected. A disconnected host's picker shows Default (disabled) until it reconnects, and deleting a profile is only blocked by connected hosts that use it. Disconnected hosts keep their own copy and offer Save to My Profiles when they reconnect. Co-authored-by: Copilot <[email protected]>
- Refuse to save a draft of a profile that was deleted in another window, instead of recreating it with the same ID. - Focus the profile list when the selected profile is read-only, because the disabled name box can't take focus. - Keep invalid User-Configured Paths JSON in the editor model: it counts as an unsaved change, survives re-rendering, and blocks every save path. Co-authored-by: Copilot <[email protected]>
Dileep Yavanmandha (dileepyavan)
marked this pull request as ready for review
November 23, 2026 01:00
Dileep Yavanmandha (dileepyavan)
enabled auto-merge
November 23, 2026 01:01
The Sandbox Profile column subscribes to onDidChangeConnections and looks up connections by address. Give the shared workbench test stub and the Remote Environments component fixture an empty connections service so RemotesEditor tests and the remotesWidget screenshot fixtures can create the widget. Co-authored-by: Copilot <[email protected]>
Bhavya U (bhavyaus)
approved these changes
Nov 23, 2026
3 tasks done
Dmitriy Vasyura (dmitrivMS)
approved these changes
Nov 23, 2026
Dileep Yavanmandha (dileepyavan)
deleted the
DileepY/sandbox-profiles-ui
branch
November 23, 2026 06:37
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
This change adds sandbox profiles for agent hosts.
A sandbox profile is a named set of agent sandbox settings. You make profiles on your computer. You assign one profile to each remote agent host. The host uses that profile for its sessions.
Concepts
sandboxProfile. The host is the only source of truth. Clients do not store a copy of this assignment.sandboxProfile: {}to clear an assignment.Main flows
1. Make a profile
2. Assign a profile to a host
To remove the assignment, select Default.
3. The host sends the assignment to all clients
If two clients assign a profile to the same host, the last assignment is used.
4. Sessions use the profile
A change to the assignment applies to the next turn of each session. It does not change a turn that runs at that time.
5. Edit a profile
6. Delete a profile
The client cannot examine disconnected hosts. A disconnected host keeps its own copy of the profile. When it connects again, it shows the profile as "Name (on host)".
7. Reconnect and restart
sandboxsetting. It does not sendsandboxProfile. Thus, a reconnect does not change the assignment.Limits
User interface
Main files
platform/sandbox/common/sandboxProfiles.tsplatform/agentHost/common/sandboxProfiles.tsplatform/agentHost/common/sandboxConfigSchema.ts,platform/agentHost/node/sessionSandbox.tschatAgentTools/browser/sandboxProfilesEditor.ts,sandboxProfilesInput.tsremoteAgentHost/browser/remotesTable.ts,remotesWidget.tschatAgentTools/common/terminalChatAgentToolsConfiguration.ts,terminal.chatAgentTools.contribution.tsbase/browser/ui/selectBox/*(hideSelectedOptionHover)Validation
Unit tests examine these conditions:
Type check, formatter, oxlint, stylelint, and the layers check pass.