Coding Agent

GitHub calls the “research the repo, change code, open a PR” capability Copilot cloud agent (often “coding agent” in conversation). It runs in a GitHub-hosted environment, not as a silent process on your laptop. Official doors:

Whether you see it depends on plan and org policy. If you have no allowance or an admin disabled the agent, do not follow unofficial “unlock” guides. Prices and caps still follow Plans.


Versus Agent mode in the IDE

VS Code Chat Agent modeCloud agent
RunsYour machine (workspace + local terminal)GitHub-hosted environment
Typical outputLocal diff you Keep / undoCommits on a branch, usually a pull request
FitsYou watching, ready to stopAsync: review a PR later
How you steerApprove tools / commandsReview the PR and follow up on the PR, not with late Issue comments

GitHub is explicit: when you assign an Issue to Copilot, it reads the title, body, and existing comments at assignment time. Comments added after assignment are not seen. Put follow-ups on the pull request.


Path 1: Assign the Issue to Copilot (always opens a PR)

This is the official Issue → PR path.

  1. Open the Issue on GitHub (the repo must allow the Copilot agent; otherwise the assignee choice is missing).
  2. Assignees in the right sidebar → Copilot.
  3. Optional: Optional prompt for coding patterns, files to touch, test requirements.
  4. Optional: target repo, base branch, custom agent, model.
  5. Confirm. Copilot works in the cloud and requests your review when it finishes.

Write the Issue like you would for a coworker: repro, success bar, directories not to touch. A vague “make it faster” becomes a vague PR.

Third-party coding agents (public preview on paid plans) may appear in the assignee list—trust GitHub’s note on the page.


Path 2: Start from a prompt (branch first by default)

  1. Open the Agents panel (top right), the repo’s Agents tab, or github.com/copilot/agents.
  2. Pick a repository and type the task. You may attach PNG/JPEG/GIF/WebP screenshots.
  3. If you want a PR immediately, say so in the prompt, e.g. Open a pull request to ….
  4. Optionally set base branch, agent, and model, then submit.

Official default: the cloud agent works on a new branch first. You inspect the diff, steer with follow-up prompts, then open a PR in one click. Session logs show progress. The full research → plan → iterate loop is Research, plan, and iterate on code changes with Copilot cloud agent.

The same prompt box appears on your dashboard and in Copilot Chat as /task.


Path 3: Seed a new repository

When creating a repo you can describe what to build (for example Create a Rust CLI for converting CSV to Markdown). Copilot opens a draft PR with scaffolded code. You still review it; it is not a production switch.


IDE and desktop app

  • VS Code Chat → Agent: multi-file edits on your machine. Start with a small job (add a test, change copy) and watch which commands it runs.
  • GitHub Copilot app: official desktop app for parallel agent sessions and PR lifecycle. Start from Getting started with the GitHub Copilot app.
  • Custom instructions: repo-level files (commonly .github/copilot-instructions.md) steer style and validation—see Adding repository custom instructions. Never put secrets in that file.

MCP, hooks, and custom agents are advanced; this chapter only requires assign Issue → PR appears → human review. For the protocol itself, see this site’s MCP course.

Repos can also configure the agent’s dev environment, firewall, and secrets—see Configure the development environment and Configure secrets and variables for Copilot cloud agent. Your Windows / macOS laptop does not need Docker for the cloud agent; compute is on GitHub’s side.


What to hand the cloud agent

A good fit: a small feature with a success bar, extra tests, copy edits, a read-only endpoint on the existing stack.

A poor fit: “modernize the architecture,” a bug with no repro, a migration that needs production secrets, a refactor you cannot explain. Narrow those in IDE Chat first, or split them into several Issues.

Session control (pause, follow-up prompts, archive) is Managing agent sessions. Do not run five parallel agents on the same module.


Security and review (GitHub’s stance)

GitHub describes isolation and firewall mitigations for the cloud agent, but risk remains: bad refactors, dependency confusion, secrets in the diff. You should:

  • Enable the agent only on repos that allow it
  • Review Copilot PRs like any other contribution (Review output from Copilot)
  • Not treat Copilot’s Approve as a human approval that satisfies required-reviewer counts—docs state Copilot reviews do not count toward those rules

Windows and macOS users do the same work in the browser; the only difference is which IDE you use later to pull the branch and verify.


Next

评论