Mindket

GitHub Copilot agent mode: build in VS Code, then hand work to the cloud

A black banner titled "Vibe coding" over the line "Build apps by describing them".

To use GitHub Copilot agent mode, sign in to Copilot in VS Code and open a project folder. Start a new chat in the Chat view with the Agent control set to Agent, then describe what you want built. Approve each action it asks about and keep or undo every edit. On GitHub, assigning an issue to Copilot returns a pull request instead.

In this lesson

  • Begin on the strictest approval setting and relax it only inside a project you know well.
  • Look over anything a shell step touched by hand, because the pending list does not show it.
  • Put the whole job and its limits into the issue before Copilot picks it up.
  • Read workflow file changes on an agent's branch before letting automated jobs run there.
  • Keep an eye on the usage meter on a free account, since one request can spend several.
All courses
On this page
  1. Set up Copilot in VS Code
  2. Build a small app from one prompt
  3. Keep, undo or restore what the agent changed
  4. Choose how much the agent does without asking
  5. Hand an issue to the Copilot cloud agent
  6. How two Microsoft engineers put Copilot's agent to work
  7. Next: Claude Code
  8. Check yourself
  9. Frequently asked questions
  10. Sources

Set up Copilot in VS Code

VS Code is Microsoft's code editor, and GitHub Copilot is the AI assistant that GitHub builds into it. "Agent mode" was the name of Copilot's agent when it arrived in VS Code in February 2025. Today's VS Code docs call it a session whose Agent control is set to Agent. Either way, it plans a task, edits files, runs commands and checks the result.

You need VS Code and a GitHub account. If the account has no Copilot plan, signing in enrolls an eligible account in Copilot Free, which comes with a monthly allowance of AI credits. Every agent request draws on those credits. The Copilot status dashboard, opened from the Status Bar along the bottom of the window, shows the share of the month you have used.

  1. Install VS Code. Download it from code.visualstudio.com and install it.
  2. Sign in to Copilot. Hover over the Copilot icon in the Status Bar, select Use AI Features, choose a sign-in method and follow the prompts. An account that already has a Copilot plan keeps it.
  3. Make a folder. Create an empty folder for the exercise, named agent-quickstart as in the VS Code guide.
  4. Open it. Select File > Open Folder and pick agent-quickstart. If VS Code asks whether you trust the folder, select Manage in the notification, then Trust.
  5. Start a chat. Open the Chat view and select + to start a new chat. An earlier chat stays in the sessions list.
  6. Set the session. Set Session Target to Copilot, Agent to Agent, Language model to Auto and Permissions to Manual permissions. Leave everything else at its default.

On Copilot Free, telemetry, the usage data VS Code sends back, is switched on. Turn it off with the telemetry.telemetryLevel setting in VS Code, or adjust it in your Copilot settings on GitHub.

Build a small app from one prompt

The VS Code quickstart builds a task list, and the first prompt below is the guide's own example. Local storage, which it mentions, is space inside the browser where a page can keep data after a reload. Paste the prompt into the chat and press Enter.

The agent creates index.html and saves its updates as it goes. Whenever it wants to do something your settings do not already allow, an approval prompt appears in the chat. Read what it is about to do before you accept. The Stop button in the chat input halts the run, and a new prompt steers it somewhere else.

The agent may ask to open index.html in the integrated browser, a browser built into VS Code. Select Allow in this Session and the app appears beside your code, ready to click. Then send the second prompt, also from the guide. It asks the agent to run the whole add, complete, delete and reload cycle itself and fix whatever breaks.

Create a task list web app in a single index.html file with embedded CSS and JavaScript. Let me add, complete, and delete tasks. Save the tasks in local storage so they persist after a page reload. Use no external libraries.

Open index.html in the integrated browser and validate the app.
Add a task, mark it complete, and delete it. Then add another task,
reload the page, and verify that the task persists. If any step fails,
fix the issue and repeat the complete flow.
  • Add a task and mark it complete. It should show as done.
  • Reload the page. The task and its completed state should both still be there.
  • Delete the task and reload again. It should stay gone.
  • Report what you saw. If a check fails, describe the result in the chat and ask the agent to fix it and retest. An agent's validation report helps, but your own pass is still the one that counts.

