Skip to content

Test: Sandbox profiles for remote environments (experimental) #349740

Done

Description

Refs: #349390

Complexity: 4

Authors: Dileep Yavanmandha (@dileepyavan)

Create Issue


Sandbox profiles let you save agent sandbox settings under a name, and assign one to each remote agent host. New sessions on that host use the profile. Managed settings still apply on top of it. This feature is experimental.

Each step lists what you should see (✅). Run the scenarios in order; each one builds on the previous one. Explore freely beyond the steps.

Setup

  1. Have one remote environment (SSH or Dev Tunnel) that you can connect to from the Agents window.
  2. Add this to your user settings JSON, then reload the window:
    "chat.agent.sandbox.profiles.enabled": true

Scenario 1: Manage sandbox profiles

  1. Open the Settings editor, search for sandbox, and note your current sandbox settings.
  2. Run Sandbox: Manage Sandbox Profiles from the Command Palette, and select New Profile.
    • ✅ The new profile shows the same values as the sandbox settings in the Settings editor.
  3. Name it GitHub Only. Set Enabled to on and Allowed Domains to github.com. Select Create.
    • ✅ GitHub Only shows in the list, and it is read-only.
  4. Select Edit Profile, change something, and select Save.
    • ✅ The change is saved.
  5. Try some mistakes: an empty name, a name that already exists, or broken JSON in User-Configured Paths.
    • ✅ Each mistake shows a clear message, and nothing is saved.
  6. Create a second profile, then delete it.
    • ✅ The profile is removed.
  7. Reload the window and open Manage Sandbox Profiles again.
    • ✅ GitHub Only is still there.

[chrmarti]: I had to enable local networking in the sandbox profile to get things to work. Dileep Yavanmandha (@dileepyavan) #349798

Scenario 2: Assign a sandbox profile to an agent host

  1. In the Agents window, run Manage Remote Environments and connect to your remote.
  2. In the Sandbox Profile column, select GitHub Only.
  3. Start a new agent session on the remote, and type /sandbox policy.
    • ✅ The session's sandbox policy opens. It shows the settings from GitHub Only, not the sandbox settings from the Settings editor. github.com is the only allowed host.
  4. Ask the agent to run curl -sI https://github.com.
    • ✅ The command succeeds.
  5. Ask the agent to run curl -sI https://example.com, or curl to any other host.
    • ✅ The command fails.
  6. Disconnect and connect again.
    • ✅ The dropdown still shows GitHub Only.
  7. Go back to Manage Sandbox Profiles and try to delete GitHub Only.
    • ✅ The delete is blocked, and the message names the remote that uses the profile.
  8. Disconnect, and hover over the Sandbox Profile dropdown.
    • ✅ The dropdown is disabled, and its hover tells you to connect. Connect again before you continue.
  9. Optional: connect to the same remote from a second computer.
    • ✅ The second computer shows GitHub Only (on host), and offers Save "GitHub Only" to My Profiles.

Scenario 3: Profile changes are applied to the host

  1. Edit GitHub Only to also allow example.com, and save it.
    • ✅ You don't need to assign the profile again.
  2. Start a new session on the remote. Type /sandbox policy, and run both curl commands from Scenario 2.
    • ✅ The policy shows both hosts as allowed, and both commands succeed.
  3. Edit GitHub Only to remove example.com again, and save it.

Scenario 4: The session sandbox toggle still works

  1. Start a new session on the remote. In the chat input, open the permissions picker.
    • ✅ Sandboxing for terminal is on, because the profile turns the sandbox on.
  2. Turn Sandboxing for terminal off, and ask the agent to run curl -sI https://example.com.
    • ✅ The command succeeds, because the sandbox is off for this session only.
  3. Turn Sandboxing for terminal on again, and run the same command.
    • ✅ The command fails.
  4. Start a second session on the remote.
    • ✅ The sandbox is on. The toggle in one session doesn't change the profile or other sessions.

Scenario 5: Managed settings win over the profile

  1. On the remote, create /etc/github-copilot/managed-settings.json with this content. The file must be owned by root, with mode 0644.
    {
      "sandbox": {
        "enabled": true,
        "userPolicy": {
          "network": { "blockedHosts": ["github.com"] }
        }
      }
    }
    On a macOS remote, the path is /Library/Application Support/GitHubCopilot/managed-settings.json. On a Windows remote, it is %ProgramFiles%\GitHubCopilot\managed-settings.json.
  2. Restart the agent host on the remote. For example, restart the computer, or stop the server process and connect again.
  3. Start a new session, and type /sandbox policy.
    • ✅ The policy shows github.com as blocked.
  4. Run curl -sI https://github.com.
    • ✅ The command fails, even though the profile allows github.com.
  5. Edit GitHub Only to turn the sandbox off, save it, and start a new session.
    • ✅ The sandbox stays on. A profile can't turn off a sandbox that managed settings turn on.
  6. Turn the sandbox on again in GitHub Only. Delete the managed settings file, and restart the agent host.

Scenario 6: Turn off the feature setting

  1. Check that GitHub Only is still assigned to the remote.
  2. In your user settings JSON, set "chat.agent.sandbox.profiles.enabled": false. Don't reload the window.
  3. Search the Command Palette for Manage Sandbox Profiles, and open Manage Remote Environments.
    • ✅ The command and the Sandbox Profile column are gone. Nothing else in Remote Environments changes.
  4. Start a new session on the remote, and type /sandbox policy.
    • ✅ The remote still uses GitHub Only. The setting only hides the UI on this computer.
  5. Set the setting back to true.
    • ✅ The command and the column come back without a reload. Your profiles and the remote's assignment are unchanged.
  6. In the Sandbox Profile column, select Default. Start a new session, and type /sandbox policy.
    • ✅ The remote uses the sandbox settings from the Settings editor again.

Note: Turning off the setting doesn't remove the profile from the remote. To make the remote use the sandbox settings from the Settings editor again, set its Sandbox Profile to Default in Manage Remote Environments before you turn off the setting.

Activity

  1. connor4312 commented on Nov 23, 2026

    @connor4312
    Member

    Actual enforcement of the sandbox felt a little hit-and-miss on my Ubuntu remote server over SSH, but management worked well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions