How to run GitHub Copilot CLI on Windows without giving it the whole machine
Based on a guide by Windows Mode on DEV Community · Dec 2, 2026
You'll end with: Copilot CLI on Windows that starts from one trusted repo folder, with deny rules on risky commands and the OS sandbox turned on.
Why it's worth having: Deny rules beat every allow option, so pushing stays a human step, and sandboxed commands write only in the repo, temp folders, and Git metadata.
At a glance
The method, in short
- 1Install Copilot CLI with winget, start it from the repo root, and trust that folder, never your user profile.
- 2Treat the approve-for-session option with care, since it approves the whole tool, such as every rm command.
- 3Block risky commands such as git push with --deny-tool, which wins over every allow option.
- 4Turn on /sandbox on a supported Windows 11 build, and add a repo instructions file with build, test, and no-touch rules.
Read the full guide from Windows Mode on DEV Community
The post has the install commands, deny rule examples, the sandbox build numbers, and a full daily setup.