Bringing technical clarity to the unknown

Playing with GitHub Copilot sandboxes

19 Nov 2026 🔖 prompt engineering security
💬 EN

Table of Contents

Misc. notes from playing with GitHub Copilot sandboxing.


Sandboxing blocks Azure CLI folder access

Accessible when sandbox disabled

/copilot
/sandbox disable session
List the files in my `%USERPROFILE%/.azure`
Allow path access
This action may read or write the following path outside the paths currently allowed for this session.
C:\Users\CENSORED\.azure
Do you want to allow this?
1. Yes
2. Yes, and remember this path for this session
3. No (Esc)
1
Shell List Azure profile files NUMBER_CENSORED lines…
Get-ChildItem -Force "$env:USERPROFILE\.azure" | Select-Object Mode,Length,LastWriteTime,Name

Contents of  %USERPROFILE%\.azure :

Directories:  CENSORED, CENSORED, CENSORED 

Files:  CENSORED, CENSORED, CENSORED, CENSORED, CENSORED, CENSORED, CENSORED, CENSORED .
/exit

Inaccessible when sandbox enabled and azure folder not allowlisted

I removed "C:\\Users\\CENSORED\\.azure" from the list in the sandbox.userPolicy.filesystem.readonlyPaths property in %USERPROFILE%/.copilot/settings.json.

/copilot
/sandbox enable session
List the files in my `%USERPROFILE%/.azure`
Shell List Azure profile files (sandboxed)  2 lines
Attempting to perform the InitializeDefaultDrives operation on the 'FileSystem' provider failed.
<command with shellId: 0 is still running after 30 seconds. The command is still running. You will be automatically notified when it completes; if you need the command to complete end your response with no tool calls to wait 
for the notification. Use stop_powershell to stop it.>
Get-ChildItem -Force "$env:USERPROFILE\.azure" | Select-Object Mode,Length,LastWriteTime,Name

Read shell output Waiting up to 5 seconds for command output 2 lines…

Stop shell  1 line…

I couldn’t access  %USERPROFILE%\.azure ; the sandbox blocked filesystem access outside the workspace.
/exit

Also strangely when sandbox enabled but azure folder allowlisted

I added "C:\\Users\\CENSORED\\.azure" to the list in the sandbox.userPolicy.filesystem.readonlyPaths property in %USERPROFILE%/.copilot/settings.json, and there were no related enterprise-managed settings overriding that choice of mine (ahem – among other things, because copilot startup is disappointingly announcing Managed account policy could not be refreshed: the managed-settings fetch failed. – possible hints 1, 2).

/sandbox enable session
List the files in my `%USERPROFILE%/.azure`
Allow path access
This action may read or write the following path outside the paths currently allowed for this session.
C:\Users\CENSORED\.azure
Do you want to allow this?
1. Yes
2. Yes, and remember this path for this session
3. No (Esc)
1
Shell List Azure profile files (sandboxed)  2 lines
Attempting to perform the InitializeDefaultDrives operation on the 'FileSystem' provider failed.
<command with shellId: 0 is still running after 30 seconds. The command is still running. You will be automatically notified when it completes; if you need the command to complete end your response with no tool calls to wait 
for the notification. Use stop_powershell to stop it.>
Get-ChildItem -Force "$env:USERPROFILE\.azure" | Select-Object Mode,Length,LastWriteTime,Name

Read shell output Waiting up to 5 seconds for command output 2 lines…

Stop shell  1 line…

I couldn’t access  %USERPROFILE%\.azure ; the sandbox blocked filesystem access outside the workspace.

I’m pretty sure the InitializeDefaultDrives on the MXC FileSystem provider isn’t actually meant to be failing when /sandbox policy returns this:

Effective sandbox policy for C:\CENSORED
  Command: --help

User-configured paths:
  Read-only paths (1):
    C:\Users\CENSORED\.azure

System:
  Read-only paths (32):
...

No idea what’s going on (but possible hints: 1, 2)

/exit

About that enterprise managed settings bug

Oh my word, it’s easy to make typos in a managed-settings.json file and end up killing your enterprise having any managed settings in place!

Inspecting the contents of my latest "%USERPROFILE%\.copilot\logs\process-blahblahblah.log file revealed a line saying:

[rust:rt_managed_settings_ingest] [managedSettings] server policy fetch failed — 
no cache to fall back on, failing open: 
[fetchManagedSettings] Unexpected response format: 
deniedMcpServers.0: 
Expected exactly one of 'serverUrl', 'serverCommand', or 'serverName' and no other properties

Turns out someone had accidentally typed ServerUrl instead of serverUrl and the whole enterprise’s protections went bye-bye.

Microsoft really needs to release a linter for managed-settings.json files, fall back to the last good one, or something.

That’s ridiculous behavior – killing ALL enterprise endpoint GitHub Copilot process protections altogether (important ones, too, like disabling remote control, disabling computer use, or setting the default model to something cheap!) – when merely ONE protection is misspelled?!

C’mon, Microsoft – do better. These are critical cost and, more importantly, security, protections.

Anyway, what you should hope to see in the logs from GitHub Copilot CLI/app startup, when you’ve got remotely hosted enterprise managed GitHub Copilot settings that are correctly formatted, is something more like this:

[rust:rt_managed_settings_ingest] [managedSettings] server policy served 
from fresh cache (age CENSOREDms) for https://github.com: 
bypassDisabled=BOOLEAN_VALUE_HERE, 
keys=[LIST,OF,TOP,LEVEL,KEY,NAMES,HERE]

IDE plugin sandboxing settings are separate

Whereas the GitHub Copilot desktop app and CLI tool are controlled via true in the sandbox.enabled property in your %USERPROFILE%/.copilot/settings.json file…

…for IDE plugins, it’s different.

VSCode

For example, for the GitHub Copilot chat pane in VSCode, you need to use on in the chat.agent.sandbox.enabled property in your %APPDATA%\Code\User\settings.json file.

Rather than a managed-settings.json GitHub Copilot config file, since this is VSCode settings, I believe if you want to override it enterprise-wide, you have to do it for Windows endpoints by managing their registry key-value pairs (e.g. perhaps the policy key value name ChatAgentSandboxEnabled in HKLM\Software\Policies\Microsoft\VSCode with a REG_SZ of on).

Google’s search summary also said:

Enabling the sandbox alone is typically not enough for enterprise compliance. Administrators normally configure a stack of overlapping sandbox policies:

  • ChatAgentSandboxNetworkAllowNetwork: Controls whether sandboxed agents are allowed general outbound internet access.
  • ChatAgentNetworkFilter: Locks down network traffic by applying rigid allowedDomains or deniedDomains lists.
  • ChatAgentSandboxAllowBypass: Determines if the user is allowed to temporarily bypass the active terminal sandbox for an individual troubleshooting session. If set to false or omitted, the sandbox remains non-negotiable.

Would you like the specific ADMX template syntax for this rule, or do you need guidance on configuring allowed file path overrides (chat.agent.sandbox.fileSystem.userConfiguredPaths) across your environment?

--- ---