Skip to main content
Teams can change most settings in their own repository. To make a policy stick, enforce the keys with global overrides and stop pull requests from rewriting configuration on their own.

Before you start

  • The Configuration source page is available only for GitHub Cloud with CodeRabbit Cloud. Other Git providers, GitHub Enterprise Server and self-hosted CodeRabbit always use Auto.
  • To choose between enforcing and setting defaults, see Apply settings to every repository.

Know what a pull request can change

A trusted pull request, from a branch in the same repository, is reviewed with its own .coderabbit.yaml. It can change its own review settings, including risk limits and status check settings. A pull request can also change settings for one review through a command or its description. See Change settings for one pull request for the commands.

Enforce keys with global overrides

  1. Open Review > Review settings and select Organization defaults. For an SSO workspace, use Workspace settings.
  2. Set View mode to Global overrides.
  3. Write YAML with only the keys to enforce.
  4. Save. The overrides apply to later reviews.
Global overrides win over every layer and over per-pull-request overrides. The workspace’s overrides win over the organization’s. When an organization has Use workspace settings on, CodeRabbit ignores its organization global overrides. Set the overrides in the workspace instead. A list in the overrides adds to a repository’s list: entries with a matching key take the override’s values, and other repository entries stay. Setting inheritance: true in the overrides forces inheritance for every repository, whatever its own file says. You can’t change global overrides through the API.

Lock the status check settings

To make sure a repository or pull request can’t change what the CodeRabbit check reports, pin these keys in global overrides. Set each key to the value you want to enforce.
Global overrides use V2 keys. See Status check for what each key does.

Pin the configuration branch

By default, CodeRabbit reads a trusted pull request’s own file. To read the default branch instead:
  1. Open the repository’s Configuration source page. An organization admin makes the change.
  2. Select Default branch.
  3. Turn off Allow configuration changes from trusted PRs, which is on by default with this option.
  4. Select Save changes.
With the toggle off, a pull request that edits the file doesn’t change its own review. To pin the file to a dedicated branch, select Custom and name a branch in the same repository. A pull request that merges into that branch still changes the file for later reviews, so protect the branch so that only administrators can change it. Under Auto, fork pull requests use the configuration at their base commit. Under Default branch they use the latest commit on the default branch, and under Custom the named branch. See Choose the configuration branch.

Check the result

Post @coderabbitai configuration on a pull request that tries to change an enforced key. The key’s # Source: comment names Organization global overrides or Workspace global overrides. The Run configuration section of Review info shows the Source mode and branch. See Check which configuration a review used.

What’s next

Global overrides

Learn how overrides combine with every other layer.

Choose the configuration branch

Pick Auto, Default branch, or Custom for each repository.

Status check

Configure the check that gates merging.