How Do AI Agents Work in Copilot?
GitHub Copilot agents don't just autocomplete — they plan, edit, and execute multi-step tasks. Here's exactly how they work under the hood, what models power them, and why that matters for your workflow.
You’ve been using AI autocomplete for years. It finishes your lines, suggests a function, nudges an import. But what happens when the AI stops helping and starts doing?
That’s the jump GitHub Copilot has made with its Agent Mode — and it’s one of the most confusing features to explain because the word “agent” means something different depending on who’s saying it. Let’s untangle it, question by question.
What Large Language Model Does GitHub Copilot Primarily Use?
GitHub doesn’t publish an official model spec, but the signal is clear. Copilot is powered by OpenAI’s models — historically Codex, which was a variant of GPT-3.5 trained specifically on code. More recently, GitHub has expanded to support multiple models you can switch between: OpenAI’s newer GPT-4 family variants, plus third-party options like Google’s Gemini and Anthropic’s Claude depending on the plan. The July 2026 rollout of Kimi K2.7 Code as a Copilot option is a notable addition to that mix.
In practice, this means Copilot isn’t running a single monolithic model — it’s a routing layer. Your prompt gets sent to the model you’ve selected (or the default), which then generates responses using the model it was trained on.
How Do AI Agents Work in Copilot?
Agent Mode is where Copilot stops being a chatbox and starts being a worker. In regular Chat mode, you ask a question and get text back. In Agent Mode, you give a task and the AI goes off to do it.
Here’s what that actually looks like under the hood:

-
Planning. When you give a task like “refactor the auth module to use JWT tokens,” the agent doesn’t start writing. It reads your project structure, identifies relevant files, and builds a step-by-step plan. It’s essentially thinking through the work before touching a single line of code.
-
Execution. The agent then starts acting. It opens files, makes edits across multiple files, runs terminal commands to check if things compile, and iterates based on the results. If a command fails, it reads the error and tries something different. This loop — plan, act, observe, repeat — is the core of agentic behavior.
-
Autonomy with guardrails. The agent doesn’t just blindly execute. It presents changes for your review, stops at ambiguous points, and respects your project’s structure. The key distinction from raw LLM chat is that it has tools — it can read files, write files, run commands, and observe outcomes.
You can think of it like giving a junior developer a ticket, the codebase, and permission to run tests, then checking their work when they’re done.
What Is an AI Agent in Microsoft Copilot?
Now here’s where terminology gets messy. Microsoft Copilot is a different product from GitHub Copilot, and it also has “agents.” Microsoft Copilot is the conversational AI built into Windows, Office, Edge, and Bing — it uses GPT-4 and additional data sources (including your Microsoft 365 data if you’re on an enterprise plan).

When Microsoft talks about “Copilot agents,” they mean specialized Copilot instances designed for specific tasks: a financial analyst agent that pulls from Excel, a research agent that searches across your files and the web, or a custom agent you build for a repeatable workflow. These agents are more about context and domain than about autonomous execution. They extend Copilot’s conversational interface into specialized roles rather than giving it the ability to independently perform multi-step coding tasks.
So “Copilot agent” means something different on GitHub (autonomous executor) versus Microsoft 365 (specialized conversational role). Same word, different jobs.
What Is GPT-5 in Copilot?
GPT-5 is OpenAI’s next-generation language model. As of mid-2026, it’s been integrated into various Copilot products, though the exact version and configuration Microsoft and GitHub use aren’t publicly specified. What’s clear is that GPT-5 represents a significant step up in reasoning ability, code understanding, and multi-step task planning — the exact capabilities that make Agent Mode viable.
The model you’re actually talking to inside Copilot depends on your plan and what’s been configured by your organization. But the trajectory is clear: better models mean more capable agents, which means Copilot can handle more of your work without you having to micromanage it.
The Bottom Line
GitHub Copilot’s Agent Mode works by giving an LLM a toolset — file reading, file writing, terminal access — and a loop: plan, act, observe, repeat. It’s not magic; it’s just a well-designed feedback cycle with a very smart engine at the center.
The distinction between GitHub Copilot agents (autonomous coders) and Microsoft Copilot agents (specialized conversationalists) matters because they solve different problems. One handles the “go fix this” task. The other handles the “I need help with this specific domain” request.

And the model powering it all? It’s always been OpenAI’s lineage, now expanding to include Kimi K2.7 and others — but the real story isn’t which model runs the show. It’s that the architecture of giving an LLM tools and a loop is what makes the difference between autocomplete and actual assistance.
Sources
- GitHub — Agents on GitHub
- Microsoft Learn — Use Agent Mode — Visual Studio
- GitHub Blog — Kimi K2.7 is Now Available in GitHub Copilot
Quiz
Test yourself before you try Agent Mode:
1. What’s the difference between Chat Mode and Agent Mode in Copilot?
2. What three steps make up the agent loop in Agent Mode?

3. Why does “Copilot agent” mean something different in GitHub Copilot versus Microsoft 365?
Click to reveal answers
-
Chat Mode is conversational — you ask, it answers with text. Agent Mode is autonomous — you give a task, and the AI plans, executes file edits, runs commands, and iterates until the task is done.
-
Plan, Act, Observe (then repeat). The agent reads the codebase and plans, executes changes and commands, observes the results (or errors), and adjusts.
-
In GitHub Copilot, an agent is an autonomous executor that can plan and perform multi-step coding tasks using file and terminal tools. In Microsoft 365 Copilot, an agent is a specialized conversational role (like a research or analysis assistant) that extends Copilot’s domain knowledge without autonomous execution.
Watch the full lesson