Agent Mode and the Cloud Coding Agent

Two ways to delegate real coding work to Copilot: a synchronous agent in your editor and an asynchronous agent in the cloud, plus the review discipline that keeps both safe.


What you'll learn

  • Move a task through Ask, Plan, and Agent modes in the right order
  • Approve agent operations narrowly and reject scope drift
  • Decide when to delegate locally versus to the cloud coding agent
  • Review an agent result as pass, fail, or unverified before merging
On this page

A ticket asks for a --verbose flag in a command-line tool. You can make the edit yourself. You can also give Copilot the task and watch it inspect the argument parser, propose the change, run tests, and return a diff for your approval.

Agentic coding supports both a local agent that works beside you and a remote agent that returns later with a branch. Either can save time. Either can also touch more than the ticket allows. Keep evidence you can inspect after the run, such as the diff, test output, and any source behind a factual claim.

Agent mode works through a bounded loop

Local agent mode turns a chat into a supervised control loop. You state a goal and its boundaries. The agent inspects the relevant files, proposes work or asks to use a tool, and you approve, reject, or revise before it acts. Your evidence is the files it read, the resulting diff, and the test output, not the agent's own explanation.

VS Code maps that loop to three modes that match three phases of a task. Ask is for orientation: explaining code and finding your way around a repository without changing anything. Plan turns a requested outcome into a reviewable implementation outline. Agent carries out the implementation through a sequence of tool calls. A controlled workflow starts in Ask, moves to Plan, and enters Agent only after you have reviewed the proposed scope.

Agent mode can act: it reads files, edits files, and runs terminal commands. GitHub's guidance names example tools such as read_file, edit_file, and run_in_terminal, and MCP can extend that toolset with external systems (you will meet MCP later in this module). Tool names and how they appear on screen vary between builds, so judge the operation being requested, not its label. A request to read one source file carries far less risk than a request to delete files, run a migration, or publish.

That gap is why the modes matter. Starting in Agent while the request is still fuzzy invites the agent to guess at scope and start editing. Starting in Ask shows you the repository evidence first, and Plan pins down what should change before anything does. The two cheap steps are what make the expensive one reviewable.

Reach for Ask before Agent

When a request is even slightly unclear, open in Ask, not Agent. A minute of read-only orientation ("which files run the tests, which files does this touch?") turns a guess into a plan you can review. That costs far less than untangling edits an over-eager agent made to the wrong files.

Orient before you touch anything· github-copilot
Bad example

Find the test command and the files for this change.

Good example

Inspect this repository without editing files or running commands. Return: the command that runs the existing tests and the file that defines it, the source files related to the change I'm about to make, and any uncertainty you found. Use only evidence visible in the current workspace.

Why this works: A short map of the repo (test command, relevant files, and honest gaps) that you can check against the actual files before you let the agent edit anything.

Approvals keep the boundary visible

An approval authorizes one proposed operation. Before accepting it, read the operation, file path or working directory, command and arguments, and how the step contributes to the task. Check whether it could delete, overwrite, publish, or expose anything. Approve the smallest action you understand. Reject or revise a step that extends beyond the work in front of you.

You still need to inspect the result. Plans deserve the same treatment because they are review artifacts, not permission slips. A useful plan identifies the files, the behavior that must remain, the order of work, the verification commands, and any open questions. Send it back if it invents a file, adds an unrelated refactor, skips verification, or presents an assumption as fact. Once accepted, the plan defines the current boundary. Work outside it needs a new explanation.

The same caution applies to subagents and memory. A subagent can take a narrow read-only question such as "list the edge cases this parser doesn't test." Its answer is still a set of findings to check against the code. Memory can retain reusable context such as a test command, but repositories change. Confirm remembered details before relying on them, and store durable rules in repository instruction files where the team can inspect them.

Scope drift is the stop signal. If the agent reaches beyond the accepted plan, ask for a file-by-file justification before it continues. A fluent summary is easy to produce. It is weaker evidence than the code and the checks.

