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

# Deep Scan

> Analyze committed source code and infrastructure configuration for exploitable vulnerabilities and exposed secrets beyond the current pull request diff.

GitHub (This feature is available on GitHub and GitHub Enterprise.) GitLab (CodeRabbit Security is available on GitLab and self-hosted GitLab.) Azure (CodeRabbit Security is available on Azure DevOps Services and Azure DevOps Server.) Bitbucket (CodeRabbit Security is available on Bitbucket Cloud and Bitbucket Data Center.) | Open Beta (CodeRabbit Security is currently available in beta.)

**Deep Scan** is a separately metered scan that analyzes committed source code and infrastructure configuration for exploitable vulnerabilities and exposed secrets beyond the current pull request diff. Its results, including secret findings, appear under **Security > Findings**, where you can inspect evidence, triage findings, export results, and start supported fixes.

## Before you start

Deep Scan runs on every Git provider that CodeRabbit Security supports, and running a scan requires Security write access. See [Supported providers](https://docs.coderabbit.ai/security.md#supported-providers) and [Access and billing](https://docs.coderabbit.ai/security.md#access-and-billing).

## Run a Deep Scan

Start one Deep Scan for one repository at a time from the Security area in CodeRabbit.

**1. Open Security**

In the CodeRabbit app, go to [Security](https://app.coderabbit.ai/security/overview).

**2. Start a scan**

Click **Run Deep Scan**.

**3. Choose a repository**

Select the supported repository you want to scan. You can scan one repository at a time. Provider-archived repositories do not appear in the repository selection after CodeRabbit records their archive state.

**4. Choose a scan type**

If **Scan type** is shown, choose **Full scan** or **Delta scan**. **Delta scan** is selected when it's available and rechecks only changes since the last complete scan and points that need a check; see [Delta scans](https://docs.coderabbit.ai/security/delta-scans.md#run-a-delta-scan). Select **Full scan** to check the whole repository and reset the attack surface map.

**5. Review the estimate**

If scan credits apply, review the estimated credits for the repository. The estimate uses the effective scan branch and saved Deep Scan path exclusions.

**6. Review linked context**

On supported platforms, expand **Advanced configuration > Linked repositories** to see which related repositories the scan can read. Select **Manage** to change the saved source selection in Security repository settings, then return to the dialog and review the refreshed list. See [Linked repositories](#linked-repositories) for setup and plan requirements.

**7. Start the scan**

If **Configuration** includes **Runtime Verification**, review which findings from this scan get reproduction guides and which get a verification run. These choices apply to this scan only. Verification runs use Verify minutes, separately from Deep Scan credits. See [Runtime verification](https://docs.coderabbit.ai/security/runtime-verification.md#override-for-one-scan) for the preselected levels and billing.

Click **Start scan**.

CodeRabbit does not start another Deep Scan while one is active for the same repository. Billing or monthly limit issues are shown before the scan starts; see [Usage and limits](#usage-and-limits).

[Delta scans](https://docs.coderabbit.ai/security/delta-scans.md) recheck changed files and stale or unverified mapped points after a complete full scan. They don't require a particular plan. For GitHub repositories, delta automation starts a scan after a merge once a set number of commits or days since the last scan is reached, or once verified coverage falls below a target.

After starting the scan, open [**Security > Scan history**](https://app.coderabbit.ai/security/activity) to track its progress and view its current status.

## Track scan status

**Scan history** shows each scan's type, status, repository, duration, who triggered it and when, and scan ID. A scan can appear as **Pending**, **Running**, **Completed**, **Partial**, or **Failed**.

**Completed** describes the execution status. A completed Deep Scan can still show partial coverage and follow-up work when repository traversal or coverage analysis reaches a file cap.

Select a **Completed** or **Partial** scan to open its findings and scan details. The details include the result summary, runtime, repository, trigger information, and full scan ID, which you can copy for troubleshooting. When viewing an older scan, select **View latest findings** to return to the repository's latest results.

**Partial** means the scan completed, but its results cover only the analyzed scope. The findings page explains why coverage was limited.

## Understand Deep Scan

### What it finds

Deep Scan looks for practical vulnerabilities across supported source and infrastructure files, including:

* **Authentication and access control** — Authorization bypass, IDOR, broken authentication, and CSRF
* **Unsafe input and data handling** — Injection, XSS, SSRF, open redirects, insecure deserialization, and path traversal
* **Sensitive data and configuration** — Sensitive data exposure, information disclosure, CORS issues, weak cryptography, denial of service, and security misconfiguration
* **AI and LLM applications** — Prompt injection, improper output handling, excessive agency, and other LLM security risks
* **Infrastructure as code** — Misconfigurations in Terraform, OpenTofu, Kubernetes, Helm, Dockerfile, Containerfile, Bicep, CloudFormation, ARM templates, and Compose files

Infrastructure checks run automatically without additional setup. Repositories that contain only supported infrastructure files participate in the same analysis and verification workflow.

### How it works

Deep Scan combines rule-based signals with AI reasoning across files, services, and infrastructure configuration:

* **Map** — Inventories the repository, groups related code into subsystems, and maps security-relevant entry points, trust boundaries, controls, sinks, and configuration.
* **Investigate** — Follows repository relationships from high-risk points to callers and supporting files, traces untrusted input to security-sensitive operations, and validates suspected infrastructure misconfigurations.
* **Verify** — Reopens the cited code and configuration, checks the supporting evidence, and rejects duplicate, mitigated, speculative, test-only, dead-code, unreachable, or otherwise unsupported candidates.

Repository relationships provide advisory leads. Deep Scan reopens and confirms the cited source before reporting a finding. If relationship evidence is unavailable or unusable, the scan continues with source-driven analysis.

Rule-based results are candidate signals rather than final findings. They must be confirmed against repository evidence before they are reported. This repository-wide reasoning can identify authorization bypass, IDOR, and other business-logic flaws that rule matching alone may miss.

### Coverage and evidence

Coverage follows the repository's scan settings. Configured path exclusions are skipped, and a completed scan can report partial coverage when analysis limits prevent every eligible area from being investigated. If analysis cannot reach a supported conclusion, Deep Scan records the remaining work instead of treating incomplete analysis as evidence that the repository is secure.

Each reported finding cites repository evidence and can include:

* Category, severity, and CWE
* Repository, file path, line range, and subsystem
* Description and recommendation
* Reachability, exploitability, and a reachability call stack when available
* Inline code context or a permalink to the scanned commit
* Finding status and Fix with AI status

CodeRabbit Security does not prove that a repository has no vulnerabilities. Results reflect only the repository content and scope that CodeRabbit analyzed.

### Reachability and exploitability

Reachability describes whether a path exists from untrusted input to risky code. Exploitability describes the effort or access an attacker needs after reaching that code. These signals can adjust a finding's severity:

Deep Scan establishes External reachability only from a complete caller chain that starts at a named public API or framework entry point, ends at the sink, and is confirmed in source. Incomplete, ambiguous, historical, heuristic, or integrity-degraded relationship evidence remains a planning lead and cannot establish reachability.

| Signal | Severity effect |
| - | - |
| External reachability | No change |
| Internal reachability | Usually reduced by one level; capped at low when repository topology identifies the service as internal-only with high confidence |
| Unreachable | Capped at low |
| Unknown reachability | No change |
| Trivial or Moderate exploitability | No change |
| Difficult exploitability | Reduced by one level |
| Theoretical exploitability | Capped at low |
| Unknown exploitability | No change |

Deep Scan normally reports new findings only when verification establishes External or Internal reachability. Older findings can also show Unreachable or Unknown reachability; Unknown means CodeRabbit could not determine a path, not that the issue is exploitable.

## Configure Deep Scan

From **Security > Repositories**, select a repository and open **Settings > Scan configuration** to configure its scan behavior.

For guidance on choosing between context, Custom Path Instructions, finding Learnings, linked repositories, and exclusions, see [Steer Deep Scans](https://docs.coderabbit.ai/security/steer-scans.md).

### Branch and exclusions

For GitHub repositories, choose the branch CodeRabbit should scan. **Provider default** follows the repository default branch. If a custom branch is deleted, select another branch or return to the provider default before running the next scan.

Use **Deep Scan > Path Exclude Filters** to skip files and directories during Deep Scan analysis.

| Path input | Rule |
| - | - |
| Excluded paths | One repository-relative path or glob per line, with up to 100 entries per repository |
| Length | Up to 512 characters per path |
| Rejected values | Absolute paths, parent traversal such as `..`, and control characters |
| Normalization | Backslashes become `/`, a leading `./` is removed, and duplicate entries are ignored |

### Repository context

Repository context is optional architecture and business-domain background that helps Deep Scan interpret the repository. Enter up to 4,000 characters directly in **Deep Scan > Context**, including relevant facts from external documents or dashboards. The saved context applies to subsequent Deep Scans for that repository. See [Repository context](https://docs.coderabbit.ai/security/steer-scans.md#repository-context) for what to include and an example.

Deep Scan can use tools marked read-only from configured [MCP Servers](https://docs.coderabbit.ai/connections/mcp-servers.md) for additional evidence. Your [MCP settings](https://docs.coderabbit.ai/reference/configuration.md#param-knowledge-base-mcp) control which servers and tools Deep Scan can use. Use provider permissions to restrict what the connected account can change. Tool metadata alone does not enforce those permissions.

Leaving the field empty removes the saved context. Context helps CodeRabbit interpret the codebase, but it cannot override scan instructions; security-relevant claims are still checked against repository evidence.

### Linked repositories

Deep Scan can read linked repositories to investigate and verify findings in the repository you scan. For example, a scan of an API service can use a linked authentication library to check how a request is authorized. Linked repositories provide read-only context. Findings and coverage remain attached to the primary repository; run a separate scan to assess a linked repository itself.

#### Platform and plan support

| Platform | Linked context in Deep Scan |
| - | - |
| GitHub Cloud | Supported within the same organization and CodeRabbit GitHub App installation |
| GitHub Enterprise Server | Supported within the same organization, instance, and CodeRabbit GitHub App installation |
| GitLab Cloud | Supported for active projects in the same connected organization on GitLab.com |
| Self-hosted GitLab, Azure DevOps, and Bitbucket | Not available in the scan trigger flow |

You need Deep Scan access and a plan that supports [Multi-Repo Analysis](https://docs.coderabbit.ai/knowledge-base/multi-repo-analysis.md). Essentials supports manual links; Team, Advanced, and Enterprise also support automatic linking. A scan can read up to 20 linked repositories, subject to your [plan's linked repository limit](https://docs.coderabbit.ai/management/plans.md#linked-repositories). Eligible public open-source repositories can use manual public links under their OSS allowance; automatic linking is unavailable with OSS access. Enabling Deep Scan usage billing alone does not grant linked context to the Free plan.

Viewing and selecting linked source requires Security write access and Repository settings read access. Changing the shared links or linking mode also requires Repository settings write access. You can manage the saved selection before enabling scan usage billing, but running a scan still requires an available free allowance or enabled usage billing.

#### Configure links and source access

**1. Open Security repository settings**

Under **Security > Repositories**, select the primary repository and open **Settings > Linked repositories**. From the scan dialog, **Advanced configuration > Linked repositories > Manage** opens these settings in a new tab.

**2. Choose a linking mode**

Select **Linking settings** to open the repository's shared **Knowledge Base** settings. Choose **Manual** to maintain the links yourself, or enable [automatic repository linking](https://docs.coderabbit.ai/knowledge-base/multi-repo-analysis.md#automatic-repository-linking) when your plan supports it. Automatic discovery runs progressively after merges, so an empty list can take time to populate.

**3. Add manual links**

On GitHub, add manual links in the Knowledge Base settings or in `.coderabbit.yaml`. Optionally add instructions explaining the relationship, such as "Contains the authentication middleware used by this API." These links and their instructions also apply to PR reviews. On GitLab Cloud in Manual mode, the source-access list includes active projects from the connected organization, so you can select a project without first adding a shared link.

**4. Choose scan source access**

Return to **Security > Repositories > Settings > Linked repositories**. Use the **Source access** checkboxes to choose which eligible repositories Deep Scans may read. Changes save automatically; wait for **Saved.** before continuing. The selection persists for later scans of this primary repository.

**5. Review the source selection**

Return to the scan dialog and expand **Advanced configuration > Linked repositories**. This is a read-only summary of the saved selection, including the linking mode, repository names, and readable count. Confirm the list before selecting **Run Deep Scan**.

Source selection depends on the linking mode:

* **Manual:** Only selected repositories are readable. Clear all selections to run without linked source.
* **Automatic:** Until you customize the source list, all eligible linked repositories are readable up to your plan limit, including new discoveries. Deselecting a repository saves a specific list. Selecting all eligible repositories again restores automatic inclusion of future discoveries. To read no linked repositories, switch to Manual and clear the selection.

> [!WARNING]
>
> Automatic linking normally excludes private discoveries for a public primary repository. **Allow private repositories** changes the shared linking policy and can expose private code in public PR review comments. It requires Repository settings write access and is unavailable under OSS access.

Links from `.coderabbit.yaml`, inherited settings, and automatic discovery can appear as candidates. They follow [configuration precedence](https://docs.coderabbit.ai/configuration/resolution.md); a configured link must still satisfy scan access and plan requirements.

#### Scan scope and evidence

CodeRabbit checks access again when a scan starts. It pins linked source to a commit on each linked repository's default branch for that scan. PR review branch references do not select the linked revision for Deep Scan.

When a finding cites linked source, its detail drawer shows **Context evidence** with the repository, file, commit, and a source link. Selecting a repository does not guarantee a citation. The cited commit also does not establish which version is deployed.

If linked source cannot be prepared during analysis, the scan can continue with the available context. Missing linked source is a gap in evidence, not proof that the primary repository is safe.

#### When a link is unavailable

* **No linked repositories available**: Check the shared link configuration and plan limits. Automatic discovery can take time.
* **Repository settings are disabled**: The repository's review settings use **Organization defaults**, so the linked repositories saved in them don't apply. Turn off [**Use organization settings**](https://docs.coderabbit.ai/configuration/web-app.md#choose-which-web-settings-a-repository-uses) on the repository's **General** page and apply the change. The repository's saved settings then apply instead of the organization defaults, so check them in **Review changes** before you submit.
* **Could not verify linked repositories**: Open **Manage** and reload the settings. On GitHub, use **Check GitHub access** to refresh provider access.
* A saved selection is no longer eligible: It is skipped. Restore provider access or use **Remove unavailable** in Security repository settings.
* Source access did not save: Use **Retry** and wait for **Saved.** before starting the scan. Adding a shared link alone does not select it for scanning in Manual mode.

### Custom Path Instructions

Use **Deep Scan > Custom Path Instructions** to create, edit, and delete saved Custom Path Instructions for specific files or directories without excluding them from analysis. Each entry pairs a repository-relative path or glob, such as `src/auth/**`, with an instruction that applies only when Deep Scan analyzes matching files.

You can save up to 100 path instructions per repository. Each instruction can contain up to 4,000 characters, and its path follows the same validation rules as an excluded path.

> [!NOTE]
>
> Viewing Custom Path Instructions requires Security read access. Creating and editing require Security write access, and deleting requires Security delete access.

### Recurring schedules

For GitHub repositories, you can set one recurring weekly Deep Scan schedule per repository. Choose one or more days, a time in 24-hour format, and an IANA timezone.

Scheduled Deep Scans require an available free allowance or enabled usage billing. Because a scheduled run cannot ask you to approve an overage, it does not continue when its estimate exceeds the remaining monthly cap. See [Usage and limits](#usage-and-limits).

For GitHub repositories, [delta automation](https://docs.coderabbit.ai/security/delta-scans.md#set-up-delta-scans) starts delta scans after merges, once its commit, day, or coverage trigger is reached. It uses the repository's one scan schedule, so enabling it replaces an existing full-scan schedule.

## Triage and remediate findings

### Filter, share, and export

* **Attack surface** — the default Security page after onboarding, showing mapped surface and verification coverage from PR reviews and Deep Scans.
* **Findings** — Deep Scan vulnerability and secret findings.
* **Repositories** — findings, coverage, and scan configuration for each repository.
* **PR security reviews** — security issues raised during pull request reviews; the same report is also available under Analytics.
* **Scan history** — a record of scan runs.

Each repository has **Attack surface**, **Findings**, **Scan history**, **Learnings**, and **Settings** tabs. Manual context and path instructions remain under **Settings**; **Learnings** lists saved accepted-risk guidance.

The **Findings** page lets you filter Deep Scan findings by repository, severity, category, status, subsystem, and search text. Open a finding to inspect its evidence, recommendation, reachability, exploitability, code context, and available actions.

For Deep Scan vulnerabilities, the **Runtime verification** tab provides a reproduction guide you can follow in your own staging or test environment. With a prepared [environment](https://docs.coderabbit.ai/code/environments.md), you can also run the guide in CodeRabbit under **Runtime analysis** and inspect the evidence. The **Verification** column and the **Runtime verification** filters on the **Findings** page show each finding's result. See [Runtime verification](https://docs.coderabbit.ai/security/runtime-verification.md).

From **Share**, choose **For humans** to copy a direct link or **For agents** to copy self-contained Markdown with the finding details and recommendation.

| Results | Export formats | Export scope |
| - | - | - |
| Deep Scan | CSV, JSON, SARIF, and PDF | CSV, JSON, and SARIF include all findings in the selected repository scope; PDF reflects the current filters |

### Dismiss finding and Learnings

Open **Dismiss finding** from a finding's table-row actions or detail-drawer actions. It provides three options for Deep Scan findings:

* **Ignore this finding** — Marks the current finding as ignored without saving guidance.
* **Create a learning** — Saves suppression guidance for future scans with an **Auto**, **Current file**, or **Entire repository** scope. Auto infers the scope and defaults to the current file when unclear.
* **Create a path instruction** — Saves guidance for a repository-relative path or glob.

Creating a learning or path instruction does not dismiss the current finding. In later scans, CodeRabbit applies a learning only when the finding's behavior and scope match. File-scoped Learnings apply only to the exact repository-relative file, repository-scoped Learnings apply across the repository, and path instructions apply to files that match their configured path or glob.

The repository's **Learnings** tab lists up to 100 of its newest Security Learnings with their guidance, file scope, and last-updated time. Repository-wide guidance displays **All files**. You can edit or delete saved entries; these Security Learnings are separate from the [Learnings used in pull request reviews](https://docs.coderabbit.ai/knowledge-base/learnings.md). For examples and help choosing between feedback types, see [Learn from a finding](https://docs.coderabbit.ai/security/steer-scans.md#learn-from-a-finding).

For a vulnerability whose severity needs correction, use **Change severity** and provide a reason. This saves a Learning for future severity calibration without suppressing the finding. Severity Learnings are file-scoped by default; repository-scoped guidance applies across files only when the reason explicitly supports that scope. See [Calibrate severity](https://docs.coderabbit.ai/security/steer-scans.md#calibrate-severity).

> [!NOTE]
>
> Viewing Security Learnings requires Security read access. Editing requires Security write access, and deleting requires Security delete access.

### Resolve finding

**Resolve finding** is separate from **Dismiss finding** and applies to eligible Deep Scan vulnerabilities. Enter non-blank supporting context of up to 10,000 characters, such as a pull request URL or an explanation of the fix.

After a successful resolution, CodeRabbit marks the finding as resolved, records when and how it was resolved, and removes it from the active findings view. A finding that is already resolved cannot be resolved again.

> [!NOTE]
>
> Resolving findings requires Security write access.

### Fix with AI

**Fix with AI** creates a pull request or merge request for supported Deep Scan findings; CodeRabbit does not merge it automatically.

A new fix cannot start while another fix for the same finding is pending or running. You can retry a failed fix and open the generated pull request or merge request when it is ready.

Each fix runs as a Coding Agent (Turns a user request, a review finding, a coding plan or a failing CI check into a task that CodeRabbit's agent implements in the cloud, then delivers as a commit or a stacked pull request for you to approve.) task. Open the task to follow its activity, steer the work, and review the proposed patch before delivery. See [Work with a coding task](https://docs.coderabbit.ai/code/work-with-a-task.md).

## Usage and limits

### Plan coverage

Advanced and Enterprise include continuous pull request security review. Deep Scan uses separate usage-based billing.

### Deep Scan estimates and billing

Deep Scan is usage-based and is not included with Advanced or Enterprise. Some organizations can have a separate free allowance. After that allowance is used, or when no allowance is available, someone with Subscription write access must enable Deep Scan usage billing.

Before a scan starts, CodeRabbit estimates the required credits from the scannable files on the effective branch after applying saved Deep Scan path exclusions. If the estimate exceeds the organization's remaining monthly cap, a manually started scan can be canceled or confirmed as overage. Users with Subscription write access can also update the cap. Scheduled scans cannot request overage confirmation and do not continue above the cap; estimates from pending and running scans count toward the remaining cap.

When usage billing applies, the final charge is based on actual scan usage and is recorded after the scan finishes with a **Completed** or **Partial** status. Credit estimates are not final invoices.

## What's next

> [card] [Steer Deep Scans](https://docs.coderabbit.ai/security/steer-scans.md)
>
> Choose repository context, Custom Path Instructions, Security Learnings, linked repositories, and path exclusions to guide Deep Scans.

> [card] [Runtime verification](https://docs.coderabbit.ai/security/runtime-verification.md)
>
> Get reproduction guides for Deep Scan findings and optionally run them in an isolated test environment.

> [card] [Delta scans](https://docs.coderabbit.ai/security/delta-scans.md)
>
> Refresh changed files and stale or unverified mapped points between full Deep Scans.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.