GitHub Copilot code review helps development teams identify potential problems in pull requests before changes are merged. Teams can configure how Copilot reviews code, select the review effort level, control the use of custom instructions, and manage access at different levels.

For a small repository, changing these options through GitHub's web interface is usually straightforward. However, organizations with many repositories may need a more consistent approach. Administrators might want to apply the same review configuration across repositories, check which settings are inherited, or update settings as part of an internal administration process.

GitHub now provides REST and GraphQL API support for managing several Copilot code review settings. This allows administrators to inspect and update configurations programmatically rather than making every change manually.

In this article, we will focus on the GitHub REST API and explore how to read and update Copilot code review settings at the enterprise, organization, and repository levels.

Understanding the Copilot Code Review Configuration Hierarchy

Copilot code review settings can be managed at different levels. Understanding this hierarchy is important because a setting configured at a higher level can affect what administrators can change below it.

The main configuration levels are:

Level

Main responsibility

Enterprise

Controls whether organizations can use Copilot code review

Organization

Controls organization-level availability, default review effort, and runner configuration

Repository

Controls review effort and selected review features for an individual repository

For example, an enterprise administrator can enable Copilot code review for all organizations or disable it across the enterprise. Depending on the enterprise policy, organization administrators may also be allowed to manage the feature for their own organization.

Repository administrators can customize review behavior, but repository settings do not independently enable Copilot code review when an enterprise or organization policy has disabled it.

This distinction is important when building automation. Updating a repository's review effort does not automatically make Copilot code review available.

Preparing Authentication for API Requests

Before calling the API, create an authentication token with the required permissions.

The required permissions depend on the configuration level and endpoint.

Configuration

Required access

Enterprise policy

Enterprise owner or appropriate enterprise AI controls permission

Organization policy

Organization owner

Organization settings

Organization owner

Repository settings

Repository administrator

For repository settings, a fine-grained personal access token or GitHub App token can be used with the required Administration repository permission. Reading settings requires read access, while updating them requires write access.

Enterprise and organization settings endpoints have different authentication restrictions. Several of these endpoints do not support GitHub App tokens or fine-grained personal access tokens. Classic personal access tokens and OAuth applications require the specific scopes documented for each endpoint.

For the examples in this article, assume that the token is stored in an environment variable named GITHUB_TOKEN.

Bash
export GITHUB_TOKEN="YOUR_GITHUB_TOKEN"

Avoid placing a real token directly inside scripts, workflow files, or source code. Use environment variables or a secure secret-management system.

The examples use the GitHub REST API version 2026-03-10. Use an API version supported by your GitHub environment and update it when required.

Reading Copilot Code Review Settings

A good administration process should inspect the existing configuration before making changes. This helps avoid overwriting settings that are already working as expected.

GitHub provides separate endpoints for enterprise policy, organization settings, and repository settings.

Checking Enterprise Policy

The enterprise policy endpoint returns the configured policy for Copilot code review.

Bash
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer $GITHUB_TOKEN" \
  -H "X-GitHub-Api-Version: 2026-03-10" \
  https://api.github.com/enterprises/ENTERPRISE/copilot/policies/code-review

Replace ENTERPRISE with the enterprise slug.

A successful response can look like this:

JSON
{
  "policy_state": "enabled_for_all_organizations"
}

The policy can have one of these values:

  • enabled_for_all_organizations

  • disabled_for_all_organizations

  • configured_by_organization_admins

The last option delegates the decision to organization administrators where supported.

This endpoint reports the configured enterprise policy. It does not provide a complete view of every user's effective access or automatic review rulesets.

Checking Organization Settings

An organization can have a default review effort that applies to repositories that do not configure their own value.

Use the following endpoint:

Bash
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer $GITHUB_TOKEN" \
  -H "X-GitHub-Api-Version: 2026-03-10" \
  https://api.github.com/orgs/ORG/copilot/code-review/settings

A simplified response looks like this:

