Skip to main content

Lesson 3 - Agent modes: Plan and Autopilot

Explore agent modes: use Plan to agree on an approach, Autopilot to build filtering from an issue, and Interactive to review and verify the result.

We started by adding a small feature into our project. But larger changes require a more robust process. Fortunately, the GitHub Copilot app is built to work with an organization’s existing flow, ensuring we build the right things the right way. This is the first of several lessons where you will follow a typical agent-driven development process, starting by using an issue to generate a new feature, ensuring the code is valid, the feature behaves as expected, and eventually merged successfully into the project.

To start, in this lesson, you will:

  • started a new agent session from a GitHub issue.
  • define requirements in Plan mode.
  • implement the new feature using Autopilot mode.
  • review the code.
  • validate the feature manually in a browser canvas.

As you continue this feature, you’ll update the repository instructions, customize the existing quality-checks skill, add MCP validation, create a QA agent, and open the feature PR.

Scenario

Tailspin Toys’ catalog is growing, and visitors need to narrow the games by category and publisher. The backlog issue describes the feature, but details such as combining categories need agreement before coding. You’ll use Plan mode to resolve those decisions, then authorize a bounded implementation with Autopilot.

Background

Introducing AI coding agents to your development flow doesn’t change the fundamentals. If anything, they become even more important! Most developers follow a flow that resembles:

  1. Open a filed issue with details of what needs to be done.
  2. Create a plan of what needs to be built.
  3. Build and review the code.
  4. Run the tests to validate the code.
  5. Manually validate the new functionality.
  6. Create a pull request (PR).
  7. Once the code has been reviewed and the continuous integration process succeeds, merge the code.

By sticking to this standard approach you ensure the code generated by AI meets the requirements set forth, and goes through the same vetting process as code written by hand.

Session modes

The session mode controls how much autonomy the agent has. You can set it from the dropdown below the prompt field and change it at any time:

  • Interactive: You and the agent work together. The agent suggests changes and waits for your input before proceeding.
  • Plan: The agent creates a plan first. You review and approve the plan before the agent executes it.
  • Autopilot: The agent works fully autonomously—writing code, running tests, and iterating without waiting for input.

Start in Plan mode, review the plan, then use Autopilot to implement it.

Start a session from the issue

Confirm the star-rating PR is merged and your local main is up to date before starting.

  1. Select Issues and open Allow users to filter games by category and publisher.

  2. Select New session and choose a new working tree based on the updated main.

    The issue view in the GitHub Copilot app with an arrow pointing to the New session button

  3. Confirm the issue is attached to the session and select Plan from the mode selector.

Plan the filtering feature

Planning gives you a chance to review the approach before Copilot writes code. Since you started from the issue, Copilot already has the feature request as context. Send:

Build this feature.

Answer Copilot’s questions and compare the plan with the issue’s acceptance criteria. Check that it covers category and publisher filtering, accessible controls, data-access changes, and tests. Discuss any unclear behavior, such as how multiple categories combine or what happens when no games match.

The plan should include lint, unit tests, E2E tests, and type checking using the project’s existing tooling. Keep it focused on implementing and testing filtering; you’ll create the PR after completing the quality workflow. Ask for changes to the plan before approving it, and keep the issue URL and any agreed clarifications handy for later validation.

Explicitly approve Autopilot

Once you’re happy with the plan, select Approve and implement with autopilot, or the equivalent option in your version. Confirm the mode indicator shows Autopilot.

Copilot will begin work on the implementation! You’ll notice it will iterate through the process, walking through the established plan, generating code, and even running tests.

Review and verify the implementation

Once the code is generated, it needs to be reviewed before it’s merged, just like any other code. Let’s both review the code and run the site to ensure everything looks good.

  1. Open Changes and inspect the filtering implementation and tests.
  2. Compare the result with the issue and approved clarifications, including multiple categories and publisher combinations. Check that the changes follow the existing repository instructions.
  3. Inspect the output for lint, unit tests, E2E tests, and type checking. A skipped check is not a pass.
  4. Resolve failures and rerun affected checks before accepting the implementation. Playwright’s E2E configuration builds and serves a preview and can reuse a local server; make sure the tested server belongs to this worktree, not an earlier lesson.

Explore the new functionality

Ok, the code looks good - but does it run? Let’s start the app like we did before, opening the site in a browser canvas.

  1. Use the following prompt to request Copilot start the app and open the page in the browser canvas:

    Start the app and open it in the browser canvas.
  2. In a few moments the app will start and a browser window will open inside the Copilot app.

  3. Confirm rated game cards display their value out of five.

  4. When finished, ask Copilot to stop the dev server it started for this session by using the following prompt:

    Stop the dev server and close the browser canvas.

Summary and next steps

You’ve used different agent modes to build and review a feature. In this lesson, you:

  • started a new agent session from a GitHub issue.
  • defined requirements in Plan mode.
  • implemented the new feature using Autopilot mode.
  • reviewed the code.
  • validated the feature manually in a browser canvas.

Next, let’s dig a little deeper into how code is generated, ensuring it follows documented practices, by using custom instructions.