Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/images/help/copilot/byok-add-foundry.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/help/copilot/byok-add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion content/copilot/concepts/agents/code-review.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ This article provides an overview of {% data variables.copilot.copilot_code-revi
{% data variables.copilot.copilot_code-review_short %} has several new tools that are in {% data variables.release-phases.public_preview %} and subject to change.

* **Full project context gathering** to provide more specific, accurate, and contextually aware code reviews.
* **Support for deterministic detections with {% data variables.product.prodname_codeql %}**, to deliver more high-signal, consistent findings for quality.
* **Support for static analysis tools like {% data variables.product.prodname_codeql %}, ESLint, and PMD** to deliver more high-signal, consistent findings for security and quality.
* **The ability to pass suggestions to {% data variables.copilot.copilot_coding_agent %}**, for automated creation of a new pull request against your branch with the suggested fixes applied.

You are not required to have {% data variables.product.prodname_code_scanning %} and {% data variables.product.prodname_actions %} enabled in your organization or enterprise to use the {% data variables.copilot.copilot_code-review-tools_short %}.
Expand Down Expand Up @@ -120,6 +120,15 @@ The triggers for automatic code review depend on the configuration settings:

For details of how to configure {% data variables.product.prodname_copilot_short %} to automatically review new pull requests, see [AUTOTITLE](/copilot/how-tos/agents/copilot-code-review/configuring-automatic-code-review-by-copilot).

## About static analysis tools

You can enable static analysis tools in {% data variables.copilot.copilot_code-review_short %} to enhance its ability to identify and fix issues. Available tools include:
* **{% data variables.product.prodname_codeql %}**: A code analysis engine that identifies security vulnerabilities. For more information, see [About {% data variables.product.prodname_codeql %}](/code-security/code-scanning/introduction-to-code-scanning/about-code-scanning-with-codeql#about-codeql).
* **ESLint**: A linter designed specifically for JavaScript. For more information, see [Core Concepts](https://eslint.org/docs/latest/use/core-concepts/) in the the ESLint documentation.
* **PMD**: A static code analyzer that focuses on Java and Apex, but also supports many other languages. For more information, see the [PMD documentation](https://docs.pmd-code.org/latest/).

If you have access to {% data variables.copilot.copilot_code-review-tools_short %}, {% data variables.product.prodname_codeql %} is enabled by default, while ESLint and PMD are disabled. Additionally, if you have access to rulesets, you can change your selected tools. See [AUTOTITLE](/copilot/how-tos/use-copilot-agents/request-a-code-review/manage-tools).

## Getting detailed code quality feedback for your whole repository

{% data variables.copilot.copilot_code-review %} reviews your code in pull requests and provides feedback. If you want to surface actionable feedback on the reliability and maintainability of your whole repository, enable {% data variables.product.prodname_code_quality %}. See [AUTOTITLE](/code-security/code-quality/concepts/about-code-quality).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ children:
- /manage-agents
- /manage-spark
- /view-usage-and-adoption
- /use-your-own-api-keys
redirect_from:
- /copilot/managing-copilot/managing-copilot-for-your-enterprise
- /copilot/how-tos/administer/enterprises
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: Using your LLM provider API keys with Copilot
shortTitle: Use your own API keys
intro: 'Learn how to integrate your preferred custom models with {% data variables.product.prodname_copilot %} by using your own LLM API keys, and make them available for organizations in your enterprise account.'
versions:
feature: copilot-byok
topics:
- Copilot
contentType: how-tos
allowTitleToDifferFromFilename: true
---

{% data reusables.copilot.byok-intro %}

## Why bring your own API keys?

As an enterprise owner, you may have specific requirements for governance, data security, and compliance. Setting up your own API keys allows you to address:

{% data reusables.copilot.byok-why %}

## Adding your key to an enterprise account

> [!IMPORTANT] We highly recommend adhering to the principle of least privilege by assigning only the minimum necessary scopes to your API keys.

After you've added your key and selected one or more models, you and members of your organizations will be able to use them with {% data variables.copilot.copilot_byok_supported_features %}. Your models will appear at the bottom of the model picker, under the enterprise name.

{% data reusables.enterprise-accounts.access-enterprise %}
{% data reusables.enterprise-accounts.ai-controls-tab %}
1. In the sidebar, click **{% octicon "copilot" aria-hidden="true" aria-label="copilot" %} {% data variables.product.prodname_copilot_short %}**.
1. Click **Configure allowed models**.
{% data reusables.copilot.byok-add %}

## Managing availability of custom models in your organizations

You can choose whether the models you have added are available to organizations in your enterprise account.

{% data reusables.enterprise-accounts.access-enterprise %}
{% data reusables.enterprise-accounts.ai-controls-tab %}
1. In the sidebar, click **{% octicon "copilot" aria-hidden="true" aria-label="copilot" %} {% data variables.product.prodname_copilot_short %}**.
1. Click **Configure allowed models**.
1. Click the **Custom models** tab.
1. Above the list of API keys, click the **Added models** tab.
1. Next to a model, click **Configure**. If any organizations already have access to the model, instead of "Configure", you will need to click **All organizations** or **X organizations**.
1. In the modal that opens, click the **Access** tab.
>[!NOTE] The model must be set to 'Enabled' before the "Access" tab will be available.
1. Choose how the model should be made available to organizations:
* To make the model available to all organizations in your enterprise account, select **Allow for all organizations**.
* To only make the model available for specific organizations, select **Choose per organization**, and check or uncheck the organizations listed below.
1. Click **Save**.

## Further reading

* [AUTOTITLE](/copilot/how-tos/administer-copilot/manage-for-organization/use-your-own-api-keys) in our documentation for organizations.
* [AUTOTITLE](/copilot/concepts/chat)
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ children:
- /add-copilot-coding-agent
- /prepare-for-custom-agents
- /review-activity
- /use-your-own-api-keys
contentType: how-tos
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: Using your LLM provider API keys with Copilot
shortTitle: Use your own API keys
intro: 'Learn how to integrate your preferred custom models with {% data variables.product.prodname_copilot %} by using your own LLM API keys, and make them available to your organization members.'
versions:
feature: copilot-byok
topics:
- Copilot
contentType: how-tos
allowTitleToDifferFromFilename: true
---

{% data reusables.copilot.byok-intro %}

## Why bring your own API keys?

As an organization owner, you may have specific requirements for governance, data security, and compliance. Setting up your own API keys allows you to address:

{% data reusables.copilot.byok-why %}

## Adding your key to an organization account

> [!IMPORTANT] We highly recommend adhering to the principle of least privilege by assigning only the minimum necessary scopes to your API keys.

After you've added your key and selected one or more models, you and your organization members will be able to use them with {% data variables.copilot.copilot_byok_supported_features %}. Your models will appear at the bottom of the model picker, under the organization name.

{% data reusables.profile.access_org %}
{% data reusables.profile.org_settings %}
1. In the sidebar, under "Code, planning, and automation", click **{% octicon "copilot" aria-hidden="true" aria-label="copilot" %} {% data variables.product.prodname_copilot_short %}**.
1. Under "Copilot", click **Models**.
{% data reusables.copilot.byok-add %}

## Further reading

* [AUTOTITLE](/copilot/how-tos/administer-copilot/manage-for-enterprise/use-your-own-api-keys) in our documentation for enterprise accounts.
* [AUTOTITLE](/copilot/concepts/chat)
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ redirect_from:
- /copilot/how-tos/ai-models/configure-access-to-ai-models
- /github-models/use-github-models/integrating-ai-models-into-your-development-workflow
contentType: how-tos
category:
category:
- Configure Copilot
---

Expand Down Expand Up @@ -47,3 +47,9 @@ You can enable access in two ways:
As an enterprise or organization owner, you can enable or disable access to AI models for everyone who has been assigned a {% data variables.copilot.copilot_enterprise_short %} or {% data variables.copilot.copilot_business_short %} seat through your enterprise or organization. See [AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/setting-policies-for-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization) and [AUTOTITLE](/copilot/managing-copilot/managing-copilot-for-your-enterprise/managing-policies-and-features-for-copilot-in-your-enterprise).

> [!NOTE] Models available in {% data variables.copilot.copilot_auto_model_selection %} will follow the policies set for an organization or enterprise. See [AUTOTITLE](/copilot/concepts/auto-model-selection).

{% ifversion copilot-byok %}

You can also integrate your preferred custom models from supported LLM providers by bringing your own API keys. Organization owners can make custom models available for members of their organization and enterprise owners can add custom models and choose which organizations can make use of them. See [AUTOTITLE](/copilot/how-tos/administer-copilot/manage-for-organization/use-your-own-api-keys) for organizations and [AUTOTITLE](/copilot/how-tos/administer-copilot/manage-for-enterprise/use-your-own-api-keys) for enterprise accounts.

{% endif %}
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
title: Code review
shortTitle: Request a code review
intro: 'Learn how to request a code review from {% data variables.product.prodname_copilot %}.'
intro: 'Learn how you can request and configure reviews from {% data variables.product.prodname_copilot_short %}.'
versions:
feature: copilot
topics:
- Copilot
children:
- /use-code-review
- /configure-automatic-review
- /manage-tools
redirect_from:
- /copilot/using-github-copilot/code-review
- /copilot/how-tos/agents/copilot-code-review
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: Managing static analysis tools in Copilot code review
shortTitle: Manage tools
intro: 'Improve your code security and linting configuration with static analysis tools in {% data variables.copilot.copilot_code-review_short %}.'
versions:
feature: copilot
permissions: Repository administrators and organization owners
product: 'Rulesets are available in public repositories with {% data variables.product.prodname_free_user %} and {% data variables.product.prodname_free_team %} for organizations, and in public and private repositories with {% data variables.product.prodname_pro %}, {% data variables.product.prodname_team %}, and {% data variables.product.prodname_ghe_cloud %}.'
topics:
- Copilot
contentType: how-tos
category:
- Author and optimize with Copilot
---

## Prerequisites

If you get access to {% data variables.product.prodname_copilot_short %} through an organization or enterprise, your organization or enterprise owner needs to enable preview features for {% data variables.copilot.copilot_code-review_short %}. See [AUTOTITLE](/copilot/how-tos/administer-copilot/manage-for-organization/manage-policies) and [AUTOTITLE](/copilot/how-tos/administer-copilot/manage-for-enterprise/manage-enterprise-policies).

## Managing static analysis tools for your repository

{% data reusables.repositories.navigate-to-repo %}
{% data reusables.repositories.sidebar-settings %}
{% data reusables.repositories.repo-rulesets-settings %}
{% data reusables.copilot.code-review.manage-static-analysis-tools %}

## Configuring static analysis tools for your organization

{% data reusables.organizations.navigate-to-org %}
{% data reusables.organizations.org_settings %}
{% data reusables.organizations.access-ruleset-settings %}
{% data reusables.copilot.code-review.manage-static-analysis-tools %}
2 changes: 2 additions & 0 deletions content/copilot/responsible-use/chat-in-github.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ Depending on the question you ask, {% data variables.copilot.copilot_chat %} can

When leveraging Bing, {% data variables.product.prodname_copilot_short %} will use the content of your prompt, as well as additional available context, to generate a Bing search query on your behalf that is sent to the Bing Search API. {% data variables.product.prodname_copilot_short %} will provide a link to the search results with its response. The search query sent to Bing is governed by [Microsoft's Privacy Statement](https://privacy.microsoft.com/en-us/privacystatement).

{% data reusables.rai.copilot.byok-transparency-note %}

## Next steps

For details of how to use {% data variables.copilot.copilot_chat_dotcom %}, see:
Expand Down
8 changes: 8 additions & 0 deletions content/copilot/responsible-use/chat-in-your-ide.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ When you use the `@github` chat participant, {% data variables.copilot.copilot_c

{% data reusables.rai.copilot.copilot-chat-ide-leveraging-web-search %}

{% data reusables.rai.copilot.byok-transparency-note %}

{% data reusables.rai.copilot.copilot-chat-ide-use-cases %}

### Answering coding questions
Expand Down Expand Up @@ -81,6 +83,8 @@ When you use the `@github` chat participant, {% data variables.copilot.copilot_c

{% data reusables.rai.copilot.copilot-chat-ide-leveraging-web-search %}

{% data reusables.rai.copilot.byok-transparency-note %}

{% data reusables.rai.copilot.copilot-chat-ide-use-cases %}

### Answering coding questions
Expand Down Expand Up @@ -115,6 +119,8 @@ This can be a useful tool for programmers, as it can provide guidance and suppor

{% data reusables.rai.copilot.copilot-chat-ide-output-formatting %}

{% data reusables.rai.copilot.byok-transparency-note %}

{% data reusables.rai.copilot.copilot-chat-ide-use-cases %}

### Answering coding questions
Expand Down Expand Up @@ -149,6 +155,8 @@ This can be a useful tool for programmers, as it can provide guidance and suppor

{% data reusables.rai.copilot.copilot-chat-ide-output-formatting %}

{% data reusables.rai.copilot.byok-transparency-note %}

## Use cases for {% data variables.copilot.copilot_chat %}

{% data variables.copilot.copilot_chat %} can provide coding assistance in a variety of scenarios.
Expand Down
5 changes: 5 additions & 0 deletions data/features/copilot-byok.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# BYOK for Copilot (not Copilot Models) #18486

versions:
fpt: '*'
ghec: '*'
17 changes: 17 additions & 0 deletions data/reusables/copilot/byok-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
1. Click the **Custom models** tab.
1. Above the list of API keys, click **Add API key**.
1. Under "Provider", select the LLM provider you want to use.
1. Under "Name", type a name for this key. This will be shown in the model picker.
1. Under "API key", type or paste your key.
1. Depending on which provider you are using, select or add models.
* If you're using OpenAI, Anthropic, or xAI, click {% octicon "sync" aria-label="Fetch new models" %} in the API key text field to fetch the models associated with your key. Next, under "Available models", select the models you want to use.

![Screenshot of the "Add API key" form. The "Fetch new models" button is highlighted with an orange outline.](/assets/images/help/copilot/byok-add.png)

* If you're using Microsoft Foundry, type your deployment URL in the field under "Deployment URL". Next, in the field under "Available models", type a Model ID and click {% octicon "check" aria-label="Add model" %} to add it.

If your models have different deployment URLs, they cannot be added to the same API key. Create a separate API key for each deployment URL.

![Screenshot of the "Add API key" form. The model text field and "Add model" button is highlighted with an orange outline.](/assets/images/help/copilot/byok-add-foundry.png)

1. After you select or add the models you want to make available, click **Save**.
15 changes: 15 additions & 0 deletions data/reusables/copilot/byok-intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
>[!NOTE]
>{% data reusables.copilot.byok-preview-note %}
>
>Some models require the Responses API which is not currently supported.

You can bring your own API keys to {% data variables.product.prodname_copilot %}, and enable teams to use your preferred large language model (LLM) providers with {% data variables.copilot.copilot_byok_supported_features %}.

API keys from the following providers are supported:

* Anthropic
* Microsoft Foundry
* OpenAI
* xAI

Fine-tuned models are also supported, but functionality and quality of results can vary depending on the fine-tuning setup. You should test your model and review its outputs carefully before using it in production.
1 change: 1 addition & 0 deletions data/reusables/copilot/byok-preview-note.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The ability to bring your own API keys to {% data variables.product.prodname_copilot %} is in {% data variables.release-phases.public_preview %} and subject to change.
4 changes: 4 additions & 0 deletions data/reusables/copilot/byok-why.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* **Governance and compliance:** Choose LLM providers that comply with your organization's policies and regulatory requirements.
* **Cost management:** Align with your existing payment methods, contracts, credits, or negotiated rates, and avoid usage overages.
* **Visibility and control:** Manage which models your team can access, and monitor usage through your provider's existing dashboards and billing.
* **Flexibility:** Support custom or specialized models that your organization already uses.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
1. Edit or create a ruleset for {% data variables.copilot.copilot_code-review_short %}:
* If you have **configured a ruleset for automatic reviews** from {% data variables.copilot.copilot_code-review_short %}, click the name of that ruleset.
* If you **do not have an existing ruleset** for {% data variables.copilot.copilot_code-review_short %}, select the **New ruleset** {% octicon "triangle-down" aria-hidden="true" aria-label="triangle" %} dropdown menu, then click **New branch ruleset** and give your ruleset a name.
1. In the "Rules" section, select **Manage static analysis tools in {% data variables.copilot.copilot_code-review_short %}**.
1. To update the tools that {% data variables.copilot.copilot_code-review_short %} will use, select the **Select tools** {% octicon "triangle-down" aria-hidden="true" aria-label="triangle-down" %} dropdown menu, then select or deselect the available tools.
1. To apply your selections, at the bottom of the page, click **Create** or **Save changes**.
Loading