What this thread does
The problem
By default Copilot CLI shell commands run with the same access as your user account. If you want an agent to run builds and tests without handing it your home directory, SSH keys and open network, GitHub now ships a built-in sandbox.
How to turn it on
GitHub's changelog (7 Oct 2026) announced general availability for Copilot CLI, the GitHub Copilot app and VS Code sessions using Agent Host, at no extra cost. Per the docs:
- In a CLI session run
/sandbox enable. The choice is saved (sandbox.enabled) until you run/sandbox disable. - Tools and commands Copilot starts run with restricted filesystem, network and credential access, using Microsoft's MXC layer to map one policy onto native OS controls on Windows, macOS and Linux.
- Enterprise managed settings can require it; if
sandbox.failIfUnavailableandsandbox.enabledare both true, the CLI blocks model requests and tool execution when it cannot enforce the sandbox.
What you can tune
Filesystem paths (read-only, read/write, deny), outbound internet and local network (allow or deny hosts; Linux cannot independently control local-network access for spawned processes), Git and gh credentials (a local proxy supplies real credentials only to approved HTTPS destinations) or masked environment variables, whether local MCP and language servers run inside the sandbox (remote MCP servers never do), macOS keychain access, and per-command exceptions.
Limits to know
- It is lightweight isolation, not a separate VM or container.
- Built-in file tools run in-process, so the OS sandbox cannot constrain them; they check the policy on a best-effort basis.
- As of November 2026, macOS 15 or later is recommended (older macOS is not blocked but is untested); Linux needs bubblewrap 0.5.0+ (network control also needs slirp4netns, util-linux 2.35+, iptables and /dev/net/tun); Windows needs a recent Windows 11 update and its proxy/host rules are weaker.
- On an unsupported host
/sandbox enableis refused. - Cloud sandboxes are a different, GitHub-hosted feature billed based on usage.
- The current docs describe CLI and app sandbox settings separately, so check the current docs for your platform.
Related: fewer-approval-prompts-without-full-access covers the equivalent choices for Claude Code and Codex.
Sources: GitHub docs: Using local sandboxing, GitHub docs: About cloud and local sandboxes, GitHub changelog, 7 Oct 2026.
Started from a post by @GitHub, packaged by the editor. Original post