1
0
mirror of synced 2025-12-19 09:57:42 -05:00
Files
docs/content/copilot/tutorials/roll-out-at-scale/enable-developers/integrate-ai-agents.md
2025-10-10 07:32:37 +00:00

17 KiB

title, shortTitle, intro, versions, topics, allowTitleToDifferFromFilename, redirect_from, contentType
title shortTitle intro versions topics allowTitleToDifferFromFilename redirect_from contentType
Integrating agentic AI into your enterprise's software development lifecycle Integrate AI agents See how agents can boost productivity across your enterprise.
feature
copilot
Copilot
true
/copilot/rolling-out-github-copilot-at-scale/enabling-developers/integrating-agentic-ai
/copilot/tutorials/rolling-out-github-copilot-at-scale/enabling-developers/integrating-agentic-ai
/copilot/tutorials/rolling-out-github-copilot-at-scale/enabling-developers/integrate-ai-agents
/copilot/tutorials/rolling-out-github-copilot-at-scale/enable-developers/integrate-ai-agents
tutorials

About AI agents on {% data variables.product.github %}

Developers in your enterprise may be used to using AI as a pair programming tool. In this model, developers work with AI assistants synchronously and receive code suggestions during the development phase of a project.

AI agents are more like peer programmers. Agents can:

  • Perform asynchronous tasks, such as running tests or fixing issues in your backlog, with less need for human intervention.
  • Contribute to workflows beyond the development phase, such as ideation or optimization after a release.

Collaborating with agents can give your employees more time to focus on other priorities, such as high-level planning, and bring the benefits of AI to non-developer roles by giving more power to natural language prompts.

{% data variables.product.prodname_copilot %}'s agentic AI features are integrated into {% data variables.product.github %}'s cohesive platform, providing a more streamlined user experience and simplified licensing and governance controls compared to adopting a range of third-party tools.

Example scenario

You're an engineering manager at Mona's, a boutique umbrella retailer. Your team has been tasked with adding an AI-powered widget to the company's online store. The widget will help customers to choose the right umbrella by making tailored recommendations based on factors like the user's location and local weather trends.

To hit a tight deadline, you're aiming to speed up each stage of the process, for both developers and non-developers in your team. You also want to make sure the team is not overwhelmed with maintenance tasks once the new feature is rolled out.

[!NOTE] {% data variables.product.github %} is continually expanding its AI-powered platform. Some of the features described in this article are in {% data variables.release-phases.public_preview %}, and may not be enabled for enterprises by default. You will find resources for each feature in the Get started with agentic AI section.

1. Plan with {% data variables.copilot.copilot_chat_short %}

  1. To start planning, a product manager works with {% data variables.copilot.copilot_chat_short %} at https://github.com/copilot.

    They ask {% data variables.product.prodname_copilot_short %} high-level questions to get a sense of the development work required for the new feature. To give {% data variables.product.prodname_copilot_short %} access to important context about the project, they upload mockup files and link to the repository where the codebase is stored.

  2. When the PM has worked with {% data variables.product.prodname_copilot_short %} to get an overview of the tasks required, they ask {% data variables.product.prodname_copilot_short %} to create issues for each part of the work.

    {% data variables.product.prodname_copilot_short %} drafts the issues in immersive view, where the PM can refine them and publish them to the repository.

    The PM marks some of the issues as nice-to-haves or maintenance. These may be good candidates for {% data variables.copilot.copilot_coding_agent %}.

    Screenshot of Copilot Chat in immersive mode. Copilot asks if the user would like to proceed with creating a set of prioritized issues.

  3. To help the developer get started quickly, the PM creates a space with {% data variables.copilot.copilot_spaces %} at https://github.com/copilot/spaces. The PM collects resources like diagrams and references to code files, submits a few test questions, then shares the space with their organization.

    Now, the developer can ask questions in the space, and {% data variables.product.prodname_copilot_short %} will already have all the context the PM added.

