Repository navigation
Adapter GitHub Copilot
The Copilot adapter (harness copilot) discovers GitHub Copilot
configuration for Copilot CLI, the Copilot cloud agent, and the files
VS Code's Copilot reads from .github/. It never starts Copilot, runs a
hook or workflow, starts an MCP server, or invokes git. Every repository
file is treated as attacker-controlled.
Copilot also loads files other adapters report: AGENTS.md, shared
skills, .vscode/mcp.json, and .vscode/tasks.json (generic;
the VS Code files use harness vscode), and .mcp.json and
.claude/settings.json (Claude). Session logs are not read.
Copilot reads .github/ from the repository root only, so only the root
is scanned. Matching is case-insensitive.
| Location | Normalized kinds |
|---|---|
.github/hooks/*.json |
hook; permissions for disableAllHooks
|
.github/copilot/settings.json, .github/copilot/settings.local.json
|
hook (inline hooks); permissions for disableAllHooks
|
.github/agents/*.agent.md |
instructions (role agent), plus frontmatter hooks and mcp-servers
|
.github/copilot-instructions.md |
instructions (role copilot-instructions) |
.github/instructions/**/*.instructions.md |
instructions (role instructions) |
.github/workflows/copilot-setup-steps.yml |
env-setup |
.github/workflows/copilot-setup-steps.yaml is not read. GitHub documents
only the .yml path: "You can customize Copilot's environment by creating
a special GitHub Actions workflow file, located at
.github/workflows/copilot-setup-steps.yml within your repository."
(Customize the agent environment).
$COPILOT_HOME, default ~/.copilot:
| Location | Normalized kinds |
|---|---|
mcp-config.json |
mcp-server (mcpServers) |
settings.json |
hook (inline hooks), permissions
|
hooks/*.json (at most 256) |
hook |
COPILOT_HOME is handled like CODEX_HOME.
Policy hook files, *.json in /etc/github-copilot/policy.d/ (Linux,
macOS) or %ProgramData%\GitHub\Copilot\policy.d\ (Windows), at most 256.
The Windows registry policy source
(HKLM\Software\Policies\GitHub\Copilot) is not read.
Every key below also carries a trailing content digest of the full
sanitized entry, so two entries that match on the fields listed here but
differ elsewhere (two unnamed uses: actions/github-script@v7 steps with
a different with.script, say) still get distinct keys and
fingerprints; see fingerprint.md. When sanitizing removed
anything from the entry, in any field (a --token value in
commandWindows, a redacted env value, a URL query), the key also
ends with a secret discriminator (sig:k1: with a fingerprint
key, sig:s1: without one), so entries that differ only in what
redaction replaced with [REDACTED] stay distinct too.
- Hooks (
{"version": 1, "disableAllHooks": false, "hooks": {...}}): one item per handler with every field (type,bash,powershell,command,exec,args,cwd,url,prompt,timeoutSec,matcher,allowedEnvVars, ...) andevent.envandheadersvalues are redacted, with names inenv_keysandheader_keys. A handler may also be a Claude-format matcher group ({"matcher", "hooks": [...]}). The key is["hook", event, matcher, type, action], where the action is the first ofbash,powershell,command,exec,url,prompt,linux,osx,windows. Items from a file withdisableAllHooks: truecarryhooks_disabled: true. - Event names are kept as written. Copilot accepts camelCase
(
preToolUse) and PascalCase (PreToolUse) names and runs both, so case variants in ahooksobject are not reported; exact duplicates are. - Agents: frontmatter
hooksas above, andmcp-servers(ormcpServers) as for Codex. The Markdown body iscontent. Both spellings are read independently: an agent that declares the same server name under both, with different definitions, gets one item per spelling, so one spelling can never shadow the other. -
copilot-setup-steps.yml: one item for the workflow (on,permissions,env,defaults), one for thecopilot-setup-stepsjob without its steps (runs-on,permissions,env,container, ...), and one per step (id,name,uses,run,with,env, ...), keyed by the first present ofid,name,uses,run, and therunscript.envvalues are redacted;withinputs whose name looks secret are redacted. Other jobs are not emitted; a file with nocopilot-setup-stepsjob gets an informational note.
Copilot CLI parses its JSON strictly: a byte-order mark, comments, and
trailing commas are errors. A hook file without "version": 1 is
reported (Copilot rejects the whole file) and its hooks are still emitted.
Agent frontmatter is strict YAML because it can register hooks and
servers; instruction frontmatter (applyTo) is read leniently. The setup
workflow's YAML aliases and anchors are followed, as GitHub Actions
supports them, up to 100 aliases and 10,000 nodes after expansion; a
workflow whose anchors expand past either limit (an "alias bomb") is
reported and not normalized, as are merge keys, which remain unsupported.
Nesting deeper than 64 levels fails closed. A setup workflow that holds a
second YAML document, even an empty one after a trailing ---, is
reported (multiple-documents, exit 3) and not normalized: a YAML
decoder reads only the first document, and another parser may read the
other.
Reads, symlink handling, limits, and diagnostics are those of the Claude adapter.
tripcord hook --harness copilot --event pre-tool reads a preToolUse
hook's stdin from .github/hooks/*.json, for the CLI and the coding
agent (toolName, and toolArgs as a JSON-encoded string or an
object). ParseHookInput keeps the tool name and the command, path,
and url of toolArgs. RenderDecision blocks with exit 2 and the
reason on stderr; an allow exits 0 with nothing on stdout. ask is a
deny: the CLI has a native ask but the coding agent treats one as a
deny, and the two send the same input, so they cannot be told apart.
See Hook.
- The Windows registry policy source
(
HKLM\Software\Policies\GitHub\Copilot); only thepolicy.dfile drop-in is read (see Managed). - Prompt files (
.github/prompts/*.prompt.md). - User-level agents (
~/.copilot/agents/). - Plugin hooks under the plugin install directory.
-
~/.copilot/config.json(no longer read for hooks). - VS Code user settings, including
.vscode/settings.json: see generic.md.
This wiki is generated from docs/ on main by cmd/wikigen. Do not edit it here: change docs/ and open a pull request. Apache-2.0.
Start
Commands
CI and hooks
Configuration
Adapters
- Claude Code
- Codex
- Cursor
- GitHub Copilot
- Gemini CLI
- OpenCode
- Windsurf
- Devin
- Dev Container
- Shared Files
Project