Copilot CLI sandbox: /sandbox enable, --no-sandbox, Windows 11, and why it is not Docker
- copilot
- coding-agents
- agent-security
GitHub Copilot CLI has a local sandbox. It is off by default. Type /sandbox enable in a session to turn it on for good, or start one session with copilot --sandbox. To turn it off, use /sandbox disable or --no-sandbox. The sandbox limits what the commands Copilot runs can read, write and reach on the network. I do not run Copilot CLI. Everything here comes from the GitHub docs and the CLI changelog up to 1.0.106, read on 6 November 2026.
# inside a session: on for this and future sessions
/sandbox enable
# one session only, without touching the saved setting
copilot --sandbox -p "run the test suite"
copilot --no-sandbox
- Off by default.
/sandbox enablesavessandbox.enabledin~/.copilot/settings.json. The two flags change one session only. - Files. Writes stay in the working directory, temp folders and the repo's
.git. Everything not granted is denied. - Network. Outbound internet is on. The local network is off.
- Three systems. Seatbelt on macOS, Bubblewrap on Linux, ProcessContainer on Windows 11. No Docker.
- How I know. Docs and changelog only. No session of my own.
The Claude Code side, with my own test, is in Claude Code sandbox. Gemini CLI is in Gemini CLI sandbox.
What is sandbox mode in Copilot CLI?
Sandbox mode runs the shell commands and tools Copilot CLI starts inside an operating-system sandbox with a policy for paths, network and credentials. Per the concepts page, local sandboxing "is turned off by default". Until you enable it, commands run with the same access as your user account.
The changelog for 1.0.93 (7 October 2026) says command sandboxing "is available to all users via /sandbox and --sandbox". The --sandbox and --no-sandbox flags arrived in 1.0.70 (9 July 2026).
Bare /sandbox opens the settings dialog. /sandbox status tells you whether the current session is sandboxed. /sandbox policy npm install shows what a command would get without running it.
What does the Copilot CLI sandbox restrict?
The Copilot CLI sandbox restricts files, network and child processes. The filesystem policy is deny by default. Each path is read/write, read-only or denied. By default commands can write in the working directory and temp folders. In a Git repo the .git folder is writable. The rest of the repo above your working directory is read-only. Your home directory is not open.
You add paths in the Filesystem tab. For one session only, /add-dir PATH grants read and write.
On the network, outbound internet is on and local network access is off. Host rules allow or deny single hosts. Deny wins over allow.
On processes, shell commands, grep and glob run as sandboxed child processes. Local MCP servers and language servers run inside by default. Remote MCP servers do not. A command sent to the background cannot be sandboxed at all.
One gap matters to me. The CLI's built-in file tools run inside the CLI process. Per the docs, they check the policy "in software, without an operating-system backstop".
Git and gh get placeholder credentials. A local proxy swaps in the real ones for approved HTTPS hosts only.
Does the Copilot CLI sandbox work on Windows?
Yes, on recent Windows 11 builds. The using local sandboxing page asks for Windows 11 25H2 with update KB5124010 or later, or 26H1 with KB5124006 or later. The backend is ProcessContainer. On a host that cannot run it, Copilot CLI turns a saved sandbox.enabled off for the session and shows a notice.
Windows has weaker network rules. Per the settings page, host rules and proxying need Allow local network on. The sandbox there "relies on programs honoring the proxy settings". A program that ignores the proxy can connect directly. On macOS and Linux it cannot.
On Linux you need Bubblewrap 0.5.0 or later and slirp4netns on your PATH, among other requirements. On macOS the docs say to use macOS 15 or later.
Is the Copilot CLI sandbox a Docker sandbox?
No. The concepts page says it "does not run your commands inside a separate virtual machine or container". It is built on Microsoft eXecution Container (MXC), which wraps each command with the native tools of your OS. The docs put it "at the lighter-weight end" of isolation.
For Copilot CLI inside Docker, there is Docker Sandboxes. It is Docker's product, not part of Copilot CLI. It has a Copilot agent:
sbx secret set github --command 'gh auth token'
sbx run copilot ~/my-project
Per Docker's docs, the default start command inside is copilot --yolo. The architecture page describes a microVM with its own Docker daemon. User-level config from your host is not picked up. I did not run sbx.
So Docker gives you a VM boundary with every tool allowed. /sandbox gives a lighter boundary with your normal prompts. What --yolo turns off is in Copilot CLI allow all tools.
How do I disable the sandbox in Copilot CLI?
Run /sandbox disable in a session. That saves sandbox.enabled: false for new sessions too. For one session only, start with copilot --no-sandbox. Per the 1.0.85 changelog, --no-sandbox is supported but hidden from copilot --help. The command reference and the using-local-sandboxing page list it. Without Copilot CLI, I did not check --help. The command reference also lists /sandbox disable session, which leaves the saved default alone.
There is a softer exit. When the sandbox blocks a command, Copilot can offer to re-run it outside. Allow sandbox bypass is on by default. The prompt also offers "Yes, and disable the sandbox for the rest of this session". A bypass gains no root access, per the docs. It does skip credential masking.
An admin can block all of this. Under an enterprise policy that enforces the sandbox, --no-sandbox is ignored. With sandbox.allowBypass set to false there too, you cannot leave the sandbox at all.
How does the Copilot CLI sandbox differ from Claude Code and Gemini CLI?
Copilot CLI and Claude Code box the commands. Gemini CLI boxes the whole process with -s. Copilot CLI is the only one of the three with a fully documented native Windows sandbox. The Claude Code and Gemini CLI columns come from my earlier posts.
| Copilot CLI 1.0.106 | Claude Code | Gemini CLI 0.67.0 | |
|---|---|---|---|
| Switch | /sandbox enable, --sandbox | sandbox.enabled in settings | -s, GEMINI_SANDBOX, tools.sandbox |
| What is boxed | Shell commands, local MCP and LSP | Shell commands | The whole CLI, or single tools |
| macOS | Seatbelt | Seatbelt | Seatbelt |
| Linux | Bubblewrap | bubblewrap | Docker, Podman, gVisor or LXC |
| Native Windows | ProcessContainer, Windows 11 25H2 or 26H1 | Commands run unsandboxed | windows-native, docs cut off |
| Network default | Outbound on, local off | Proxy, allowedDomains start empty | Open on macOS in permissive-open |
Frequently asked questions
Is the Copilot CLI sandbox on by default?
No. sandbox.enabled defaults to false in the config directory reference. Your company can turn it on for you through managed settings.
Does the sandbox replace permission prompts?
No. The sandbox limits a running command. Flags like --allow-tool and --deny-tool decide which tools Copilot may use. Those flags and --allow-all-tools are covered in Copilot CLI allow all tools.
How do I check that Copilot CLI is sandboxed?
Run /sandbox status. The status line also shows sandbox enabled when the sandbox is in use.
Did you test this?
No. Copilot CLI is not installed on my machine. Docker's sbx is not either. I read the GitHub Copilot docs, the CLI changelog up to 1.0.106 and Docker's Sandboxes pages on 6 November 2026.
The verdict
I would turn the Copilot CLI sandbox on with /sandbox enable and check /sandbox status once. For unattended runs I would turn Allow sandbox bypass off. On Windows I would not trust host rules. For a hard wall around the whole agent, use Docker Sandboxes or a VM.
Sources, read on 6 November 2026: the GitHub Copilot using local sandboxing, sandbox settings, about local sandboxing, filesystem policies, command reference and config directory pages, plus the github/copilot-cli changelog. Docker: the Copilot agent and architecture pages.