The GitHub Copilot app now offers a configurable local sandbox for each project. It can restrict readable or writable folders, network access and the use of Git or GitHub CLI credentials during an agentic session.

The short answer

QuestionAnswer
Is it enabled by default?No. It must be enabled for new sessions in a project.
What can be restricted?Filesystem access, internet, local network and Git credentials.
What if the operating system cannot enforce it?The session fails instead of running without protection.

Reduce the impact of a bad command

A local agent can read a repository, run tools and change files. Ambiguous instructions, a malicious dependency or injected content may push it beyond the intended task. Sandboxing reduces the accessible surface before execution instead of hoping to identify every dangerous command afterwards.

A policy for each project

Settings define additional read-write, read-only and denied folders. They also control internet, local network and credential forwarding. An enterprise can impose a policy that is more restrictive than the one requested by a developer.

Existing sessions do not change automatically

The Sandbox new sessions switch applies to future sessions. An active session can use /sandbox on, but complete policy changes require a restart. Cloud sandbox sessions and remote hosts use separate mechanisms.

Begin with the minimum

A good configuration allows the working repository, denies personal directories and blocks networking until required. Credentials should only be provided for an explicit task. Because the feature is in public preview, teams should also retain human review of every proposed change.