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

# Run a Code Audit

> Monitor a repository branch with Code Audit, read verified source findings, check fixes, and keep the branch audited as it changes.

Code Audit reads the source code of one repository branch or tag, flags suspect code, investigates it, and verifies each candidate before it reports a finding. Its findings stay separate from [Pentest apps and findings](https://docs.cloudthinker.io/guide/security/security-testing.md).

## Prerequisites

* A [connected Git provider](https://docs.cloudthinker.io/guide/connections/overview.md) with access to the repository: GitHub, GitLab, Bitbucket, Azure DevOps, or AWS CodeCommit.
* Permission to audit that source. You don't need an app, a URL, DNS proof, or a test login.
* The right workspace role. See [Roles](https://docs.cloudthinker.io/guide/security/roles.md).

| Task | Admin | Developer | Viewer |
| - | - | - | - |
| Monitor a branch, set its schedule, delete a repository | ✓ | | |
| Audit a tag once, **Audit now**, stop or resume a run, verify fixes | ✓ | ✓ | |
| Triage findings, **Open fix pull request** | ✓ | ✓ | |
| Read audits, findings, libraries, and reports | ✓ | ✓ | ✓ |

## How an audit works

![Flow from the release branch to a pinned commit, then the SAST Scan, Security Review and library collection, then Verification and the published results](https://mintcdn.com/cloudthinker/dXyJemY6k7sWZ2Ly/images/security/code-audit/01-how-an-audit-runs-light.svg?fit=max\&auto=format\&n=dXyJemY6k7sWZ2Ly\&q=85\&s=c12373abbb9483ab907adc8185d1cc65)

One audit pins a commit, scans and reviews it in parallel, verifies, then publishes

1. **Audit now**, the daily check, or a push starts an audit. It pins the branch's head commit, so a push during the run doesn't change what it reads.
2. The **SAST Scan** finds suspect code and exposed secrets with static analysis. The **Security Review** has agents investigate the source in depth. Code Audit also collects the branch's [libraries](https://docs.cloudthinker.io/guide/security/cyber-libraries.md).
3. Verification checks each candidate's proof while the review continues.
4. The audit publishes its findings and a PDF report. A failed audit keeps the last published findings.

## Start monitoring a repository

**1. Choose the repository and branch**

Open **Cyber**, click **Code Audit** in the sidebar, then click **Audit repository**. Before your first audit, click **Run a Code Audit** instead.

Under **1. Choose release source**, select the repository, then pick the branch you ship. Pick a tag to audit one release once.

![Monitor a repository page with acme/dvpwa selected and the master branch in the release target picker](https://mintcdn.com/cloudthinker/dXyJemY6k7sWZ2Ly/images/security/code-audit/02-choose-source.webp?fit=max\&auto=format\&n=dXyJemY6k7sWZ2Ly\&q=85\&s=4ffd2a460878cdd32e8fa4de5230d3c5)

The Source step with a repository selected and its release branch

You can also open **Review → Settings → Repositories**, then choose **Run Code Audit** from a repository's actions menu. The repository is preselected, with its default branch.

**2. Review and start**

Click **Review audit**. Check the repository, the release branch, and the daily check time, then click **Start monitoring**. For a tag, the button is **Audit tag**.

![Start release monitoring card with the repository, release branch, SAST Scan and Security Review cards, and the Start monitoring button](https://mintcdn.com/cloudthinker/dXyJemY6k7sWZ2Ly/images/security/code-audit/03-review-and-start.webp?fit=max\&auto=format\&n=dXyJemY6k7sWZ2Ly\&q=85\&s=6b4e02126eccd4efe25178c038ef1b25)

The Review step for a release branch

**Success state:** the repository's **Runs** tab opens on the new run. Each repository monitors one release branch.

Monitoring a branch also creates its daily audit at 09:00 UTC+7. Push audits turn on when the repository is set up in [Review](https://docs.cloudthinker.io/guide/code-review/setup.md). A Developer can audit a tag but can't start monitoring a branch.

## Follow a run

The **Runs** tab lists every run under **Run history**. Select a run to see its **Timeline**, **Libraries**, and **Report**.

![Run timeline showing Run started with its commit, SAST complete with 6 possible issues, and Security review running](https://mintcdn.com/cloudthinker/dXyJemY6k7sWZ2Ly/images/security/code-audit/04-run-timeline-live.webp?fit=max\&auto=format\&n=dXyJemY6k7sWZ2Ly\&q=85\&s=ca4ada9e96fbbe27394481deab71ae50)

A run in progress: SAST complete, Security Review running

* **Stop run** ends the run. A stopped run can't be resumed; start a new audit instead.
* An incomplete or failed run offers **Restart audit**, **Resume saved work**, or **Resume audit**. Each continues at the same commit and keeps finished work. **Resume audit** first asks for more attempts and a higher credit limit for that run; your workspace credits still apply.
* The conversation icon opens the agent conversation behind the run.

When a run ends, you get a **Code Audit complete**, **Code Audit progress saved**, or **Code Audit needs attention** notification. A failed run also sends you an email.

## Read the results

The repository's **Overview** tab shows open findings by severity, the top release findings, and recent runs.

![Release findings table for acme/dvpwa with confirmed High and Medium findings, their file paths, Git target master, and row actions](https://mintcdn.com/cloudthinker/dXyJemY6k7sWZ2Ly/images/security/code-audit/05-repository-overview.webp?fit=max\&auto=format\&n=dXyJemY6k7sWZ2Ly\&q=85\&s=2f06501299ea737f5035dccbba89ddfb)

Release findings on the repository Overview tab (sample data)

Every finding has one status:

| Status | Meaning |
| - | - |
| **Confirmed** | Verification found proof of the problem in the audited commit |
| **Needs verification** | Verification is pending, blocked, or inconclusive. Treat it as unresolved |
| **Fixed** | A later audit no longer detects it, or a fix check proved the repair |
| **Dismissed** | Someone dismissed it with a reason |

Candidates that verification refutes become false positives. Lists, boards, counts, and the PDF report leave them out.

Open a finding to read its **Description**, the agent's assessment, the **Source trace**, the **Source evidence**, and the **Verification** record. **Confidence** is the audit agent's confidence in the assessment, not a probability that the problem can be exploited.

![Finding page for a confirmed High SQL injection in sqli/dao/student.py with Description, Severity, Confidence, CVE, Found by Security Review and Latest run](https://mintcdn.com/cloudthinker/dXyJemY6k7sWZ2Ly/images/security/code-audit/06-finding-detail.webp?fit=max\&auto=format\&n=dXyJemY6k7sWZ2Ly\&q=85\&s=b235e7d2422253a1721c8a6423bbe67a)

A confirmed finding with its description and summary (sample data)

Proof in source code doesn't prove the problem is reachable in your running app. A [Pentest](https://docs.cloudthinker.io/guide/security/security-testing.md) tests that.

## Triage findings

The **Findings** tab has **Open**, **Fixed**, and **All** tabs. Filter by severity or by branch and tag under **Git target**. Switch between **Table** and **Kanban**.

![Statuses Needs verification, Confirmed, In progress, Awaiting retest, Fixed, Dismissed and False positive, with the audit and you moving findings between them](https://mintcdn.com/cloudthinker/dXyJemY6k7sWZ2Ly/images/security/code-audit/07-finding-statuses-light.svg?fit=max\&auto=format\&n=dXyJemY6k7sWZ2Ly\&q=85\&s=53c58ed3d5b6aad76a809a63bd79f43c)

Who moves a finding between statuses

1. Only verification confirms a finding. You can't drag one into **Confirmed**.
2. A refuted candidate becomes a false positive and leaves the lists.
3. Drag open work to **In progress**, then to **Awaiting retest** so the next audit checks it.
4. A later audit that no longer detects the problem marks it **Fixed**. You can also choose **Mark as fixed** on the finding.
5. **Dismiss** asks for a reason. **Reopen** brings a dismissed finding back.

![Kanban board with Needs verification, Confirmed, In progress and Awaiting retest columns of acme/dvpwa findings](https://mintcdn.com/cloudthinker/dXyJemY6k7sWZ2Ly/images/security/code-audit/08-findings-kanban.webp?fit=max\&auto=format\&n=dXyJemY6k7sWZ2Ly\&q=85\&s=9737be6c4d8549c3974f706f88e1107f)

The Kanban view of the Findings tab (sample data)

For the shared workflow across Cyber, see [Triage security findings](https://docs.cloudthinker.io/guide/security/cyber-findings.md).

## Fix and verify

Click **Open fix pull request** on a confirmed finding. CloudThinker opens a chat that works on the branch's current code, commits a fix, and opens a pull request for you to review. **Open conversation** returns to that chat.

A fix pull request doesn't change the finding. Merge it, then let the next audit check it, or verify the fix first:

**1. Select the findings**

On the **Overview** tab, select up to 20 release findings and click **Verify fixes**. For one finding, choose **Verify fix** from its menu on the **Findings** tab.

**2. Choose the target**

Under **Verify against**, pick the pull request, branch, or tag that carries the fix, then click **Verify fixes**.

**Success state:** each finding shows **Fix verified**, **Still detected**, or **Unable to verify**.

A fix check uses credits. It never closes a release finding; the next release audit does.

## Keep the branch audited

Open the repository's **Settings** tab. Under **Automatic audit**, click **Set up schedule** or **Manage schedule**.

![Settings tab with Release target master, Automatic audit Manage schedule, and Delete repository](https://mintcdn.com/cloudthinker/rcgPGeqIq3EQyknz/images/security/code-audit/09-repository-settings.webp?fit=max\&auto=format\&n=rcgPGeqIq3EQyknz\&q=85\&s=9da0017923dd6a52dec6b0a5fe17571c)

The repository Settings tab

* **Repeat** sets a daily, weekly, or monthly time in your browser's timezone. A saved schedule opens as an [Automation](https://docs.cloudthinker.io/guide/automation/automations.md).
* **Also audit after commits are pushed to this branch** runs one audit for each burst of pushes, once the branch goes quiet.
* An audit skips a commit that has already been audited.

**Audit now** in the repository header asks you to confirm, then audits the branch. The **Run audit** button on the **Code Audit** list lets you choose **Incremental** or **Full** per branch. Incremental audits what changed; Full rescans the whole branch and takes more time and credits.

Code Audit runs a full scan on its own for the first audit, after seven days, and when the scanner settings or the branch history change.

## Download the report

Open a finished run and select **Report**. Each run saves a PDF of its confirmed, needs-verification, and fixed findings. Choose a **Part** when a large report is split, then click **Download report**. If the PDF failed, click **Retry PDF**.

## Delete a repository

On the **Settings** tab, click **Delete repository**. Code Audit permanently deletes the repository's branches, audits, findings, evidence, library results, and audit conversations. Your source repository, your Review setup, and separate fix chats stay. Adding the repository again starts with no history.

You can't delete a repository while an audit runs.

## Troubleshooting

For every Cyber problem in one place, see [Cyber troubleshooting](https://docs.cloudthinker.io/guide/security/cyber-troubleshooting.md).

> [accordion] The repository is missing from the Source step
>
> Check the repository's access in Connections; the Source step links there. A repository set up for Review isn't added to Code Audit until you select it here.

> [accordion] Monitoring a branch needs schedule edit permission
>
> Monitoring a branch also creates its schedule, which needs the Admin role. Ask an Admin to start it, or choose a tag to audit it once.

> [accordion] The audit failed but old findings are still visible
>
> A failed audit never replaces the last published findings. Read the run's timeline for the cause, then use the run's restart or resume button, or click **Audit now**.

> [accordion] Audit may be stuck
>
> The run hasn't reported progress for a while. Open its conversation to see what the agent is doing, or stop the run and start a new audit.

> [accordion] A merged fix hasn't changed the finding
>
> A finding changes only when a later audit checks the fix. Click **Audit now**, or use **Verify fix** against the branch.

## Next steps

> [card] [Monitor library vulnerabilities](https://docs.cloudthinker.io/guide/security/cyber-libraries.md)
>
> Read dependency advisories and their impact on your code

> [card] [Run a security test](https://docs.cloudthinker.io/guide/security/security-testing.md)
>
> Test the running application and collect runtime proof

> [card] [Connections](https://docs.cloudthinker.io/guide/connections/overview.md)
>
> Manage the repository access Code Audit uses


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