Piloting agents in GitHub Copilot

Christopher Harrison, Microsoft59:07 · Jul 2025 · 11K views
Thumbnail for Piloting agents in GitHub Copilot Watch on YouTube
TL;DR
  1. 1

    GitHub Copilot works best when treated like a pair programmer that receives clear context from the prompt, codebase, comments, project structure, and instruction files.

  2. 2

    Copilot's agent modes can explore projects, edit multiple files, run tests, recover from errors, and work asynchronously on GitHub issues through Copilot Coding Agent.

  3. 3

    AI-generated code still needs the same review, tests, linting, security scans, and governance used for code written by developers.

Summary

Christopher Harrison presents GitHub Copilot as an AI pair programmer with several workloads: inline completion, ask and edit chat, local agent mode, and Copilot Coding Agent. The talk spends most of its time on context. Copilot uses the prompt alongside readable code, comments, repository structure, examples, instruction files, and the environment it is given. Harrison demonstrates repository-wide instructions, task-specific instruction files, path-based matching, and the setup workflow used by Coding Agent. He also explains how Model Context Protocol lets Copilot call external services, including databases and GitHub, while warning that MCP servers can read data and perform actions. Coding Agent runs in an ephemeral GitHub Actions environment with restricted repository and network access. Harrison is clear that AI does not remove normal engineering controls. Developers should still review pull requests and run tests, linters, and security checks.

Key ideas
03:43

Copilot should be treated as a pair programmer with strengths and limits

Harrison frames GitHub Copilot as an AI pair programmer rather than an autonomous replacement for a developer. Like a human partner, it can handle particular tasks well and struggle with others. He introduces inline code completion, ask mode for one-shot explanations or file creation, edit mode for changing multiple files, local agent mode, and Copilot Coding Agent. Agent mode can explore a project, find files, run builds and tests, and respond to failures. Coding Agent takes a GitHub issue, works on it asynchronously, and returns a proposed change.

05:35

Context comes from the whole project, not just the prompt

Harrison uses a brunch conversation to explain how answers improve as more context arrives. The same pattern applies to Copilot. The prompt matters, but Copilot also sees the code, comments, project structure, and examples around the task. Readable names help it understand the code, while abbreviations and single-letter variables make that harder. Comments can explain intent when the code alone is insufficient. A clear repository structure helps Copilot find the files and resources it needs.

09:01

Specific instructions reduce unwanted interpretations

Harrison advises developers to tell Copilot what they know instead of leaving it to guess. He calls this avoiding passive-aggressive prompting. Instructions should state the intent clearly, use ordinary natural language, and describe the required implementation when a specific approach matters. He recommends being more verbose than the terse commands people used with older chatbots. The example is simple: if a wall must be a particular shade of red, say which shade. The same applies to code generation.

10:38

Copilot supports several workloads for different levels of control

Inline completion helps while a developer is already coding and can suggest the next line, block, class, or function. Ask mode handles single-shot requests such as explaining code or creating a file. Edit mode changes several files together, which fits ordinary web updates across HTML, CSS, and JavaScript. Local agent mode explores the project, runs external tasks, builds code, runs tests, and can recover when something fails. Copilot Coding Agent takes a repository issue and creates a change while the developer works elsewhere.

32:02

Instruction files put project standards inside the repository

Harrison demonstrates a copilot-instructions.mmd file for chat and Coding Agent. It is a Markdown file containing a project overview, coding standards, language-specific guidance, framework conventions, available scripts, and repository structure. These instructions are considered whenever a local chat request runs or Coding Agent works. He also shows task-specific instruction files for work such as creating a Flask endpoint. Such files can include test guidance, project notes, and links to existing files that should be used as prototypes. Path patterns can apply instructions automatically to matching files.

23:54

MCP gives Copilot controlled access to external services

Model Context Protocol lets Copilot call an MCP server, which can reach external resources. Harrison describes using a GitHub server to create issues or search from chat, and using a database server to retrieve schema or data. A database definition language file may be enough context for Copilot to write queries, and it can be included in instructions. MCP servers can also perform tasks, so Harrison advises trusting a third-party server or creating one internally. He names first-party servers from GitHub, Azure, and Playwright, alongside community servers.

45:05

Coding Agent runs with restricted permissions and a prepared environment

Copilot Coding Agent runs on GitHub Actions in an ephemeral workspace that is torn down after the work finishes. It has read access to the repository and write access only to the branch it creates, such as copilot-fix-2 for issue 2. Network access is blocked unless the firewall is opened, which also prevents installing packages during the task. The copilot-setup-steps workflow prepares libraries, frameworks, services, or scripts before the agent starts. Remote MCP services therefore require explicit firewall configuration.

49:07

AI does not change the normal review and testing process

Harrison applies the same checks to AI-generated code that he applies to developer-written code. Coding Agent may run unit tests locally, but the pull request workflow does not automatically run the repository's tests until a reviewer authorizes it. Before merging, developers should review the code, run unit and end-to-end tests, check linters, and perform security scans. AI can be told to run a smaller relevant test set while working on a large project, followed by the full suite at the end. The existing DevOps process remains in place.

"Context is really key across many aspects of life and it's certainly going to be key whenever we're working with any form of AI and that does include GitHub Copilot."04:55
Who should watch
  • You are evaluating Copilot's agent mode and need to decide which development tasks to delegate while keeping developer control.
  • Your team needs shared coding standards, repository context, or task-specific guidance that Copilot can apply consistently.
  • You want Copilot to access databases or other services through MCP and need to understand the permission and firewall implications.