Keep, undo or restore what the agent changed

In a Copilot session, each edit waits in the working set, a list of changes pending review above the chat input. Open a file from that list to see the changes highlighted, then select Keep or Undo beside each one, or settle a whole file or every file at once. Undo reverts the edit without rewinding the conversation.

Pending edits are already saved to disk, so running the app uses the changed files before you decide. Keep does not commit anything to Git, the version control tool that records saved states of a project. You do not need Git to review edits at all.

The working set lists only edits made through the agent's own edit tools. A file that changed because a terminal command or a script ran will not appear there. When your folder uses Git, the Source Control view shows every changed and untracked file, so check it after any run that used the terminal.

To roll back a whole request, hover over it in the chat and select Restore Checkpoint. VS Code restores the affected files and the chat history from that point. It cannot reverse terminal commands, network requests, deployments or changes to outside services. While a request is still running, the Send dropdown offers Steer with Message and Stop and Send. Stopping keeps whatever already finished.

Choose how much the agent does without asking

The permissions dropdown in the chat input sets how a session handles approvals, and you can change it at any time. Manual permissions is the default, and it asks about every action that no approval setting already covers.

Autopilot sits in the mode picker rather than the permissions list. It is a mode that approves every tool, retries after errors and answers its own blocking questions until it decides the task is done. A sandbox is separate from all of these: it limits which files and network addresses a terminal command can reach, even after you approve the command.

For a bigger change, the built-in Plan agent researches the code, asks what you need and proposes a plan before any code changes. It uses read-only tools while it prepares, and you approve the plan before handing it to an agent that builds.

VS Code's approvals page is direct about the riskier settings. Allow all and Autopilot skip confirmation for file edits, terminal commands and outside tool calls, so it reserves them for a workspace you trust. The first time you pick either one, a warning dialog asks you to confirm.

Keep in mind that because Copilot agent mode may send multiple requests per prompt, it won't be as fast as regular edits mode and can quickly use up your free Copilot quota.

Isidor Nikolic · VS Code blog, February 24, 2025 (read November 5, 2026)
Copilot sessions, from VS Code's approvals page, read on November 5, 2026.
Permission levelWhat happens
Manual permissions (default)Your tool, URL and terminal approval settings apply, and anything not already approved asks you first
Assisted permissionsAn AI judge assesses each tool call, and calls it does not approve ask you first
Allow allEvery tool call runs without confirmation

Hand an issue to the Copilot cloud agent

The second agent works on GitHub's side rather than on your computer. A repository is a project's folder on GitHub. An issue is a note in it describing a bug or a task. A pull request is a proposed set of changes that someone reviews before they are merged into the main code. GitHub called this agent the coding agent when it opened in May 2025, and now calls it the Copilot cloud agent.

Assigning an issue to Copilot is in public preview. Copilot reads the issue title, its description, the comments already there and anything you add in the dialog. It does not see comments added to the issue afterward. New information goes in a comment on the pull request it raises, and @copilot in a pull request comment asks it for changes.

An agent that pushes code to your repository carries risk, so GitHub fences it in. Only people with write access to the repository can set it to work, and comments from anyone else never reach it. GitHub also strips hidden text, such as an HTML comment in an issue, before passing input to Copilot.

A branch is a separate line of changes inside a repository. The cloud agent gets a new branch whose name starts with copilot/ and can push only there. It cannot mark its draft pull request ready for review, approve it or merge it. A person reviews and merges, and the person who asked for the change cannot be the one who approves it.

Before it finishes, the agent checks its own work. By default it scans new code with CodeQL, GitHub's code analysis tool, and runs secret scanning to catch keys and tokens. Dependencies, the outside packages a project relies on, are checked against the GitHub Advisory Database. It then tries to fix what those checks found. Its commits name Copilot as author and you as co-author, with a link to the session log in each message.