2. Prototype with {% data variables.product.prodname_spark %}

  1. To prototype the feature, the PM opens {% data variables.product.prodname_spark %} (https://github.com/spark) and prompts it to create the widget. They can write a prompt, paste in documentation from the last phase, or upload a screenshot. {% data variables.product.prodname_spark_short %} generates a working app with an LLM already integrated to power recommendations—no IDE or coding required.
  2. To refine the prototype, the PM can prompt {% data variables.product.prodname_spark_short %} again, use the visual editor, or edit the code directly. In the "Prompts" tab, they can adjust the text that powers recommendations without editing code. Each change instantly updates the live preview, so the PM can see how edits affect the app.
  3. To collaborate, the PM publishes the spark and updates the visibility so their organization can access it. They can also create a repository and invite collaborators. Code changes made in the repository sync back to {% data variables.product.prodname_spark_short %}, letting the PM and designers see updates to the widget in real time.

3. Create with {% data variables.product.prodname_github_models %} and agent mode

  1. The PM shares the {% data variables.product.prodname_copilot_short %} space and {% data variables.product.prodname_spark %} prototype and repository with the developer and asks the developer to start by finding the best AI model to provide the tailored umbrella recommendations, based on the cost and effectiveness of the models.

  2. The developer asks {% data variables.copilot.copilot_chat_short %} to recommend several AI models for the job and the pros and cons of each. To provide useful context, they ask {% data variables.product.prodname_copilot_short %} to consider the information in the AUTOTITLE {% data variables.product.prodname_docs %} article.

  3. To settle on a model from the shortlist, the developer uses the {% data variables.product.prodname_github_models %} playground to compare results from the same prompt across models. They can then also update the {% data variables.product.prodname_spark %} prototype to use the specific model they've selected to see how it impacts the whole widget experience in the prototype (all models supported in {% data variables.product.prodname_github_models %} are supported in {% data variables.product.prodname_spark_short %}). They save time by testing models on a single platform, rather than needing to set up an API key for each model separately.

    Screenshot of the GitHub Models playground, with windows for sending prompts to two models side by side.

  4. With the model decided, the developer opens the code in {% data variables.product.prodname_vscode_shortname %}.

  5. The developer starts writing code for the new widget. To speed up their work, they use {% data variables.copilot.copilot_chat_short %} in "Ask" and "Edit" mode for syntax questions and high-level suggestions.

    Tip

    The developer works with AI in the way that works best for them, but your organization has control over the experience. For example, you can:

    • Control the models that the developer can use for development work in order to meet compliance requirements and manage costs.
    • Exclude certain files from {% data variables.copilot.copilot_chat_short %}'s reach.
    • Save effective prompts that have been tested with {% data variables.product.prodname_github_models %}, so other users can benefit.
  6. When the developer has written some code, they switch to agent mode to ask {% data variables.product.prodname_copilot_short %} to refactor the code into several different functions for better readability.

    In agent mode, {% data variables.product.prodname_copilot_short %} works more autonomously and is able to update multiple files and, with the developer's authorization, run commands for actions like installing dependencies or running tests.

    Screenshot of the Copilot Chat pane in VS Code. Copilot asks the user for permission to run a linting command.

    [!TIP] You can create a more consistent experience by adding a custom instructions file to the repository. For example, the file could help ensure that agent mode uses established naming conventions and runs the correct commands to build, test, and lint code according to your organization's standards.

  7. The developer reviews the diff of the agent's work and chooses which code to keep.

4. Test with an MCP server

  1. When the code is finished, the developer wants to run tests on their local build of the site using Playwright, an automated in-browser testing service.

    • A repository administrator has added the Model Context Protocol (MCP) server for Playwright, which gives the {% data variables.product.prodname_copilot_short %} agent a predefined interface for integrating with Playwright.
    • The developer asks {% data variables.product.prodname_copilot_short %} to outline test scenarios in a .feature file, then tells {% data variables.product.prodname_copilot_short %} to run the tests in the browser.
    • In agent mode, {% data variables.product.prodname_copilot_short %} asks the developer to authorize its actions as it opens the browser and clicks different elements in the UI. As the developer watches the tests in the browser, {% data variables.product.prodname_copilot_short %} identifies a failing test and suggests a fix in the code.
  2. When they're satisfied with the tests, the developer asks agent mode to open a pull request for the work on {% data variables.product.github %}.

    Tip

    • With the {% data variables.product.github %} MCP server enabled, {% data variables.product.prodname_copilot_short %} can run the command to open a pull request directly from {% data variables.product.prodname_vscode_shortname %}, with the title and description already filled in.
    • Interactions with the {% data variables.product.github %} MCP server are secured by push protection, which blocks secrets from being included in AI-generated responses and prevents you from exposing secrets through any actions you perform using the server (public repositories only). See AUTOTITLE.

5. Review with {% data variables.copilot.copilot_code-review_short %}

  1. A repository owner has configured automatic code reviews by {% data variables.product.prodname_copilot_short %} on the repository. {% data variables.product.prodname_copilot_short %} provides an initial review on the pull request, identifying bugs and potential performance issues that the developer can fix before a human reviewer gets to the pull request.
  2. The developer's colleague reviews and approves the pull request. The work is ready to merge.

6. Optimize with {% data variables.copilot.copilot_coding_agent %}

  1. After the release, the product manager collects customer feedback and identifies an opportunity to improve the widget's suggestions by switching to a more reliable API for weather data. They create an issue to implement this change, and assign it to {% data variables.product.prodname_copilot_short %} directly on {% data variables.product.github %}.

  2. {% data variables.copilot.copilot_coding_agent %} works in the background and opens a pull request, which the product manager marks as ready for review.

    Screenshot of a pull request created by {% data variables.copilot.copilot_coding_agent %}.

  3. A developer reviews {% data variables.product.prodname_copilot_short %}'s pull request and leaves feedback, which {% data variables.product.prodname_copilot_short %} incorporates. Finally, the developer merges the pull request.

    [!TIP] {% data variables.copilot.copilot_coding_agent %} comes with default guardrails. For example, {% data variables.product.prodname_copilot_short %} cannot merge pull requests by itself. You can define additional protections for target branches using repository rulesets.

  4. Later, while working on a separate feature, the developer notices a small bug in the code for the AI widget. To avoid context switching, the developer instructs {% data variables.product.prodname_copilot_short %} to open a pull request directly from {% data variables.product.prodname_vscode_shortname %}.

    @github Create a PR for the widget function to correctly validate that the user's age is a positive integer.

  5. {% data variables.product.prodname_copilot_short %} works in the background and opens a pull request on {% data variables.product.github %}, ready for another developer to review.

7. Secure with {% data variables.copilot.copilot_autofix_short %}

  1. An administrator has enabled {% data variables.product.prodname_code_scanning %} on the repository, and a {% data variables.product.prodname_code_scanning %} alert suggests a potential vulnerability in the code.

  2. A security manager requests {% data variables.copilot.copilot_autofix_short %} to automatically suggest a fix for the vulnerability, which a developer reviews and approves.

    Screenshot of a code scanning alert on GitHub.com. A button labeled "Generate fix" is outlined in orange.

Get started with agentic AI

Sign up for {% data variables.product.prodname_copilot_short %} {% octicon "link-external" height:16 aria-label="link-external" %}

To get started with the features mentioned in this article, use the links in the following table.

To integrate agentic AI features effectively into your workstreams, you'll need to invest in effective training, governance, and cultural shifts. We recommend experimenting with agentic features with a cross-functional cohort to gather feedback before a larger rollout.

[!NOTE] Some of these features use premium requests. See AUTOTITLE.

{% rowheaders %}

Feature More information
Immersive view of {% data variables.copilot.copilot_chat_short %} AUTOTITLE
{% data variables.copilot.copilot_spaces %} ({% data variables.release-phases.public_preview %}) AUTOTITLE
{% data variables.product.prodname_spark %} ({% data variables.release-phases.public_preview %}) AUTOTITLE
{% data variables.copilot.copilot_chat_short %} agent mode Use agent mode in VS Code
Content exclusions AUTOTITLE
MCP servers ({% data variables.release-phases.public_preview %}) AUTOTITLE
{% data variables.product.prodname_github_models %} playground ({% data variables.release-phases.public_preview %}) AUTOTITLE
Custom instructions AUTOTITLE
{% data variables.copilot.copilot_code-review_short %} AUTOTITLE
{% data variables.copilot.copilot_coding_agent %} ({% data variables.release-phases.public_preview %}) AUTOTITLE
{% data variables.copilot.copilot_autofix_short %} AUTOTITLE

{% endrowheaders %}