A plan is a review artifact, not a green light

Read the plan before you approve any implementation, and check each of its files against the real repository. If it names a file that doesn't exist, adds an unrequested refactor, or skips the verification step, send it back. The plan you accept becomes the scope you'll hold the agent to.

Turn a request into a reviewable plan· github-copilot
Bad example

Plan how to add a --verbose option to the CLI.

Good example

Plan a small change to add a --verbose option to the existing CLI. Inspect the current argument parser and tests first. Do not edit files or run commands. Preserve default behavior when --verbose is absent. Return: files that would change, proposed behavior, test cases including an invalid-argument case, verification commands, and any assumptions.

Why this works: A preflight outline you can accept or reject: named files, protected default behavior, and tests, before a single line changes.

Implement only the approved plan· github-copilot
Bad example

Implement the --verbose option and make sure it works.

Good example

Implement only the approved --verbose change. Before each operation, state what you are about to do, the file or command involved, and how it supports the plan. Do not modify unrelated files, delete files, or commit and push. Stop after a summary of files changed, behavior added, tests added, and anything not verified.

Why this works: A narrated implementation where every read, edit, and command is yours to approve, plus a closing summary you check against the diff.

When should you delegate to the cloud instead?

Local agent mode keeps you in the loop in real time. The cloud coding agent works differently: you delegate a task, it works in a GitHub Actions-powered environment, and it returns its changes on a copilot/* branch and pull request. A session has a hard ceiling of 59 minutes, so the work has to fit inside one. Picture a relay: issue contract, cloud execution, copilot/* branch, pull request, independent human review. The pull request is a proposal, never proof.

Choose between them by the shape of the work. Reach for local agent mode when the task depends on uncommitted files, local credentials, a desktop tool, or rapid back-and-forth decisions. Reach for the cloud agent when the task can be written down as a stable repository contract and validated with ordinary project commands, and you would rather review a finished branch than supervise each keystroke.

For the cloud agent, the issue is the contract, and a vague one like "fix the API" forces the agent to guess the target and the definition of done. A delegation-ready issue answers six questions: what single outcome is required, what repository context matters, what observable conditions define success, which commands validate the result, what must stay unchanged, and what evidence the pull request must report. The cloud environment is separate from your laptop and may not have your caches, config, secrets, or tool versions, so name the real setup and validation commands, name any required environment variables without their values, and accept that a check needing unavailable infrastructure must come back as unverified rather than passed.

Durable guidance that many tasks share belongs in AGENTS.md, a repository instruction file the coding agent supports (GitHub added that support on August 28, 2025). Task-specific requirements stay in the issue. One licensing note: the cloud agent is included with Copilot Business and Enterprise, while the hands-on GitHub Skills lab specifically calls for Copilot Pro+, so check what your own account and organization grant before you plan around it.

Write an issue the cloud agent can finish· github-copilot
Bad example

Write an issue for adding a GET /health endpoint and have the cloud agent finish it.

Good example

Goal: add a read-only GET /health endpoint to the existing API under src/server, following the current routing conventions. Acceptance criteria: it returns HTTP 200 with the JSON body {"status":"ok"}. A focused test covers it, and existing tests still pass. Validation: install with the repository's documented command, run the focused test, then the full suite. Constraints: do not change authentication, add dependencies, or touch deployment files. Completion report: list every changed file and report each command as pass, fail, or unverified.

Why this works: A copilot/* branch and pull request scoped to one outcome, with a completion report you can audit criterion by criterion.

Review the evidence the agent returns

Whether the changes arrive as a local diff or a cloud pull request, the review is the same job, and it hinges on one distinction: every acceptance criterion resolves to pass, fail, or unverified. Pass means direct evidence demonstrates it. Fail means direct evidence contradicts it. Unverified means the available evidence can't establish either: a focused endpoint test can pass while the full suite stays unverified because its database configuration was missing. Unverified is not a synonym for failed, but it is not a pass either, and no unverified check supports a claim that "all tests passed."

Work through the result deliberately. Read the completion report or summary first, then read every changed file, then compare that changed-file set against the scope the task allowed. Run the narrowest relevant validation yourself, in an environment you trust, rather than relying on the agent's reported result. Only after the diff, the evidence, and repository policy all line up do you merge.

A concrete case shows why this catches real bugs. A cloud agent adds a clean GET /health endpoint and its focused test passes, but buried in the changed files is an edit to auth.js that bypasses authentication for the route, even though the issue explicitly forbade authentication changes. The focused behavior passes. The full suite is unverified because its test database wasn't configured. The authentication change is a flat constraint violation. Two of those are fine. One is disqualifying. The correct call is to request changes and re-run validation against the corrected commit, not to merge because the happy-path test went green.

A completed run, an opened pull request, or a confident paragraph is an artifact for you to review, not a verdict you inherit. You give the agent the work. You keep the merge decision, and the evidence that earns it. The same loop moves into the terminal and into reusable rules in The CLI, Custom Instructions, and Prompt Files.

Unverified is not passed

If a check never reached its assertions (a missing secret, an unavailable database, a skipped setup), record it as unverified, not passed. A summary that says "all tests pass" while one command couldn't even run is the single most common way a broken change slips through review. Rerun it yourself or label the gap.

Try it yourself

Drive one bounded change through Ask, Plan, Agent

Use a disposable repo, or a tiny throwaway folder with one function and one test, and practice the full supervised loop on a change small enough to finish in ten minutes.

  1. 01

    Pick a trivial addition, such as a helper that filters a list or a --verbose flag, in a repository you can safely modify.

  2. 02

    In Ask mode, have Copilot name the test command and the files your change will touch. Open each file it names and confirm it exists.

    Hint: If it cites a file the repo doesn't have, stop and correct it before going further.

  3. 03

    Switch to Plan mode and request a plan that preserves existing behavior. Reject it if it renames things, adds dependencies, or touches files outside the change.

  4. 04

    In Agent mode, approve each read and edit one at a time, and reject any operation that exceeds the plan.

  5. 05

    Review the full diff and run the narrowest test yourself. Confirm every changed file appeared in the plan.

A finished change where you can point to the plan, the diff, and a test result as evidence, plus the one operation you rejected.

Key takeaways

  • Ask to orient, Plan for a reviewable outline, Agent for bounded implementation
  • An approval permits one action. It never certifies the result, so inspect the diff anyway.
  • Local agent mode runs synchronously in your editor. The cloud agent works remotely and returns a copilot/* branch and pull request.
  • For the cloud agent, the issue is the contract: one outcome, real validation commands, explicit exclusions.
  • Review every result as pass, fail, or unverified, and never treat unverified as passed.

Check your understanding

  1. 1. You need to add a small feature to a repository you know, and you want each step to stay reviewable. Which sequence fits best?

  2. 2. A task depends on uncommitted local files and needs rapid back-and-forth decisions. Where does it belong?

  3. 3. A cloud-agent pull request reports three things. The focused endpoint test passed. The full suite ran zero tests because its database wasn't configured. And an auth file changed even though the issue forbade auth changes. What's your call?

  4. 4. Mid-session, Copilot proposes installing a new dependency and editing package.json to filter an array you already have in memory. What should you do?

  5. 5. The agent's summary says "all checks passed," but one command couldn't reach its assertions because a required secret was missing. How should you record that check?

Frequently asked questions

Terms used in this lesson

agent mode
A Copilot mode that can plan, read and edit files, and run commands across multiple steps, pausing for your approval on each operation.
cloud coding agent
An autonomous Copilot agent that works a delegated task in a GitHub-hosted environment and returns its changes on a copilot/* branch and pull request.
approval
Your decision to permit one proposed agent operation before it runs. It authorizes the action but does not certify its result.
unverified
A review outcome for a check whose evidence cannot establish pass or fail, distinct from and not equivalent to "failed."
pull request
A proposed set of changes on a branch, presented for review before it is merged into another branch.

Further reading