JSON
{
  "default_review_effort": {
    "configured": null,
    "effective": "balanced",
    "github_default": "balanced",
    "editable": true,
    "managed_by": "organization"
  },
  "available_review_efforts": [
    "lite",
    "balanced"
  ]
}

The response contains more information than just the selected review effort.

The configured value tells you whether the organization has explicitly selected a setting. The effective value tells you which setting currently applies. The github_default field represents the built-in default, while editable and managed_by indicate who controls the setting.

For example, configured being null does not mean that reviews have no effort level. It means the organization has not explicitly configured one and is using an inherited or default value.

Checking Repository Settings

Repository administrators can retrieve settings for an individual repository.

Bash
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer $GITHUB_TOKEN" \
  -H "X-GitHub-Api-Version: 2026-03-10" \
  https://api.github.com/repos/OWNER/REPO/copilot/code-review/settings

A response can contain:

JSON
{
  "review_effort": {
    "configured": null,
    "effective": "balanced"
  },
  "available_review_efforts": [
    "lite",
    "balanced"
  ],
  "severity_filter": "no_filter",
  "custom_instructions_enabled": true,
  "mcp_enabled": true,
  "cross_repo_context_enabled": true
}

This response helps administrators understand how Copilot is configured for the repository.

For example, custom_instructions_enabled indicates whether reviews can use repository custom instructions. The mcp_enabled setting controls whether reviews can use MCP servers, while cross_repo_context_enabled controls public repository search for review context when that setting is available.

The configured and effective review effort values are particularly important. A repository can inherit its review effort from the organization or enterprise instead of maintaining its own value.

Updating the Organization's Default Review Effort

Once the existing configuration is understood, an organization administrator can update the default review effort.

GitHub provides a PATCH endpoint for this purpose.

Bash
curl -L \
  -X PATCH \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer $GITHUB_TOKEN" \
  -H "X-GitHub-Api-Version: 2026-03-10" \
  https://api.github.com/orgs/ORG/copilot/code-review/settings \
  -d '{
    "default_review_effort": "balanced"
  }'

The available values depend on the organization's available_review_efforts response. Common review effort levels include Lite, Balanced, and Max, but an organization should not assume that every level is available.

The organization-level setting affects repositories that do not select their own review effort.

If an administrator wants to remove the organization's explicit setting and return to the inherited value, the API supports the inherit value.

JSON
{
  "default_review_effort": "inherit"
}

This is useful when an organization should follow the enterprise-level or GitHub default rather than maintain a separate configuration.

Updating Repository-Level Settings

Repository administrators can configure review behavior independently of the organization default.

For example, a security-sensitive repository may need a higher review effort, while a small documentation repository may use a lighter configuration.

The following request updates the review effort and enables repository custom instructions.

Bash
curl -L \
  -X PATCH \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer $GITHUB_TOKEN" \
  -H "X-GitHub-Api-Version: 2026-03-10" \
  https://api.github.com/repos/OWNER/REPO/copilot/code-review/settings \
  -d '{
    "review_effort": "balanced",
    "custom_instructions_enabled": true,
    "mcp_enabled": true
  }'

The request changes three settings:

  1. review_effort selects the review effort for the repository.

  2. custom_instructions_enabled allows reviews to use repository custom instructions.

  3. mcp_enabled allows reviews to use MCP servers.

The API also supports severity_filter and cross_repo_context_enabled when those settings are available for the repository.

The severity_filter can use the following values:

Value

Meaning

no_filter

Do not filter comments by severity

low

Exclude low-severity comments

low_and_medium

Exclude low- and medium-severity comments

These options allow teams to control which feedback Copilot reports. However, filtering comments should be a deliberate decision. Excluding lower-severity feedback may reduce review noise, but it can also hide smaller problems that matter to the project.

Another useful option is inherit. Setting review_effort to inherit removes the repository's explicit review effort so that it follows the organization, enterprise, or GitHub default again.

The repository update endpoint changes only the settings included in the request. Omitted settings remain unchanged.

Managing Organization-Level Review Policies

Review effort and feature availability are separate configuration concerns.

An organization administrator can retrieve the current policy using:

