Configuration reference

GH-600 shows you configuration files and asks what they do, what is missing or what is unsafe. This page collects the syntax of every file and flag the skill pages rely on, with the properties and defaults that questions tend to hinge on.

Deep dive · Files & flags Skills measured: study guide revision of May 4, 2026

Where everything lives

flowchart TB
  subgraph REPO["Repository — versioned in Git"]
    direction TB
    subgraph DOTGH[".github/ — protect it with CODEOWNERS"]
      direction LR
      INSTR["copilot-instructions.md<br/>instructions/*.instructions.md"]
      AGENTS["agents/*.agent.md"]
      SKILLS["skills/NAME/SKILL.md"]
      HOOKS["hooks/*.json"]
      WF["workflows/copilot-setup-steps.yml<br/>workflows/*.md + *.lock.yml"]
    end
    ROOTF["AGENTS.md · CLAUDE.md · GEMINI.md · CODEOWNERS"]
  end
  subgraph SETTINGS["Repository settings — not in Git"]
    direction LR
    MCPS["Copilot → MCP servers<br/>JSON"]
    NET["Copilot → Internet access<br/>firewall"]
    SEC["Secrets and variables → Agents"]
  end
Customization lives in two places: versioned files in the repository, and settings that are not in Git.
File or settingLocationRead by
Repository instructions.github/copilot-instructions.mdChat, cloud agent, code review, CLI, IDEs
Path-specific instructions.github/instructions/**/*.instructions.mdCloud agent, code review, CLI, IDEs
Agent instructions**/AGENTS.md (nearest wins); root CLAUDE.md or GEMINI.mdCloud agent, CLI, IDEs; code review reads AGENTS.md
Prompt files.github/prompts/*.prompt.mdIDEs only
Custom agents.github/agents/NAME.agent.md; org/enterprise agents/NAME.md in .github or .github-privateCloud agent, Copilot app, CLI, IDEs
Skills.github/skills/, .claude/skills/ or .agents/skills/; personal ~/.copilot/skills/Cloud agent, code review, CLI, Copilot app, VS Code
Hooks.github/hooks/*.json; CLI also ~/.copilot/hooks/ and machine policy directoriesCloud agent, CLI (VS Code in preview)
Setup steps.github/workflows/copilot-setup-steps.yml (default branch)Cloud agent; code review too, unless copilot-code-review.yml exists
Repository MCP serversSettings → Copilot → MCP servers (JSON)Cloud agent and code review
FirewallSettings → Copilot → Internet accessCloud agent and code review (configured separately)
Agent secretsSettings → Secrets and variables → AgentsCloud agent (COPILOT_MCP_* only to MCP servers)
Agentic workflows.github/workflows/NAME.md + compiled NAME.lock.ymlGitHub Actions
Enterprise managed settingsmanaged-settings.json, usually in .github-private, or deployed by MDMCopilot clients (CLI, IDEs)

Custom agent profile

.github/agents/test-specialist.agent.md
---
name: test-specialist                  # optional; defaults to the file name
description: Improves test coverage without changing production code   # REQUIRED
target: github-copilot                 # vscode | github-copilot; omit for both
tools: ["read", "search", "edit", "execute", "github/*"]   # omit or ["*"] = all; [] = none
model: gpt-5.4                         # optional; inherits the default if unset
disable-model-invocation: false        # true = never auto-selected (and not callable as a subagent)
user-invocable: true                   # false = hidden from manual selection, programmatic only
mcp-servers:                           # this agent only; ignored by IDE custom agents
  coverage:
    type: local
    command: npx
    args: ["coverage-mcp@latest"]
    tools: ["get_report"]
metadata:
  owner: qa-platform
---

You are a testing specialist. Analyse coverage gaps and add unit and integration tests.
Only change files under tests/. Never delete or skip an existing test.
PropertyNotes
descriptionThe only required property. Also what runtimes use to decide when to delegate — be specific.
nameOptional display name; the filename (minus .md / .agent.md) is the identifier. Filenames may use only . - _ a-z A-Z 0-9.
toolsOmitted or ["*"] = all; [] = none; aliases read, edit, search, execute, agent, web, todo; MCP tools as server/tool or server/*; unknown names ignored.
targetvscode or github-copilot; both when omitted.
modelModel override; inherits the default when unset.
disable-model-invocationtrue = must be selected manually; equivalent to the retired infer: false and takes precedence over it.
user-invocablefalse = cannot be selected manually; programmatic use only. Default true.
mcp-serversMCP servers for this agent only. Supports ${{ secrets.X }} and ${{ vars.X }}. Not used by IDE custom agents.
metadataName/value annotations. Not used by IDE custom agents.
BodyThe agent's prompt, up to 30,000 characters.
handoffs, argument-hintVS Code only — ignored by cloud agent on GitHub.com.

Profiles are versioned by the commit SHA of the file; a PR keeps using the version that started it. On a name clash, repository beats organization beats enterprise.

Custom instructions

markdown
# .github/copilot-instructions.md — repository-wide, applied to every request
This is a Go service with a Ruby client.

## Build and test
- Build: make build
- Test:  make test      (run before every commit)
- Full CI check: make ci

## Conventions
- Run make fmt before committing.
- Changes under proto/ require make proto.
.github/instructions/typescript.instructions.md
---
applyTo: "**/*.ts,**/*.tsx"
excludeAgent: "code-review"      # or "cloud-agent"; omit to apply to both
---

Use strict TypeScript. Prefer named exports. Every component needs a test.
  • applyTo takes comma-separated globs; "**" applies everywhere.
  • excludeAgent: "code-review" or "cloud-agent" keeps a file away from one agent.
  • Personal instructions take priority over repository ones, which take priority over organization ones — but all relevant sets are sent.
  • The first time Copilot opens a PR in a repository, it leaves a link to generate instructions automatically.

Agent skills

.github/skills/github-actions-failure-debugging/SKILL.md
---
name: github-actions-failure-debugging          # lowercase, hyphenated; matches the folder
description: Debug failing GitHub Actions workflows. Use when asked to fix a failing CI run.
allowed-tools: shell                            # optional pre-approval — trusted skills only
---

1. Use list_workflow_runs to find the failing run for the PR.
2. Use summarize_job_log_failures to understand what failed.
3. Reproduce the failure locally, fix it, and confirm before committing.
  • The file must be named SKILL.md, in its own lowercase, hyphenated folder; name and description are required, license optional.
  • Scripts and resources in the folder are made available when the skill is used; reference them from the instructions.
  • allowed-tools pre-approves tools — pre-approve shell or bash only for skills you have reviewed and fully trust.
  • gh skill in GitHub CLI can search, install, update and publish skills.

copilot-setup-steps.yml

.github/workflows/copilot-setup-steps.yml
jobs:
  copilot-setup-steps:        # exact name required; file must be on the default branch
    runs-on: ubuntu-latest    # larger, self-hosted (ARC) or Windows labels allowed
    timeout-minutes: 30       # <= 59
    permissions:
      contents: read
    services:                 # e.g. a database for integration tests
      postgres:
        image: postgres:17
        env:
          POSTGRES_PASSWORD: postgres
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-node@v7
        with:
          node-version: "24"
          cache: "npm"
      - run: npm ci
RuleDetail
Job nameExactly copilot-setup-steps, or it is not picked up
Customizable keyssteps, permissions, runs-on, services, snapshot, timeout-minutes (max 59) — everything else ignored
BranchMust be on the default branch to take effect; it also runs as a normal workflow when changed, so you can test it
FailureA failing step skips the remaining setup; Copilot starts anyway
Checkoutfetch-depth is overridden; if you do not check out, Copilot does it after setup
RunnersUbuntu x64 or Windows 64-bit only; self-hosted must be ephemeral and needs the integrated firewall disabled

MCP configuration

Repository settings (cloud agent and code review)

Settings → Copilot → MCP servers
{
  "mcpServers": {
    "sentry": {
      "type": "local",                                   // local | stdio | http | sse
      "command": "npx",
      "args": ["@sentry/mcp-server@latest"],
      "tools": ["get_issue_details"],                     // REQUIRED — allowlist tools
      "env": { "SENTRY_ACCESS_TOKEN": "$COPILOT_MCP_SENTRY_TOKEN" }
    },
    "cloudflare": {
      "type": "sse",
      "url": "https://docs.mcp.cloudflare.com/sse",
      "tools": ["*"]
    }
  }
}
KeyApplies toNotes
typeAll — requiredlocal / stdio (same thing), http, sse
toolsAll — requiredAllowlist; prefer specific read-only tools, ["*"] enables all
command, argsLocal — requiredHow to start the server
envLocalLiteral values or $COPILOT_MCP_* references
urlRemote — requiredServer endpoint; OAuth-only remote servers are not supported
headersRemoteLiteral values or $COPILOT_MCP_* references

Reusing a VS Code mcp.json? Add a tools key to each server and replace inputs and envFile with env. Only COPILOT_MCP_-prefixed Agents secrets and variables are available to MCP configuration.

Copilot CLI

jsonc
// ~/.copilot/mcp-config.json — Copilot CLI user configuration
{
  "mcpServers": {
    "github": {
      "type": "http",
      "url": "https://api.githubcopilot.com/mcp/readonly"
    }
  }
}

/mcp add writes to ~/.copilot/mcp-config.json; a repository .mcp.json adds workspace servers; --additional-mcp-config adds servers for one session; --disable-builtin-mcps turns off the built-in GitHub MCP server; --add-github-mcp-toolset and --enable-all-github-mcp-tools widen it beyond the CLI's default subset.

For MCP allowlists in managed-settings.json and registry requirements, see Skill 2.

Hooks

.github/hooks/agent-hooks.json
{
  "version": 1,
  "hooks": {
    "sessionStart":        [{ "type": "command", "bash": "./scripts/log-start.sh", "timeoutSec": 10 }],
    "userPromptSubmitted": [{ "type": "command", "bash": "./scripts/log-prompt.sh" }],
    "preToolUse":          [{ "type": "command", "matcher": "bash", "bash": "./scripts/policy.sh", "timeoutSec": 15 }],
    "postToolUse":         [{ "type": "http", "url": "https://audit.contoso.com/copilot" }],
    "errorOccurred":       [{ "type": "command", "bash": "./scripts/alert.sh" }],
    "sessionEnd":          [{ "type": "command", "bash": "./scripts/cleanup.sh", "timeoutSec": 60 }]
  }
}
EventFiresCan change the outcome?
sessionStart / sessionEndSession begins or resumes / endsStart can inject context; end is notification
userPromptSubmittedA prompt is submittedLogging; prompt rewrite only for SDK hooks
preToolUseBefore every tool callYes — allow, deny (with reason) or modify arguments
postToolUseAfter a successful tool callCan replace the result or add context
postToolUseFailureAfter a failed tool callCan add recovery guidance
agentStop / subagentStopMain agent or a subagent finishesCan block and force another turn (runaway guard after 8)
subagentStartA subagent is spawnedCan add context, cannot block
errorOccurredAn error occursNo — logging and alerts
permissionRequest, preCompact, notificationCLI permission flow, compaction, notificationsPermission can allow or deny; others informational
preToolUse output that blocks a call
{"permissionDecision": "deny", "permissionDecisionReason": "Force pushes are not allowed"}
BehaviourRule
Format"version": 1; each event is an array; entries are command (bash, powershell, command, cwd, env, timeoutSec) or http (url, headers)
Default timeout30 seconds (timeoutSec); keep hooks under ~5 seconds — they run synchronously and block the agent
Exit code 2A warning for most events; a deny for preToolUse and permissionRequest
Other non-zero exitsLogged and skipped (fail-open) — except preToolUse command hooks, which fail closed
TimeoutsAlways fail-open, even for preToolUse and policy hooks
Several hooksRun in order; for preToolUse any "deny" blocks the tool
Cloud agentLinux sandbox; only bash (or command) honoured; working directory /workspace; files discarded after the job (send logs via http); outbound calls need a firewall allow rule; "ask" = deny; GITHUB_TOKEN is not set
CLI onlyMachine-wide policy hooks (/etc/github-copilot/policy.d/, C:\ProgramData\GitHub\Copilot\policy.d\) load first and cannot be disabled by users

GitHub Agentic Workflows

.github/workflows/daily-status.md
---
on:
  schedule: daily                 # any GitHub Actions trigger
permissions:
  contents: read                  # read-only unless you grant more
  issues: read
  pull-requests: read
  copilot-requests: write         # bill Copilot usage to the organization via GITHUB_TOKEN
engine: copilot                   # default; claude, codex and gemini also supported
network: defaults                 # firewalled egress
tools:
  github:
    toolsets: [default]
safe-outputs:
  create-issue:                   # the ONLY write this workflow may perform
    title-prefix: "[repo-status] "
    labels: [report]
max-ai-credits: 300               # per-run cap (default 1,000 AIC)
---

# Daily repository status

Summarize the last 24 hours of issues, pull requests and commits.
Highlight blockers and recommend next steps. Keep it short and link everything.
GitHub CLI extension
gh extension install github/gh-aw     # install the extension
gh aw init                               # add authoring skills, instructions and an agent
gh aw compile                            # markdown -> hardened .lock.yml (commit both)
gh aw run daily-status                   # run a workflow
gh aw logs                               # recent runs: duration, tokens, AIC estimates
gh aw audit 1234567890                   # inspect one run in detail
  • The markdown body states intent; the frontmatter defines the boundaries. Both the .md and the compiled .lock.yml are committed to the default branch.
  • Guardrails: read-only permissions by default, writes only through validated safe-outputs, secrets kept out of the agent's runtime, threat detection on proposed outputs, firewalled containers, role-based control of who can trigger or edit.
  • Authentication: GITHUB_TOKEN with copilot-requests: write in organization repositories (the "Allow use of Copilot CLI billed to the organization" policy must be on), or a COPILOT_GITHUB_TOKEN fine-grained PAT for personal repositories.
  • Cost: Actions minutes plus inference, tracked as AI credits (1 AIC = $0.01); max-ai-credits caps a run (default 1,000).

Copilot CLI

OptionEffect
-p, --promptRun one prompt non-interactively and exit; anything not pre-approved is denied
-sSilent — clean output for scripts
--no-ask-userDisables the ask_user tool; the agent decides on its own
--allow-tool / --deny-toolPre-approve / forbid tools (deny wins); patterns such as shell(git:*), write(path), Server(tool)
--available-tools / --excluded-toolsRestrict which tools the model can see
--allow-all-tools, --allow-all / --yoloGrant everything (tools, paths, URLs) — sandboxes only; can be disabled by policy
--agent=NAMEUse a custom agent
--modelPin the model for consistent automation
--plan, --autopilotStart in plan mode; keep working until the task is complete
--max-autopilot-continues=NCap autopilot's automatic continuations — always set it in automation
--fleetRun the prompt with parallel subagents
--continue, -r / --resumeResume the latest session here, or pick one by ID or name
-w, --worktreeRun the session in its own Git worktree
--secret-env-varsRedact variables from shell and MCP environments (GITHUB_TOKEN and COPILOT_GITHUB_TOKEN are redacted by default)
--share=FILE, --share-gistExport the session transcript as evidence
Slash commandEffect
/plan · Shift+TabPlan mode; cycling further reaches autopilot
/agentChoose a custom agent
/fleetParallel subagent execution of a plan
/delegate or an & prefixHand the task to Copilot cloud agent (branch + draft PR)
/research, /review, /security-reviewBuilt-in research, code-review and security-review agents
/context, /compactShow context usage; summarize history (auto at ~80%)
/rewind · Esc EscRoll back conversation, optionally restoring files
/clear, /newStart a fresh conversation
/allow-all (/yolo), /reset-allowed-toolsGrant all permissions for the session; revoke granted permissions
/mcpAdd, list, enable, disable and authenticate MCP servers

Package and command names

The CLI is installed with npm install -g @github/copilot and runs as copilot. Some Learn material shows npx @github/copilot-cli or a copilot agent run subcommand; neither matches the current documentation, so read such options for their intent (programmatic run, a named agent, restricted tools) rather than their exact spelling.

GitHub Actions building blocks

yaml
on:
  pull_request:
    branches: [main]
  workflow_dispatch:

permissions:
  contents: read                              # least privilege by default

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  plan:
    if: github.event_name == 'pull_request'   # defensive gating: PR-only logic
    runs-on: ubuntu-latest
    outputs:
      risk: ${{ steps.plan.outputs.risk }}    # job output = contract for later jobs
    steps:
      - id: plan
        run: echo "risk=low" >> "$GITHUB_OUTPUT"   # step output

  deploy:
    needs: plan
    if: needs.plan.outputs.risk == 'low'
    runs-on: ubuntu-latest
    environment: production                   # required reviewers, scoped secrets
    env:
      REGION: ${{ vars.DEPLOY_REGION }}       # vars.* = centrally managed configuration
    steps:
      - run: echo "Deploying to $REGION"
Building blockWhy it matters for agents
permissionsLeast privilege; set a read-only default and elevate per job
concurrencyStops overlapping runs; key on workflow and ref; a fixed group serializes deploys
environmentRequired reviewers, wait timers and environment-scoped secrets gate risky jobs
Step outputs ($GITHUB_OUTPUT) and job outputsExplicit contracts for passing plans and risk ratings between steps and jobs
needsSequencing and fan-in
workflow_runStart one workflow when another completes
if: github.event_name == 'pull_request'Defensive gating so PR-only logic never runs on other triggers
Contextsgithub.* event metadata, vars.* central configuration, env.* runtime variables
actions/upload-artifact / download-artifactDurable evidence and cross-job handoff; retention-days overrides the default 90
$GITHUB_STEP_SUMMARYHuman-readable evidence on the run page
GITHUB_TOKEN triggersEvents created with GITHUB_TOKEN mostly do not start new workflow runs, preventing loops; PATs and GitHub App tokens can — design against recursion

Pull request template

markdown
<!-- .github/pull_request_template.md -->
## Plan (required)
- **Goal:**
- **Scope (paths):**
- **Steps:**
- **Success criteria:** [ ] required checks pass  [ ] security signals reviewed
- **Risks and mitigations:**
- **Rollback / escalation:**

## Evidence
- Workflow run(s):
- Scan results:

## Decisions and handoffs
- Decision / rationale / next owner:

Pair it with a plan-gate required check (see Skill 1) and a CODEOWNERS file with required code-owner review (see Skill 6).