> ## 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.

# Connections and scopes

> Control which saved connections, repositories, and channels CodeRabbit Agent for Discord can use.

CodeRabbit manages [connections](/connections) to external services at the organization level. CodeRabbit Agent for Discord does not manage its own connections — instead, Discord **scopes** control which of those organization-wide connections, along with which repositories and channels, the agent can use in a given context.

Discord must be installed and connected before administrators can manage scopes. Availability also depends on the corresponding subscription and workspace-management access.

## Configure Discord scopes

Open **Discord → Scopes** in the CodeRabbit web app to manage the Discord **Base Scope** and named Discord scopes.

The Base Scope controls default agent access for the connected Discord server. Named scopes can limit or refine that access for the Discord contexts offered by the current product and server configuration. The interface shows the targeting options available to your organization.

To configure Discord scopes:

1. Confirm that CodeRabbit Agent for Discord is installed and connected to the intended Discord server.
2. Open **Discord → Scopes**.
3. Create or edit the Base Scope and select the default repositories and connections.
4. Create a named scope for a Discord context that needs different access.
5. Select from the targeting options offered for the connected server.
6. Choose the repositories and connections that CodeRabbit may use in that scope.
7. Save the scope and test the agent in a matching Discord context.

Base Scope setup can remain pending during installation, but CodeRabbit Agent cannot run in Discord until the Discord Base Scope exists. When you create it, all available connections are selected initially; deselect any that should not be available by default before saving.

## Who can use and manage scopes

Workspace administrators with workspace-management access can create and edit scopes, including the Base Scope. Billing-only administrators cannot manage scopes.

Users who cannot manage scopes may still use CodeRabbit Agent in the scopes assigned to them. Their access is limited by the repositories, connections, and other context rules that the matching scope allows.

## Connection behavior

The Discord Base Scope controls the default connections available to the agent. A named scope can inherit the Base Scope's selection, prevent a connector from being used, or select a different saved connection when those choices are offered.

Disabling a connection in a Discord scope affects only that scope. It does not disconnect or delete the saved connection, and it does not change Review scopes or Slack scopes.

## Spend controls

CodeRabbit Agent usage is measured in **agent minutes**. Each scope can set two independent spend limits for its billing period:

| Limit                      | Governs                                   |
| -------------------------- | ----------------------------------------- |
| **User spend limit**       | User-started runs in this scope           |
| **Automation spend limit** | Automation and trigger runs in this scope |

| Scope       | Blank value behavior                               | Explicit unlimited behavior                                |
| ----------- | -------------------------------------------------- | ---------------------------------------------------------- |
| Base Scope  | Defaults to a baseline spend limit when left blank | Select **No spend limit** to remove the cap                |
| Named scope | Inherits the Base Scope limit when left blank      | Select **No spend limit** to remove the cap for this scope |

A named scope can override the user spend limit, the automation spend limit, or both independently.

Free trials use the included Agent Minutes grant instead of scope spend limits, so trial access pauses only when the included minutes are exhausted or the trial expires.

## What's next

<CardGroup cols={1}>
  <Card title="Scopes overview" href="/connections/scopes" icon="shield" horizontal>
    Understand Base Scope behavior, named-scope overrides, and connection resolution examples.
  </Card>

  <Card title="Connections" href="/connections" icon="plug" horizontal>
    Add, name, reconnect, and inspect the external services available to your organization.
  </Card>
</CardGroup>
