In VS Code 1.141, released on October 7, 2026 (release notes), the Copilot agent sandbox is one setting, chat.agent.sandbox.enabled, but it starts only on supported OS builds, and Microsoft’s agent sandboxing documentation says that turning it on does not block outbound network access, because chat.agent.sandbox.network.allowNetwork defaults to true. This page covers the readiness check, the switch, what the fence does not wrap, the network choice, probes that confirm it, team rollout and seat costs. If you copied settings or facts from an older copy of this page, the corrections are listed at the end.
Don't miss new tech stories on Google
Add Tech Insider once in the Google app and our stories appear in your news suggestions.
Will the sandbox start on this machine? OS floors and a read-only check
The cheapest failure to avoid is a machine that cannot run the sandbox, so the first three checks are about the machine, not the setting.
Update VS Code. Be on 1.141 or later. The release notes page lists downloads for 1.141.2 as of November 13, 2026. It describes update 1.141.1 as addressing security issues and update 1.141.2 as addressing “these issues”, so install the latest patch; only 1.141.1 is described as a security update.
Meet the OS requirement. The requirements below come from the platform-availability section of the sandboxing page, which lists Windows 11 only.
| OS | Requirement | Read-only check | Outside the list |
|---|---|---|---|
| macOS | macOS 15 or later with the built-in Seatbelt facility; no additional sandbox packages | sw_vers -productVersion | Anything older than macOS 15 |
| Windows | Windows 11 with BaseContainer. The page lists 25H2 with KB5124010, build 26200.9550 or later, and 26H1 with KB5124006, build 28000.3086 or later | ver in Command Prompt, or winver, then compare the build number | Windows 10; Windows 11 builds below those floors |
| Linux (glibc) and WSL2 | bubblewrap 0.5.0 or later, slirp4netns, util-linux 2.35 or later, and compatible iptables tools | The script below | Musl-based distributions such as Alpine; WSL version 1 |
On Linux and WSL2 the script below only prints versions and installs nothing. A missing tool shows as a “missing” line and the script ends with a failing exit status.
#!/bin/sh
set -eu
status=ok
getconf GNU_LIBC_VERSION || { echo "no glibc reported (musl or unsupported)"; status=fail; }
for tool in bwrap slirp4netns unshare iptables; do
if command -v "$tool" >/dev/null; then
"$tool" --version
else
echo "missing: $tool"
status=fail
fi
done
[ "$status" = ok ]
Compare the bwrap line with 0.5.0, and read the util-linux version from the unshare output (unshare ships in util-linux) against 2.35. On Debian or Ubuntu, an example install is sudo apt install bubblewrap slirp4netns util-linux iptables; re-run the script afterwards, because the packaged versions still have to meet the floors. On an unsupported runtime the vendor’s page shows this message: “Sandboxed shell execution is not supported by this runtime. Use a supported glibc-based Linux environment.”
Patch the machine where the agent runs. The page says that for remote sessions you install dependencies and operating system updates on the remote machine, not on the machine you connect from. Visual Studio Magazine reports the same rule from the other side: restrictions are enforced on the machine running the agent. For SSH hosts and WSL2 distributions, run the script there.
Turning it on: the runtime, the global setting and the per-session switch
Check which runtime your sessions use. The sandboxing page says the Local agent runtime is deprecated and will be removed in February 2027, and tells you to move your workflows to the Copilot agent runtime before then; its sandbox settings differ. To use the Copilot harness, select it from the harness picker in the chat input (release notes). Settings copied from older posts may therefore target a runtime that is going away. The same removal date appears on the agent security page.
Set the flag. Visual Studio Magazine identifies chat.agent.sandbox.enabled as the control for the feature. Put it in user settings for every workspace, or in the workspace’s .vscode/settings.json to make it travel with one repository.
{
"chat.agent.sandbox.enabled": true
}
The release notes add that locally launched MCP servers and language servers are sandboxed by default when sandboxing is enabled. They also say 1.141 lets you sign in to GHE.com and GitHub Enterprise Server accounts from the same VS Code window, which helps developers who work across several GitHub tenants (release notes).
Choose global or per session. The Permissions menu in a chat has a “Sandboxing for terminal” toggle that applies to that one session, as SW Architect’s walkthrough and Visual Studio Magazine both describe. Our recommendation: use the global or workspace setting when sandboxing should be the default for a repository, and the session toggle for a one-off task that needs different treatment. On Windows, finish Windows Update before testing either.
On availability and cost, GitHub’s changelog says local sandboxing became generally available on October 7, 2026 in GitHub Copilot CLI, the GitHub Copilot app and VS Code sessions that use Agent Host, and that it is included at no additional cost (GitHub changelog). The separate Copilot cloud experience is different: GitHub says it is available on paid Copilot plans only (cloud experience changelog). SW Architect’s write-up says the local sandbox is built on Microsoft eXecution Container (MXC).
Where the fence ends: terminal, tools, approvals and untrusted code
The sandboxing page defines the reach narrowly: it applies to terminal commands and their child processes, and, when configured, to MCP and language servers started or managed for the session. Built-in tools that do not start operating system processes use their own permission checks. It also says sandboxing and approvals are separate layers, with approvals deciding whether an action runs automatically and the sandbox restricting what the action can reach. It is not a virtual machine or a user-account boundary, and a sandboxed process still runs on the execution host under your account.
| Surface | Inside the sandbox? | What governs it |
|---|---|---|
| Terminal command | Yes | The sandbox policy |
| Child process of a terminal command | Yes | The sandbox policy |
| Locally launched MCP server | Yes, by default once sandboxing is enabled | The sandbox policy |
| Language server | Yes, by default once sandboxing is enabled for locally launched servers | The sandbox policy |
| Built-in tool that starts no OS process | No | Its own permission checks |
| Approval prompt | Separate layer | Approval settings decide whether an action runs automatically |
| Untrusted workspace | Not the sandbox’s job | Restricted mode, which disables agents in that workspace |
Two consequences follow. First, the security baseline on the vendor’s agent security page is to open untrusted projects in restricted mode, which disables agents; the sandbox is not a substitute for that step. Second, Microsoft cautions, as Visual Studio Magazine reports, that the sandbox helps against prompt injection, untrusted dependencies and model mistakes but is not a standalone security boundary. For code you do not trust enough to run under your own account, the next step is a container or VM, which our guide to isolating MCP servers covers.
Outbound network stays open until you close it, and where the file system and credential rules live
Decide whether the agent needs the network. The vendor’s wording is direct: turning on sandboxing does not block outbound network access by default, because chat.agent.sandbox.network.allowNetwork defaults to true. The security page’s baseline repeats the point and says to configure network access separately when you need to restrict it. With defaults, then, a plain curl from the agent’s terminal is not blocked by the sandbox. To close the network, set the documented key to false:
{
"chat.agent.sandbox.enabled": true,
"chat.agent.sandbox.network.allowNetwork": false
}
With the network closed, anything that needs to reach a registry or an API will fail, so package installs and git fetches stop working. The table is our recommendation, not a vendor rule.
| Task in this workspace | Needs outbound network? | Suggested allowNetwork |
|---|---|---|
| Read, review and refactor local code | No | false |
| Run tests whose dependencies are already installed | Usually no | false |
| Install or update dependencies | Yes | true for the duration of the install |
| Call web APIs or fetch documentation | Yes | true |
Read the file system and credential settings from the vendor page. The sandboxing page has separate sections for the file system, credentials and network, plus one titled “Inspect the effective sandbox policy”. Copy key names and defaults from those sections rather than from older posts or older copies of this page, and read the effective policy before you test anything.
Probes and a log of your own output
Build a scratch workspace. A throwaway repository keeps the probes away from real projects and lets the workspace setting do the work. The commands create a folder, a git repository, a .vscode/settings.json with the documented flag, a README and a minimal package.json, then open the folder in VS Code. If this is a machine without Node.js, skip the npm init line; the probes do not need it.
mkdir sandboxed-agent-demo
cd sandboxed-agent-demo
git init
mkdir .vscode
cat > .vscode/settings.json <<'EOF'
{
"chat.agent.sandbox.enabled": true
}
EOF
echo "# Sandbox probe workspace" > README.md
npm init -y
git add .
git commit -m "Scratch workspace for sandbox probes"
code .
For this workspace the network key is left at its default, so package installs work; to allow the closed-network probe, add the allowNetwork line from the previous section and reload the window.
Confirm the fence holds. The routine below gives predictions tied to documented behavior and leaves the last column for what you actually see. Create a harmless canary file outside the workspace instead of pointing the agent at a real secret such as an SSH key, so a fence that fails exposes nothing. For the network probe, use a server you control.
| Probe | Setting state | What the documentation predicts | What you saw |
|---|---|---|---|
| Fetch a page from a server you control | allowNetwork left at its default, true | The request succeeds, because sandboxing alone does not block outbound access | |
| Fetch the same page | allowNetwork set to false | The request fails; if it succeeds, recheck the effective policy and the three readiness checks at the top of this page | |
| Read the canary file outside the workspace | Sandbox enabled | The result follows the file system policy that “Inspect the effective sandbox policy” reports | |
| Write a new file outside the workspace | Sandbox enabled | Same: the file system policy decides |
If a probe leaves a command running, the release notes say a Background Shells pill above the chat input lists shells that are still running in Copilot sessions, in both the Agents window and the editor window. Clear the pill before you trust the next result.
Requiring it for a team and what a seat costs
For organizations, Visual Studio Magazine reports that preview managed settings can require sandboxing and prevent users from bypassing it. SW Architect prints the unified managed-settings form shown below; confirm the exact key names in the organization-management section of the sandboxing page before you deploy it. The old ChatAgentSandboxEnabled policy no longer enforces in Agent Host: the 1.141 notes say it “now supplies an overridable default rather than a mandatory requirement in Agent Host”. An admin who relied on it should move to managed settings.
"sandbox": {
"enabled": true,
"allowBypass": false
}
Stale clients matter here. GitHub’s enterprise managed-settings changelog says GitHub is adding minimum client version requirements to governance-focused managed settings keys over time, “starting with the sandbox key”. Updating VS Code is therefore part of the rollout.
The sandbox adds nothing to the bill, since GitHub includes local sandboxing at no additional cost. What changes the bill is the seat. GitHub’s Enterprise and Copilot page, checked on November 13, 2026, lists Copilot Business at $19 per user per month with 1,900 pooled AI credits per user per month, so Business does include monthly AI credits. GitHub’s plans page lists Copilot Standalone, for users in an enterprise account without a GitHub Enterprise license, at $10 per user per month with the same feature and model eligibility as Copilot Enterprise and no monthly AI credits per seat.
For individuals, GitHub’s Copilot plans page, checked on November 13, 2026, says the Free plan supports the CLI and agent mode, and GitHub’s changelog lists no plan restriction on local sandboxing. Agent mode is available on every tier; only the allowance differs. Our three-way plan comparison sets Copilot’s prices beside Cursor’s and Devin Desktop’s.
Worktree cleanup, merged-session auto-close, the Agents window and external sessions, then the settings to keep
Run Chat: Open Worktree Cleanup to see how much disk space inactive agent session worktrees use and remove the ones you no longer need. Cleaning up marks the selected sessions as done and deletes their worktrees; you can restore a session later to recreate its worktree, and active, running, needs-input and pinned sessions are protected (release notes).
According to the AI settings reference, checked on November 13, 2026, sessions with a merged pull request are marked done automatically through chat.agentSessions.autoMarkAsDoneMergedSessionsAfterDays, whose default of 0 leaves it off. chat.agentSessions.sessionStorageCleanupSuggestion.enabled only controls a storage cleanup suggestion.
In the Agents window, the release notes describe a two-dimensional session grid: as in the editor window, you drag sessions into horizontal or vertical splits and resize the panes. Our suggestion is to run the same prompt under two sandbox configurations side by side.
To continue a session started in the standalone Copilot CLI or in Codex, open the Agents window and use the Created In and Created Externally filters to choose which conversations appear, then pick the session to resume it in the editor. For an external Codex chat, the notes say only one application can send messages to the chat at a time.
// Network open (documented default): fine when the agent installs dependencies or calls APIs
{
"chat.agent.sandbox.enabled": true
}
// Network closed: for review, refactoring and tests that need no downloads
{
"chat.agent.sandbox.enabled": true,
"chat.agent.sandbox.network.allowNetwork": false
}
Keep the first block in repositories where the agent has to install packages and the second in repositories where it works only on local files, and read the file system and credential sections of the sandboxing page before adding anything further. Anyone still running sessions on the Local agent runtime has until February 2027 to move, and its differing sandbox settings should not be carried across.
Corrections for readers of older copies of this page
If you copied from this page before the November 13, 2026 revision, change these items. Delete chat.agent.sandbox.filesystem.scope and chat.agent.sandbox.network.enabled, because neither key appears in Microsoft’s documentation; the documented network key is chat.agent.sandbox.network.allowNetwork, and it defaults to true, so ignore any “network disabled” response shown for a plain curl. Windows 10 is not supported, only Windows 11 builds at or above the listed floors. Local sandboxing became generally available on October 7, 2026, not October 9. Only 1.141.1 is described as a security update. Copilot Business includes 1,900 pooled AI credits per user per month. The Free plan’s allowance is not 50 premium requests. Automatic closing of merged-PR sessions is chat.agentSessions.autoMarkAsDoneMergedSessionsAfterDays, not the storage cleanup suggestion setting.




