Copilot Agent Mode — Agentic Workflows
Copilot Agent Mode goes beyond single completions — it plans, edits multiple files, runs terminal commands, and validates its own output to complete complex multi-step tasks.
1What is Agent Mode?
In Agent Mode, Copilot acts as an autonomous assistant. You describe a high-level goal and Copilot breaks it into steps, edits files, runs commands, reads output, and iterates until the task is done — or it asks you for clarification.
2Enabling Agent Mode
Open Copilot Chat, click the Agent dropdown at the top of the Chat panel, and switch from Ask to Agent. You'll need Copilot Pro or GitHub Copilot for Business.
3Effective Agent Prompts
"Add pagination to the GET /users endpoint. Use cursor-based pagination with a limit param. Update the controller, service, and add tests." "Migrate all class components in /src/components to functional components with hooks."
4Reviewing Agent Edits
Agent Mode shows each edit as a diff before applying. You can accept, reject, or modify individual changes. The agent keeps context of what it has already done and can roll back if a step fails.
5Agents & MCP Servers
VS Code supports Model Context Protocol (MCP) servers — external tools the agent can call. Examples include a GitHub MCP server (create PRs, list issues), a database MCP server (run queries), or a custom API. Configure them in .vscode/mcp.json.