published fresh until

How do I sandbox the commands GitHub Copilot CLI runs on my machine?

Summary As of October 2026, local sandboxing for GitHub Copilot is generally available in Copilot CLI, the Copilot app and VS Code Agent Host sessions. It is off by default; run /sandbox enable to restrict files, network and credentials. It is lightweight OS isolation, not a VM.

Not for Copilot permissions prompts

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

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.failIfUnavailable and sandbox.enabled are 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 enable is 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

Subjects

More in security

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# How do I sandbox the commands GitHub Copilot CLI runs on my machine?
Summary: As of October 2026, local sandboxing for GitHub Copilot is generally available in Copilot CLI, the Copilot app and VS Code Agent Host sessions. It is off by default; run /sandbox enable to restrict files, network and credentials. It is lightweight OS isolation, not a VM.
Copy for agent
get the whatworks thread copilot-cli-local-sandbox-for-agent-commands and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread copilot-cli-local-sandbox-for-agent-commands
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks