Security for Copilot Development: Lock down the Copilot CLI

Part 10 of 16

Lock down the Copilot CLI

The CLI keeps its settings in ~/.copilot/settings.json, and its sandbox is off by default (GitHub docs). Turn on sandbox.enabled, and set permissions.disableBypassPermissionsMode to "disable" so --yolo and every allow-all flag are ignored.

Approvals you save go to ~/.copilot/permissions-config.json and apply from then on, and GitHub warns that “Scoping of permissions is heuristic”. Review that file, and use --deny-tool for commands the CLI must never run: a deny rule blocks the tool outright and takes precedence over allow rules, even with --allow-all (GitHub docs).

The CLI settings are in the audit’s fix section.