Bash
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer $GITHUB_TOKEN" \
  -H "X-GitHub-Api-Version: 2026-03-10" \
  https://api.github.com/orgs/ORG/copilot/policies/code-review

A simplified response looks like this:

JSON
{
  "configured_state": "enabled",
  "effective_state": "enabled",
  "editable": true,
  "managed_by": "organization"
}

If the enterprise allows the organization to manage its own policy, an organization owner can enable or disable Copilot code review.

Bash
curl -L \
  -X PUT \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer $GITHUB_TOKEN" \
  -H "X-GitHub-Api-Version: 2026-03-10" \
  https://api.github.com/orgs/ORG/copilot/policies/code-review \
  -d '{
    "state": "enabled"
  }'

The state can be enabled or disabled.

This endpoint returns HTTP 204 when the policy update succeeds. If the enterprise manages the policy, the request can fail with a 409 response and the POLICY_MANAGED_BY_ENTERPRISE error code.

That response does not necessarily indicate a problem with the token or request format. It can mean that the organization is not allowed to change the setting because the enterprise controls it.

Configuring the Organization's Review Runner

Organizations can also configure which runner Copilot code review uses.

GitHub provides an organization-level runner endpoint. Administrators can choose a standard GitHub-hosted runner or a labeled runner that matches an available runner label or runner group.

For example, the following request configures a labeled runner:

Bash
curl -L \
  -X PUT \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer $GITHUB_TOKEN" \
  -H "X-GitHub-Api-Version: 2026-03-10" \
  https://api.github.com/orgs/ORG/copilot/code-review/runner \
  -d '{
    "runner_type": "labeled",
    "runner_labels": [
      "copilot-review"
    ],
    "runner_group_name": "copilot-runners",
    "allow_repository_customization": false
  }'

A labeled runner requires at least one runner label or a runner group name. A standard runner does not accept runner labels or a runner group.

The allow_repository_customization property controls whether repositories can use their own runner configuration.

Before changing this setting, confirm that the runner group and labels exist and that the organization has the required runner infrastructure. A configuration that references an unavailable runner can prevent the expected execution environment from being selected.

Important Settings That Are Not Managed Through These Endpoints

Not every Copilot code review option is available through the REST API.

For example, the repository API does not provide controls for maximum review effort, Copilot approval permissions, approval merge requirements, or billing configuration.

Automatic review requests are also configured through branch rulesets rather than the repository code review settings endpoint.

This distinction matters when designing an administration tool. Do not assume that one API endpoint controls every option visible in the GitHub settings interface.

If a setting is not available through the documented API, use the supported GitHub configuration process rather than attempting to modify an unrelated setting or inventing an API parameter.

Common Mistakes and Best Practices

One common mistake is assuming that updating repository settings enables Copilot code review. Repository settings only control review behavior. Enterprise and organization policies determine whether the feature is available.

Another mistake is ignoring inherited values. A null configured value can still have an effective value. Always inspect both fields before deciding whether a repository needs an update.

Administrators should also check available_review_efforts before selecting an effort level. Sending a value that is not available can result in a validation error.

For production automation, use the smallest required permissions, keep tokens outside source code, and log the previous and updated configuration. Test changes against a noncritical repository before applying them across an organization.

When managing several repositories, process updates carefully and record failures separately. A successful update to one repository does not guarantee that every repository has the same available settings or permissions.

Finally, verify the result by calling the corresponding GET endpoint after an update. This helps confirm that the intended value was stored and that the effective configuration matches the expected behavior.

Summary

The GitHub REST API makes it possible to manage important Copilot code review settings at enterprise, organization, and repository levels. Administrators can inspect policies, configure default review effort, update repository review behavior, and manage organization runner settings.

The most important consideration is understanding the configuration hierarchy. Enterprise and organization policies control availability, while repository settings customize how reviews are performed. Inherited values and available review effort levels must also be considered before making changes.

By combining the API with secure authentication, configuration checks, and post-update verification, teams can manage Copilot code review more consistently across their repositories without relying entirely on manual settings changes.