Delegating work to GitHub Copilot's background agent

GitHub Copilot coding agent is designed to take an issue and return a pull request without you touching the keyboard in between. It runs asynchronously in the background—fixing bugs, adding tests, paying down technical debt—while you keep working in your editor. When it finishes, it opens a PR for your review.

Recent releases have expanded what the agent can do before it hands work back to you. Here's a rundown of the changes and how to put them to use.

Pick a model based on the job

Every background task used to run on the same default model. The Agents panel now includes a model picker, so you can choose a faster model for routine work like unit tests or a stronger one for a gnarly refactor with real edge cases. If you don't want to decide, leave it on auto and let GitHub select the model.

  • Open the Agents panel (top-right in GitHub), select your repo, and pick a model.
  • Write a clear prompt and kick off the task.
  • Leave the model on auto if you'd rather let GitHub choose.

Model selection is available now for Copilot Pro and Pro+ users, with Business and Enterprise support coming later.

The agent reviews its own PR before you see it

A common complaint about AI-generated patches is that the logic works but the code style leaves something to be desired—requiring cleanup on the reviewer's end. Copilot coding agent now runs Copilot code review on its own changes before opening the pull request. It gets feedback, iterates on the patch, and only requests your review after it has gone through its own pass. In one demonstration, the agent identified its own overly complex string concatenation and fixed it before the PR ever landed.

  • Assign an issue to Copilot or create a task from the Agents panel.
  • Click into the task to view the logs.
  • See the moments where the agent ran Copilot code review and applied feedback.

Review the pull request when prompted—the agent will have already iterated on its own work.

Security scanning built into the workflow

AI-generated code can introduce the same risks as human-written code—vulnerable patterns, accidentally committed secrets, dependencies with known CVEs—just faster. Copilot coding agent now runs code scanning, secret scanning, and dependency vulnerability checks inside its workflow. Issues get flagged before the pull request opens, and code scanning normally reserved for GitHub Advanced Security is included at no extra cost with the agent.

  • Run any task through the Agents panel.
  • Check the session logs as it runs—you'll see scanning entries.
  • Review the pull request—it's already been through the security filter.

Custom agents codify your team's process

A short prompt leaves a lot to interpretation. Custom agents let you bake your team's conventions into the task definition. Create a file under .github/agents/ that describes a specific approach—for instance, a performance optimizer agent that benchmarks first, makes a change, then measures the result before opening a PR. In a recent GitHub Checkout demo, an agent built this way benchmarked a lookup, made a targeted fix, and returned a 99% improvement on that single function.

  • Create an agent file under .github/agents/ in your repo.
  • Open the Agents panel and start a new task.
  • Select your custom agent from the options.
  • Write a prompt scoped to what that agent does.

Custom agents can be shared across an organization or enterprise, so the same process applies wherever teams use the coding agent.

Hand off between cloud and local without losing context

Switching between the cloud-based agent and your local terminal used to mean starting the conversation over. Now a cloud session can be pulled into your terminal with the branch, logs, and full context intact. Press & in the CLI to push work back to the cloud and keep going locally.

  • Start a task with Copilot coding agent and wait for the session to appear.
  • Click "Continue in Copilot CLI" and copy the command.
  • Paste it in your terminal to load the session locally with branch, logs, and context intact.
  • Press the ampersand symbol (&) in the CLI to delegate work back to the cloud and keep going locally.

These features—model selection, self-review, security scanning, custom agents, CLI handoff—are just the recent additions. The team is working on private mode, planning before coding, and using the agent for tasks that don't need a pull request, like summarizing issues or generating reports. Feedback on what ships next goes through GitHub Community discussions.