# Engine: GitHub Copilot CLI

GitHub's coding agent, **beta**. Harness runs GitHub Copilot CLI as it is; what differs from Claude Code is listed in the
box **What changes with GitHub Copilot CLI** (Settings -> Engine -> GitHub Copilot CLI). See [Engines](engines.md) for what is common to
every engine.

## Sign-in and providers

Either an **OpenRouter** key (Copilot CLI's "bring your own key": no GitHub account is used), or the token of your
**GitHub Copilot plan**: a fine-grained personal access token with the *Copilot Requests* permission, put in Settings ->
Keys and chosen for **GitHub Copilot plan** in Settings -> Providers (models named `github-copilot/<model>`). There is
no sign-in button: the token is enough. Harness removes every other GitHub token of the server from its environment, so
it never signs in with one you did not choose. **Install** in its panel downloads
the version Harness was tested with (about 225 MB, with Node.js on the server; its first run unpacks about 330 MB more,
once); its data stays in Harness's own folder. Copilot CLI is GitHub's proprietary program: it is downloaded from
GitHub's own package, unmodified.

## Models

`provider/model`: OpenAI's models of the provider's catalogue are listed (`openrouter/openai/gpt-4.1-mini` by default),
and any other model of the provider can be picked as a favourite. No effort levels.

## What works

Conversation, tools, files and the Changes view, memory, skills, MCP servers, steer, agents, the Sandbox mode of a
topic, sandboxed agents, the small calls, thinking with the models that think.

## How Harness adapts it

- **Memory**: Copilot CLI reads the folder's CLAUDE.md, the files it imports and the folder's skills **by itself**;
  Harness adds only what it would not read (the levels above the folder, the turn's own instructions). Each session
  has its own Copilot folder.
- **Rules**: Copilot CLI runs without asking (its option "allow all"; its "autopilot" mode is never used), and its rules are not ones Harness relies on, so rules hold
  **inside the Sandbox only** (see [Engines](engines.md)): there, Harness's sandbox goes around the whole of it.
  Outside it, a session runs with full access and a note says so once per session.
- **MCP servers**: those of Settings -> MCP and Harness's own are given to it at the start of each message.
- **Off**: GitHub's own tools, its web search and web fetch (they need a GitHub sign-in), its self-update, its
  telemetry.

## Limits

- **Estimated cost**: Copilot CLI says the tokens of a turn, not dollars. Harness prices them at the list prices of
  the provider's catalogue; a model without a list price shows no cost, and a budget is then refused.
- It writes two small identifier files in the server user's home folder (`.state/gh`, `.cache/Microsoft`).
- Refused with the reason, never run on another engine: plan mode, the Ask me mode and an agent's approvals, Add to
  task, side questions, an agent's own rules. Pictures attached to a message are given as file paths. It cannot ask
  you questions in the middle of a turn.

## From a terminal

```
maxxing engines install copilot
maxxing engines provider openrouter OPENROUTER_API_KEY
maxxing engines use copilot
maxxing engines model copilot openrouter/openai/gpt-4.1-mini
```
