HOW-TO GUIDE

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

WHO IT'S FOR
Software developers and IT admins who run AI coding agents on Windows PCs.
LEVEL
Beginner
COST
Free to read. Copilot CLI needs a Copilot plan, your own model provider, or an eligible Entra account.
YOU NEED
Windows PowerShell 5.1 or later · winget, or Node.js 22 for npm · A Copilot plan · Windows 11 25H2 or 26H1 for the sandbox

The method, in short

  1. 1Install Copilot CLI with winget, start it from the repo root, and trust that folder, never your user profile.
  2. 2Treat the approve-for-session option with care, since it approves the whole tool, such as every rm command.
  3. 3Block risky commands such as git push with --deny-tool, which wins over every allow option.
  4. 4Turn on /sandbox on a supported Windows 11 build, and add a repo instructions file with build, test, and no-touch rules.

The post has the install commands, deny rule examples, the sandbox build numbers, and a full daily setup.