Secure GitHub Copilot CLI
The GitHub Copilot CLI is a coding agent like Codex or Claude Code, but it has two traits that need a dedicated profile rather than the generic codex one:
- It talks to real GitHub hosts (
github.com,api.github.com) that you usually do not want to MITM, alongside the Copilot API hosts. - Because it reaches non-intercepted hosts, the sandbox CA store must contain the system roots in addition to firma-ca — otherwise the agent hits
UnknownIssueron the real GitHub TLS.
The built-in copilot profile handles all three automatically. You opt in with firma run --profile copilot (or firma run -- copilot, which auto-selects it).
What the copilot profile does
Section titled “What the copilot profile does”| Concern | Generic profile | Copilot profile |
|---|---|---|
| GitHub hosts | intercepted / denied | added to sidecar.interceptor.https_mitm.bypass_hosts |
| Sandbox CA trust store | firma-ca only (Sole) | system roots + firma-ca (AppendSystemRoots) |
| Auth | none | passes through GITHUB_TOKEN, GH_TOKEN, GH_COPILOT_TOKEN |
Copilot’s SQLite session store under ~/.copilot/*.db needs unlink/rename for journal cleanup. This works under any profile: the managed seccomp baseline no longer denies filesystem.delete, and deletes inside the read-write workspace and runtime home succeed while the read-only rootfs still blocks deletes elsewhere.
The CA-append behavior comes from the built-in profile, so you do not configure it by hand. firma config --profile copilot writes the matching mapping and the sidecar.interceptor.https_mitm.bypass_hosts entries.
Step 1: Scaffold the config
Section titled “Step 1: Scaffold the config”firma config --profile copilot --posture devThis selects the copilot mapping (CONNECT classification for the Copilot and GitHub hosts) and seeds sidecar.interceptor.https_mitm.bypass_hosts with github.com, api.github.com, and uploads.github.com so those hosts pass through untouched while firma-ca still covers any intercepted host.
Both github.com and api.github.com map to code.write at CONNECT level;
Copilot service and upload hosts map to communication.external.send. An
opaque GitHub API tunnel can carry writes, so a policy granting only
code.review.read does not permit it. Grant code.write for these destinations
only if that broader access is intended.
The generated firma.toml keeps MITM enabled (the bypass list alone keeps [sidecar.interceptor.https_mitm].enabled = true) and lists mappings/copilot.toml under [authority].mapping_rules_paths.
This profile is intentionally CONNECT-only for github.com, api.github.com and uploads.github.com — every other host it reaches is intercepted, as the Sidecar intercepts everything by default. If you want native GitHub git enforcement for another coding agent, remove github.com from sidecar.interceptor.https_mitm.bypass_hosts (no intercept_hosts entry is needed; removing the bypass is enough) and use the GitHub mapping instead of the Copilot bypass mapping. Without MITM, the Sidecar cannot see POST /{owner}/{repo}/git-receive-pack or POST /{owner}/{repo}.git/git-receive-pack, so it cannot classify git push, enforce branch/ref policy, or inject a git credential.
Step 2: Run Copilot
Section titled “Step 2: Run Copilot”GITHUB_TOKEN=ghp_... \firma run --config .firma/firma.toml --profile copilot -- copilotfirma run -- copilot auto-selects the profile from the command name, so --profile copilot is optional when you invoke the standalone copilot binary. The token is passed through to the sandboxed agent; the SQLite session store lives on the per-session runtime home and is not persisted to the host.
Sharp edges
Section titled “Sharp edges”gh copilotvscopilot. Auto-selection keys off the first command word. The standalonecopilotbinary is detected; thegh copilotextension is not (the command word isgh). Forgh copilot, pass--profile copilotexplicitly.- bwrap only. The profile is validated on Linux
bwrap. macOSvzand Windows/WSL2wsl2are proxy-only compatibility backends and are not validated for Copilot. - CA append is opt-in. The copilot profile sets
AppendSystemRoots; other profiles use theSolefirma-ca trust store unless configured otherwise.
What’s next
Section titled “What’s next”- Wrap an agent with firma run — the full runtime wrapper reference.
- Secure a local coding agent — the same model for Claude Code and Codex.
- Enable HTTPS MITM — how interception and bypass interact.