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
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 setting
Location
Read by
Repository instructions
.github/copilot-instructions.md
Chat, cloud agent, code review, CLI, IDEs
Path-specific instructions
.github/instructions/**/*.instructions.md
Cloud agent, code review, CLI, IDEs
Agent instructions
**/AGENTS.md (nearest wins); root CLAUDE.md or GEMINI.md
managed-settings.json, usually in .github-private, or deployed by MDM
Copilot clients (CLI, IDEs)
Custom agent profile
.github/agents/test-specialist.agent.md
---name: test-specialist # optional; defaults to the file namedescription: Improves test coverage without changing production code # REQUIREDtarget: github-copilot # vscode | github-copilot; omit for bothtools: ["read", "search", "edit", "execute", "github/*"] # omit or ["*"] = all; [] = nonemodel: gpt-5.4 # optional; inherits the default if unsetdisable-model-invocation: false # true = never auto-selected (and not callable as a subagent)user-invocable: true # false = hidden from manual selection, programmatic onlymcp-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.
Property
Notes
description
The only required property. Also what runtimes use to decide when to delegate — be specific.
name
Optional display name; the filename (minus .md / .agent.md) is the identifier. Filenames may use only . - _ a-z A-Z 0-9.
tools
Omitted or ["*"] = all; [] = none; aliases read, edit, search, execute, agent, web, todo; MCP tools as server/tool or server/*; unknown names ignored.
target
vscode or github-copilot; both when omitted.
model
Model override; inherits the default when unset.
disable-model-invocation
true = must be selected manually; equivalent to the retired infer: false and takes precedence over it.
user-invocable
false = cannot be selected manually; programmatic use only. Default true.
mcp-servers
MCP servers for this agent only. Supports ${{ secrets.X }} and ${{ vars.X }}. Not used by IDE custom agents.
metadata
Name/value annotations. Not used by IDE custom agents.
Body
The agent's prompt, up to 30,000 characters.
handoffs, argument-hint
VS 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 requestThis 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.
---name: github-actions-failure-debugging # lowercase, hyphenated; matches the folderdescription: 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
Rule
Detail
Job name
Exactly copilot-setup-steps, or it is not picked up
Allowlist; prefer specific read-only tools, ["*"] enables all
command, args
Local — required
How to start the server
env
Local
Literal values or $COPILOT_MCP_* references
url
Remote — required
Server endpoint; OAuth-only remote servers are not supported
headers
Remote
Literal 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.
/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.
Yes — allow, deny (with reason) or modify arguments
postToolUse
After a successful tool call
Can replace the result or add context
postToolUseFailure
After a failed tool call
Can add recovery guidance
agentStop / subagentStop
Main agent or a subagent finishes
Can block and force another turn (runaway guard after 8)
subagentStart
A subagent is spawned
Can add context, cannot block
errorOccurred
An error occurs
No — logging and alerts
permissionRequest, preCompact, notification
CLI permission flow, compaction, notifications
Permission can allow or deny; others informational
preToolUse output that blocks a call
{"permissionDecision": "deny", "permissionDecisionReason": "Force pushes are not allowed"}
Behaviour
Rule
Format
"version": 1; each event is an array; entries are command (bash, powershell, command, cwd, env, timeoutSec) or http (url, headers)
Default timeout
30 seconds (timeoutSec); keep hooks under ~5 seconds — they run synchronously and block the agent
Exit code 2
A warning for most events; a deny for preToolUse and permissionRequest
Other non-zero exits
Logged and skipped (fail-open) — except preToolUse command hooks, which fail closed
Timeouts
Always fail-open, even for preToolUse and policy hooks
Several hooks
Run in order; for preToolUse any "deny" blocks the tool
Cloud agent
Linux 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 only
Machine-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 triggerpermissions: contents: read # read-only unless you grant more issues: read pull-requests: read copilot-requests: write # bill Copilot usage to the organization via GITHUB_TOKENengine: copilot # default; claude, codex and gemini also supportednetwork: defaults # firewalled egresstools: 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 statusSummarize 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 extensiongh aw init # add authoring skills, instructions and an agentgh aw compile # markdown -> hardened .lock.yml (commit both)gh aw run daily-status # run a workflowgh aw logs # recent runs: duration, tokens, AIC estimatesgh 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
Option
Effect
-p, --prompt
Run one prompt non-interactively and exit; anything not pre-approved is denied
-s
Silent — clean output for scripts
--no-ask-user
Disables the ask_user tool; the agent decides on its own
--allow-tool / --deny-tool
Pre-approve / forbid tools (deny wins); patterns such as shell(git:*), write(path), Server(tool)
--available-tools / --excluded-tools
Restrict which tools the model can see
--allow-all-tools, --allow-all / --yolo
Grant everything (tools, paths, URLs) — sandboxes only; can be disabled by policy
--agent=NAME
Use a custom agent
--model
Pin the model for consistent automation
--plan, --autopilot
Start in plan mode; keep working until the task is complete
--max-autopilot-continues=N
Cap autopilot's automatic continuations — always set it in automation
--fleet
Run the prompt with parallel subagents
--continue, -r / --resume
Resume the latest session here, or pick one by ID or name
-w, --worktree
Run the session in its own Git worktree
--secret-env-vars
Redact variables from shell and MCP environments (GITHUB_TOKEN and COPILOT_GITHUB_TOKEN are redacted by default)
--share=FILE, --share-gist
Export the session transcript as evidence
Slash command
Effect
/plan · Shift+Tab
Plan mode; cycling further reaches autopilot
/agent
Choose a custom agent
/fleet
Parallel subagent execution of a plan
/delegate or an & prefix
Hand the task to Copilot cloud agent (branch + draft PR)
/research, /review, /security-review
Built-in research, code-review and security-review agents
/context, /compact
Show context usage; summarize history (auto at ~80%)
/rewind · EscEsc
Roll back conversation, optionally restoring files
/clear, /new
Start a fresh conversation
/allow-all (/yolo), /reset-allowed-tools
Grant all permissions for the session; revoke granted permissions
/mcp
Add, 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 defaultconcurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: truejobs: 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 block
Why it matters for agents
permissions
Least privilege; set a read-only default and elevate per job
concurrency
Stops overlapping runs; key on workflow and ref; a fixed group serializes deploys
environment
Required reviewers, wait timers and environment-scoped secrets gate risky jobs
Step outputs ($GITHUB_OUTPUT) and job outputs
Explicit contracts for passing plans and risk ratings between steps and jobs
needs
Sequencing and fan-in
workflow_run
Start one workflow when another completes
if: github.event_name == 'pull_request'
Defensive gating so PR-only logic never runs on other triggers
Contexts
github.* event metadata, vars.* central configuration, env.* runtime variables
actions/upload-artifact / download-artifact
Durable evidence and cross-job handoff; retention-days overrides the default 90
$GITHUB_STEP_SUMMARY
Human-readable evidence on the run page
GITHUB_TOKEN triggers
Events created with GITHUB_TOKEN mostly do not start new workflow runs, preventing loops; PATs and GitHub App tokens can — design against recursion