> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coderabbit.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Scopes overview

> Use scopes to control where CodeRabbit can access repositories, conversations, and external connections.

Scopes control the repositories, channels, conversations, and [connections](/connections) that CodeRabbit can use in a particular context.

Review, Slack, and Discord manage scopes separately because each product works in different contexts. Review scopes target repositories. Slack scopes and Discord scopes use the targeting options available for their respective workspace or server configuration.

## Base Scope and named scopes

Each product has a **Base Scope** that defines its default access. The Base Scope applies whenever no more-specific named scope matches the current repository, channel, conversation, or other supported context.

A named scope overrides or refines the Base Scope for particular contexts. An organization can save multiple connections for the same connector, but each scope selects the connection appropriate for its context.

Removing or disabling a connection in one scope does not disconnect or delete it. The saved connection remains available on the **Connections** page and in any other scopes that select it.

## How the Base Scope works

An administrator can leave Base Scope setup pending during installation, but CodeRabbit cannot use repositories or connections for that product until the Base Scope exists. Creating the Base Scope establishes the default repositories and connections that CodeRabbit may use.

During initial Base Scope setup, CodeRabbit selects all available connections by default so administrators can begin with the organization's existing behavior. Review the selection and deselect any connections that should not be available by default before saving.

After the Base Scope is created:

* Its selections define the product's default connection access.
* It applies whenever no named scope matches.
* Named scopes can inherit, exclude, or replace its connection selections.
* A newly added connection can optionally be added to the relevant Base Scope during connection setup.

## Choose connection behavior in a named scope

For each connector available in a named scope, choose the behavior that matches the context:

| Choice                        | Behavior                                                                                                                    |
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| **Inherit from Base Scope**   | Use whichever saved connection the Base Scope selects for this connector. Future changes to the Base Scope also apply here. |
| **Don’t use this connection** | Explicitly prevent this connector from being used in the named scope, even when the Base Scope allows it.                   |
| Specific connection           | Override the Base Scope and use the selected saved connection in this scope.                                                |

## Scope resolution examples

### Engineering reviews

* **Base Scope:** Notion and Linear
* **Backend scope:** Assigned to backend repositories
* **Linear:** Select the Engineering Linear connection
* **Notion:** Select **Inherit from Base Scope**

Backend pull requests use the Engineering Linear account and the Notion connection selected by the Base Scope.

### Restricted repository

* **Base Scope:** Notion and Linear
* **Security scope:** Assigned to the security repository
* **Notion:** Select **Don’t use this connection**
* **Linear:** Select **Inherit from Base Scope**

Pull requests in the security repository can use the Base Scope's Linear connection but cannot use Notion.

### Multiple provider accounts

* **Base Scope:** Company-wide Linear connection
* **Product scope:** Select the Product Linear connection
* **Other scopes:** Continue using **Inherit from Base Scope**

The Product scope uses the Product Linear account. Other scopes continue using the company-wide account without duplicating its configuration.

## Permissions and availability

Review scopes require an eligible Review plan and organization-administrator access. Slack scopes and Discord scopes depend on the corresponding agent installation, subscription, and workspace-management access. Billing-only administrators cannot manage scopes.

Some connection methods may be available only in Review or only in Slack and Discord. The connection form displays **Currently available in Review only** or **Currently available in Slack and Discord only** when a method has limited product availability.

## Troubleshooting

<AccordionGroup>
  <Accordion title="Scopes is not visible">
    Verify that the selected organization has an eligible plan, that you have the required organization or workspace role, and that you selected the intended organization. For Slack or Discord, also confirm that the corresponding agent is installed and connected.
  </Accordion>

  <Accordion title="A connection does not appear">
    Confirm that the connection is active, supports the product whose scope you are editing, and belongs to the same organization or connected workspace.
  </Accordion>

  <Accordion title="A named scope cannot disable an inherited connection">
    Select **Don’t use this connection** for that connector instead of **Inherit from Base Scope**.
  </Accordion>

  <Accordion title="CodeRabbit used the wrong account">
    Edit the named scope and select the intended saved connection instead of **Inherit from Base Scope**. Use distinct connection names to make accounts easier to identify.
  </Accordion>

  <Accordion title="A connection works in one product but not another">
    Edit or inspect the connection method and check its availability message. Some methods are available only in Review or only in Slack and Discord.
  </Accordion>

  <Accordion title="OAuth failed or expired">
    Open the saved connection from **Connections**, edit it, and reconnect the provider account. Then confirm that the connection is active and still selected in the intended scopes.
  </Accordion>

  <Accordion title="A connection is being deleted">
    Review its scope labels before deleting it. Scopes that reference a deleted connection will no longer be able to use it; select a replacement connection in those scopes when needed.
  </Accordion>
</AccordionGroup>

## What's next

<CardGroup cols={1}>
  <Card title="Review scopes" href="/connections/scopes-review" icon="git-pull-request" horizontal>
    Configure repository-specific connection access for CodeRabbit Review.
  </Card>

  <Card title="Slack connections and scopes" href="/slack-agent/connections-and-scopes" icon="slack" horizontal>
    Configure agent access for the contexts available in a connected Slack workspace.
  </Card>

  <Card title="Discord connections and scopes" href="/discord-agent/connections-and-scopes" icon="discord" horizontal>
    Configure agent access for the contexts available in a connected Discord server.
  </Card>
</CardGroup>
