Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Important
- This is a preview feature provided under Microsoft Product Terms.
- Preview features may have restricted functionality and may not be released for general availability. These features are available before an official release so that customers can get early access and provide feedback.
- You need to be part of the Frontier preview program to get early access. Frontier connects you directly with Microsoft's latest AI innovations. Frontier previews are subject to the existing preview terms of your customer agreements. As these features are still in development, their availability and capabilities may change over time.
When Copilot Code runs a project on your device, the Sandbox limits what it can read, change, and reach on the network to what you and your organization allow. Your device enforces these limits, so organizations can turn on local mode by default and keep the rest of the device and network out of reach.
This article covers what the Sandbox includes, how file and network access work, how approvals fit with the Sandbox, and which controls administrators use to manage it. To choose between running on your device and running in the cloud, see Get started with Copilot Code. For administrator deployment and policy, see Manage Copilot Code for your organization.
What the Sandbox covers
The Sandbox covers Copilot Code and everything it starts on your behalf:
- Actions Copilot Code takes directly, such as reading and writing files in your project.
- Commands Copilot Code runs to build, test, or preview your project, and any processes those commands start.
- Built-in tools Copilot Code uses to read and write files.
- Any connected tools you add.
Anything Copilot Code starts gets the same limits or stricter ones. It never gets more access.
The Sandbox doesn't cover the following:
- The Copilot app itself. The Copilot app starts Copilot Code but isn't subject to the Sandbox.
- Apps you run yourself. If you run an app that Copilot Code built outside of a Copilot Code session, the Sandbox doesn't restrict it. Review generated code before you run it on your own.
File access
Copilot Code can read and write files in your project folder. It also gets the read access that common build tools need. It can't reach the rest of your device unless you grant that access.
| Location | Default access |
|---|---|
| Your workspace and temporary folders | Read and write |
| Build tool caches, package registries, and configuration files | Read |
| Other folders on your device | No access |
Network access
Your organization's setting controls which network hosts Copilot Code can reach from your device.
| Setting | What it means |
|---|---|
| Allow all outbound connections | Copilot Code can reach any host. File access limits still apply. |
| Allow only approved hosts | Copilot Code can reach only hosts on the approved list. The list supports wildcards, such as *.example.com. This setting is the default. |
| Block outbound connections | Copilot Code can't make outbound network connections. |
If you turn on a plugin your administrator set up, or turn on your work context, Copilot Code automatically allows the hosts that feature needs. You don't have to add them to the approved list.
Only your own device can make inbound connections. You can open a live preview of a web app you're building at a local address, and connections from other computers are refused.
Built-in allow list
Sandbox includes the following network destinations. Conditional entries are available only when the corresponding feature or tenant policy permits them.
| Category | Host | Purpose | Availability |
|---|---|---|---|
| Work IQ | workiq.svc.cloud.microsoft | Work IQ services | Built in when Work IQ is enabled |
| Plugins | MCP hosts for Copilot Code plugins, FabricIQ, and Dynamics | Connections used by permitted plugins | Built in when the plugin is enabled for the tenant and allowed by policy |
| GitHub | github.com, *.github.com | Git operations, including clone and fetch | Built-in when GitHub policy permits access to GitHub.com |
| GitHub Enterprise | {allowed_domain}.ghe.com, *.{allowed_domain}.ghe.com | GitHub Enterprise access, including API requests from the gh CLI | Built in only for domains permitted by GitHub policy |
| Web grounding | Search the web to ground the agent's responses. | Built-in only for websearch permitted | |
| Azure DevOps | dev.azure.com, *.dev.azure.com, *.visualstudio.com, login.microsoftonline.com | Azure Repos over HTTPS, including legacy {org}.visualstudio.com URLs; OAuth token refresh through Microsoft Entra ID | Built-in |
Allowing a host doesn't grant access to its resources. Authentication, repository permissions, and tenant policies still apply.
Additional destinations for development tools
Depending on your project, you might need to add package registries and download hosts to your network allow list. Common examples include:
| Ecosystem | Common hosts | Purpose |
|---|---|---|
| Node.js / npm | registry.npmjs.org | Package metadata and downloads |
| Python / pip | pypi.org, files.pythonhosted.org | Package metadata and distribution files |
| .NET / NuGet | api.nuget.org | Package restore |
| Java / Maven | repo.maven.apache.org | Maven Central dependencies |
| Rust / Cargo | index.crates.io, static.crates.io | Package index and crate downloads |
Web preview
When the Sandbox is on, the web preview follows the same policy. The policy applies whether Copilot Code or you operate the preview.
Git and GitHub sign-in
The Sandbox allows authenticated Git operations and GitHub sign-in, so Copilot Code can clone, pull, and push to repositories you can access.
How approvals work with the Sandbox
Copilot Code asks for your approval before some actions, such as running a command or using a folder outside your project. An approval lets Copilot Code do something that the Sandbox already allows. It never adds access.
- Approvals stay inside the Sandbox. An approval can't give Copilot Code more access than your organization's settings allow.
- You only see approvals that can succeed. Copilot Code doesn't ask you to approve an action that the Sandbox would refuse.
- There's no option to run outside the Sandbox. When your organization requires the Sandbox, you can't turn it off or run a single action without it. Only an administrator can exempt you, by adding you to the policy exemption group.
To learn how to review and respond to approval prompts, see Use Copilot Code.
Managed and unmanaged devices
The Sandbox works differently depending on whether your organization manages your device.
| Device | Behavior |
|---|---|
| Managed by your organization | The Sandbox is on, with outbound access set to approved hosts only. If no policy is set, the Sandbox stays on. Only your administrator can change it. |
| Not managed | The Sandbox is on by default. You can turn it off or change its settings. |
Administrator controls
Administrators manage the sandbox through the device policy.
For the device policy configuration, see the device policy section in Manage Copilot Code for your organization.
User settings
Users can change Copilot Code sandbox settings when their admin allows it or when their device is unmanaged. Otherwise, each setting is locked.
To change user settings, go to Settings > Code > PC settings.
| Setting | Values |
|---|---|
| Sandbox | On, Off |
| Network access | Full access, Allowed hosts only, No network access |
| Allowed hosts | Hostnames, such as contoso.com. (Semicolon-delimited hostnames; leading wildcards are supported.) |