GitHub Actions, the automated jobs a repository runs on each change, wait too. They start only after someone with write access reviews the code and clicks Approve and run workflows. Those jobs can reach the repository's secrets, so look hard at any change inside the .github/workflows/ folder first.

  1. Open the issue. On GitHub, go to the repository, click Issues and open the one you want done.
  2. Assign it. In the right side menu, click Assignees, then Copilot.
  3. Add guidance. In Optional prompt, write the context, limits and requirements Copilot needs. The dropdowns change the repository and the branch it starts from, and by default it uses the issue's repository and its default branch.
  4. Wait for the review request. Copilot works in the background, raises a pull request and asks you to review it when it is done.
From agent mode to the cloud agent
  1. Agent mode in preview

    The VS Code team introduces Copilot agent mode as a preview.

    Source: VS Code blog (read November 5, 2026)

  2. Coding agent in public preview

    GitHub opens the Copilot coding agent to Copilot Pro+ and Copilot Enterprise subscribers.

    Source: GitHub changelog (read November 5, 2026)

  3. Copilot in the cloud

    The new Copilot in the cloud experience reaches users on paid Copilot plans.

    Source: GitHub docs (read November 5, 2026)

How two Microsoft engineers put Copilot's agent to work

Dan Wahlin, who works on agentic AI at Microsoft by his X bio, posted his favorite use on X on April 16, 2025, when agent mode was two months old. He asks the agent to act as a code reviewer and remove or simplify code. His prompt names the files to go through and adds a guard: keep what the app does, and leave a change out when unsure. A cleanup he expected to take a day or more took about an hour.

The idea still fits today's agent. Once your task list passes its checks, ask for the same review of index.html. Then read every edit in the working set, because a "simplified" line can quietly drop a feature, and run the add, complete, delete and reload checks again.

Gerald Versluis is a Microsoft software engineer on .NET MAUI and GitHub Copilot. His hack, shared on X on July 23, 2025, is to put the build and test commands on the list the agent may run without asking, so it works longer on its own. In VS Code today, Always Allow on a terminal prompt writes the command into the chat.tools.terminal.autoApprove setting. Allow only commands that check, such as your tests, and keep anything that deletes or deploys behind a prompt. The VS Code video below covers tools, permissions and sandboxing.

I need to keep the existing functionality so if you're not sure about a change, then leave what's there now.

Dan Wahlin, works on agentic AI at Microsoft · X (read November 5, 2026)
Dan Wahlin (@DanWahlin) on X, 16 April 2025: Agent mode in VS Code blows my mind. My favorite thing to do is ask it to be a code reviewer and remove or simplify code.
Dan Wahlin on X, 16 April 2025
Gerald Versluis (@jfversluis) on X, 23 July 2025: Hacks for VS Code GitHub Copilot. Add dotnet build (and test) to the allow list for commands it can run without asking permission.
Gerald Versluis on X, 23 July 2025
Visual Studio Code on YouTube, May 2026: how an agent uses tools and tool sets, then how permissions and sandboxing limit what it may run.

Screenshots of X's own embeds of the posts, taken on 5 November 2026, with the time in UTC. X cuts Dan Wahlin's post short with Show more. Select one to open the post on X.

Next: Claude Code

Before you leave VS Code, finish the task list quickstart and then ask for one feature of your own, such as due dates. Keep half of the edits, undo the rest, and restore the checkpoint from before the request. You will have used every way back this lesson covers.

The first lesson named three kinds of tools, and this course has now shown the app builder and two editors. Terminal agents remain. Install Claude Code opens the Claude Code course, where an agent works from a terminal window rather than an editor. The describe, run and check loop stays the same there.

