Combine repository guidance with explicitly authorized tools, without treating instructions as security controls.
Coding & development · Documented · Documentation checked 2026-10-04
Editor assistance and agents, GitHub cloud agent, and code review have different execution contexts.
Plan, supported IDE, repository permission, AI credits, and organization policy determine access.
The worked example is illustrative and has not been tested in a signed-in product account.
What it does and how it connects
Combine repository guidance with explicitly authorized tools, without treating instructions as security controls.
Repository instructions describe project conventions; custom agents package task roles; MCP adds tool access. The documented repository-wide instruction file is .github/copilot-instructions.md. Path-specific and other instruction support varies by surface; a file present in the repo does not prove every Copilot feature uses it.
Walkthrough
Use the product named in the access panel. The steps below combine documented controls with the editorial example.
- Inspect existing instructions and add accurate build / test guidance.
- Attach the intended repository context on a supported surface.
- Configure only a trusted MCP server and the operations needed for the task.
- Test read-only context retrieval and inspect applied guidance before permitting writes.
Worked example
Use repository instructions to preserve ordinary document links and an MCP tool to read one approved issue. Keep these concerns separate: one describes how to work; the other provides external context and account authority.
# Repository guidance
Use ordinary document links for navigation.
Preserve existing owner content and drafts.
Use the documented project checks and report their actual results.
Keep changes scoped to the requested behavior.
Do not merge, deploy, or write to connected services without authorization.
Inspect and verify the result
Check instruction support for the selected client and review source identity from the tool call. Verify referenced commands. Test an absent-source request to ensure it produces an explicit limitation.
Limits and troubleshooting
Instruction support differs across chat, code review, cloud agent, and IDEs. Conflicting guidance can confuse behavior. MCP servers can expose broader operations than required; configure or deny them at the enforcement layer.
Data, permissions, and actions
Repository guidance can include internal information and external calls can disclose it. Review service scopes and tool trust. Prompt files and custom agents do not replace access controls or branch protection.
Related reading
Cloud agent and pull request handoff
Turn a well-defined repository issue into a reviewable branch and pull request.
An editor fix with a checked handoff
Move from a checked suggestion to a scoped IDE agent change.
From a clear issue to a reviewed pull request
Create a cloud-agent change and a human-reviewed pull-request handoff.
Plugins, connectors, and skills
Separate packaged capabilities, reusable instructions, and the connections that let AI reach other software.
Sources and verification
Documentation checked 2026-10-04. Examples are illustrative unless described otherwise.
Repository custom instructions · GitHub
Enhance agent mode with MCP · GitHub
About GitHub Copilot · GitHub