Check yourself

  1. A terminal command the agent ran changed a file. Where do you look for that change?

    Show answer

    D. The Source Control view The working set only lists edits from the agent's edit tools, so terminal changes show up in Source Control.

  2. What does Restore Checkpoint leave as it was?

    Show answer

    B. Anything a terminal command or a deployment already did It restores files and chat history but cannot reverse commands, network requests, deployments or outside services.

  3. Which permission level does a new Copilot session use by default?

    Show answer

    A. Manual permissions Manual permissions is the default, and anything your settings do not already allow waits for you.

  4. Copilot is already working on your issue. Where does a new requirement go?

    Show answer

    C. A comment on the pull request Copilot raises Copilot reads the issue once, at assignment, so later changes go on its pull request.

Frequently asked questions

How do I turn on agent mode in VS Code?

There is no separate switch to flip. Choose Agent from the agent picker in a new Copilot chat. If that option is missing, confirm you are signed in, and keep in mind that an organization's policies can restrict agents, models or tools.

Is GitHub Copilot agent mode free?

You can try it at no cost. Copilot Free includes a monthly allowance, and agent requests in the quickstart draw on it. When the allowance runs out, you wait for the reset or move to a paid plan.

What is the difference between agent mode and the Copilot cloud agent?

Location and timing. Agent mode runs in VS Code on your computer while you watch and approve. The cloud agent runs on GitHub in the background and returns a pull request for you to review later.

Which Copilot plans include the cloud agent?

GitHub's plans page lists Copilot in the cloud for Copilot Student, Pro, Pro+ and Max. Copilot Free is left out, though its users keep Copilot Chat on GitHub.com and GitHub Mobile. Organization and enterprise policies can still turn it off.

Sources

  1. VS Code docs: Set up GitHub Copilot in VS Code (read November 5, 2026)https://code.visualstudio.com/docs/setup/copilot
  2. VS Code docs: Quickstart, complete your first task with an agent (read November 5, 2026)https://code.visualstudio.com/docs/agents/quickstart
  3. VS Code docs: Review and revert agent changes (read November 5, 2026)https://code.visualstudio.com/docs/agents/run/review-code-edits
  4. VS Code docs: Manage approvals and permissions (read November 5, 2026)https://code.visualstudio.com/docs/agents/run/approvals
  5. VS Code docs: Agents concepts (read November 5, 2026)https://code.visualstudio.com/docs/agents/concepts/agents
  6. VS Code blog: Introducing GitHub Copilot agent mode (preview) (read November 5, 2026)https://code.visualstudio.com/blogs/2025/02/24/introducing-copilot-agent-mode
  7. GitHub docs: Using Copilot in the cloud on GitHub (read November 5, 2026)https://docs.github.com/en/copilot/how-tos/use-copilot-agents/cloud-agent/use-cloud-agent-on-github
  8. GitHub docs: Risks and mitigations for GitHub Copilot cloud agent (read November 5, 2026)https://docs.github.com/en/copilot/concepts/security-governance-and-network-settings/risks-and-mitigations
  9. GitHub docs: Plans for GitHub Copilot (read November 5, 2026)https://docs.github.com/en/copilot/get-started/plans
  10. GitHub docs: GitHub Copilot on GitHub.com and GitHub Mobile (read November 5, 2026)https://docs.github.com/en/copilot/concepts/copilot-surfaces/copilot-on-github
  11. GitHub changelog: GitHub Copilot coding agent in public preview (read November 5, 2026)https://github.blog/changelog/2025-05-19-github-copilot-coding-agent-in-public-preview/
  12. Dan Wahlin on X, April 16, 2025 (read November 5, 2026)https://x.com/DanWahlin/status/1912308119721664749
  13. Gerald Versluis on X, July 23, 2025 (read November 5, 2026)https://x.com/jfversluis/status/1948112628343337110
  14. Visual Studio Code on YouTube: Using Tools with Agents in VS Code (read November 5, 2026)https://www.youtube.com/watch?v=wZrQ0TAfpFg

Share this lesson

Hand repeat work to an agent

Agents on Mindket come with their instructions and tools in the open. Read how one works before you add it to a project.

Browse agents

This lesson as Markdown · Vibe coding: a free course for beginners · All courses