# Configure Code Review

This page covers everything you can configure in Solidafy Code Review: the organization-wide settings in the portal, and the per-repository `.review-agents/` files you commit to a repository. It's for whoever owns review policy for a team or a repository.

## Two layers of configuration

| Layer | Where it lives | Applies to |
| --- | --- | --- |
| Organization settings | Portal: **Settings** > **Code Review** | Every repository the app reviews for your organization |
| Repository files | `.review-agents/` at the root of a repository, on its default branch | That one repository |

Everything you configure adds to the built-in review rules. Your guidance is appended to what each reviewer already knows; it can add context and point out conventions, but it can't switch off a built-in rule or relax the severity scale.

## Organization settings

Open **Settings** > **Code Review** in the portal. The page has a tab for each part: **GitHub connection**, **Review settings**, **Guidance**, **Ticket lookup**, **Registry credentials**, **MCP tokens**, **Dashboard** and **Per repository**. Every tab except **GitHub connection** and **Per repository** opens once the GitHub connection is ready (see [Setup](/docs/code-review/setup)). **Guidance** is only shown to people who can manage your organization's settings, and **MCP tokens** only in an organization that has the [code index MCP server](/docs/code-review/mcp-server).

The settings below are in the **Organization defaults** card on the **Review settings** tab: change what you need and click **Save changes**. The confirmation that they were saved has an undo, in case you saved the wrong thing.

If your organization has Apps, environment admins can edit the same settings in the [Review Agents app](/docs/code-review/review-agents-app), under **Apps** > **Review Agents** > **Settings**. There they're grouped into **Reviews**, **Budget** and **Privacy and access**, and applied with **Review and apply**. It's one set of settings, so a change in either place shows in both. Ticket lookup, registry credentials, MCP tokens, the dashboard environment, the per-repository config builder and guidance generation are only on **Settings** > **Code Review**.

### Guidance and reviewers

| Group | Setting | What it does |
| --- | --- | --- |
| All reviews | **Your guidance (all reviews)** | Context about your organization that every reviewer gets in every repository: what you build, the conventions you hold to, what matters most in a review. |
| Security, Correctness, Reliability, Architecture, Testing, Best practices | **Enabled** | Whether this reviewer runs. On by default. |
| (same groups) | **Your guidance (appended)** | Extra context for this one reviewer only. |

Each guidance box takes up to 8,192 characters of plain text or Markdown. For guidance about a single repository, use the [repository files](#repository-files) instead.

### Data storage

**Store finding content** (on by default). When on, finding details and reviewer error output, which quote your source code, are stored for richer reports and history. Turn it off to keep that content out of Solidafy's storage.

### Repository scope

**Ignored paths**. Glob patterns, one per line, of paths to leave out of review in every repository, for example generated code or vendored directories. Blank lines and lines starting with `#` are ignored.

```text
# Generated clients
src/generated/**
**/*.pb.go
vendor/**
```

A file matching any pattern is never analysed and no finding can be raised on it. Prefer describing a path in guidance ("everything under `vendor/` is third-party, style findings there are noise") unless you really want it invisible. Up to 200 patterns are used; a pattern longer than 200 characters or with more than 16 `*` wildcards is ignored.

**Suggest review guidance** (on by default). When on, Solidafy reads a repository that has no guidance of its own and opens a pull request suggesting some, and once a repository has guidance it re-reads it at most weekly to keep it true to your code. Both are suggestions and change nothing until you merge them, and both are charged to your credits. Turn it off and neither happens. See [Guidance we suggest for you](#guidance-we-suggest-for-you).

### Budget

Five settings bound what reviews cost you. All of them are under **Review settings** on the Code Review page.

| Setting | Default | What it does |
| --- | --- | --- |
| **Monthly budget (EUR)** | `0` (no cap) | The most your organization spends on reviews per calendar month. Once it's reached, new reviews stop with a **budget exceeded** check until you raise the cap or the month rolls over. This is the same setting as **Spend cap** on the Billing page. |
| **Per-review cap (EUR)** | Unset: `1.50`, growing with the size of the pull request | The most a single pull request review may cost you, between `1.20` and `10.08`. It's counted the same way as your monthly budget and your balance: it's what comes off your credits, and that much is set aside before the review starts. Leave it unset and the cap grows with each pull request (see [Bigger pull requests get a bigger budget](#bigger-pull-requests-get-a-bigger-budget)); set it and no review ever costs more than your number, however big the change. A review that reaches it stops early and reports what it found so far, so a lower cap buys shorter reviews rather than cheaper ones. Below `1.20` a review can't finish at all, which is why that's the minimum. Most reviews cost well under the default. |
| **Per-reviewer share (EUR)** | `0.45`, growing with the per-review cap | Advanced. The most any one reviewer may cost you within a review, so one reviewer can't use up the whole review's budget before the others have looked. Leave it unset and it follows your per-review cap, which is what we recommend. If you do set it, it has to be between a sixth and a half of your per-review cap, and raising the cap later doesn't move it for you. |
| **Per-reviewer time limit (seconds)** | `960` | How long any one reviewer may spend looking, between `300` and `960` (16 minutes). A small pull request gets two thirds of it, and each changed file adds a few seconds, up to the limit. A reviewer that runs out of time reports what it found so far, so lowering this buys quicker, cheaper reviews that look at less. `960` is both the maximum and what you get when you leave the field empty, so this one can only be lowered. A value you saved is kept until you change or clear it. |
| **Per-reviewer investigation limit (rounds)** | `20` | The fewest rounds of looking any one reviewer gets, where a round is one pass of thinking and then reading whatever it decided it needed. Between `20` and `43`, and `20` is what you get today, so this one is only ever raised. Bigger pull requests already get more rounds than this on their own, so you don't need to raise it for them; raising it also raises where that growth starts. Raise it only if your reviews are being cut short: most reviewers stop on their own well below the limit, so for most pull requests raising it changes nothing at all. Where it does apply it costs more, about a quarter more for every fifth more rounds. |

Each setting is checked when you save, and a value outside its range is rejected with the range it has to fall in, rather than quietly adjusted.

> **Note:** The last two are refused if the others can't deliver them. Raising the investigation limit needs a per-review cap that can pay for the extra rounds and a time limit long enough to reach them, so if you shorten either, raising the rounds is rejected. And if you set the per-reviewer share explicitly and then change the per-review cap, check the share still falls between a sixth and a half of the new cap.

#### Bigger pull requests get a bigger budget

A review that can't open every file a pull request changes hasn't really reviewed it, so the limits grow with the change:

- **Rounds.** A first review of a pull request gets 12 rounds plus one for every changed file, and never fewer than your investigation limit (20 unless you raised it), as far as its time limit and spend caps can pay for. A round spent only reading the pull request's own diff doesn't count. A follow-up review of a later push looks at the change since the last review, so it keeps a smaller, fixed number of rounds.
- **Spend.** If you leave **Per-review cap (EUR)** unset, the cap grows with the lines the pull request changes and with the extra rounds it's given, up to `10.08`. A small pull request stays at `1.50`; from about 70 changed files the cap reaches `10.08`. The per-reviewer share grows with it, unless you set the share yourself.
- **What you set is never exceeded.** If you set **Per-review cap (EUR)**, every review runs under exactly that number, however big the pull request.

A review is still charged only for what it actually uses, so a bigger budget on a big pull request costs you nothing it doesn't spend.

See [Billing](/docs/code-review/billing) for how spend turns into credits.

### Ticket lookup

The reviewers can read the tickets a pull request refers to, so they can judge the change against what it was meant to do. Ticket lookup reuses a data source you've already connected in Solidafy:

1. Add a GitHub, Jira or Linear data source under **Ingestion** > **Data Sources** if you don't have one (see [Connectors](/docs/pipelines/connectors)).
2. Under **Ticket lookup** on the Code Review page, pick it under **Ticket data source**.
3. Click **Enable ticket lookup**.

The credential stays in Solidafy and is never shown on the page. Use **Switch source** to point at a different data source, **Refresh credential** after you rotate the data source's credential, and **Disable** to turn ticket lookup off.

References are picked up from the pull request's branch name, title and description:

| Provider | References it recognizes |
| --- | --- |
| Linear | `ENG-123` style identifiers whose prefix is one of your Linear team keys |
| Jira | `PROJ-123` style keys whose prefix is one of your Jira project keys |
| GitHub Issues | `#123` or `owner/repo#123` |

Up to three tickets are read per review. If a ticket can't be fetched, the review carries on without it.

### Registry credentials

Credentials for private package registries and Helm chart registries live on the **Registry credentials** tab of the same page. They have their own docs page: [Private registries](/docs/code-review/private-registries).

### MCP tokens

Tokens that let a coding agent read your code index through the code index MCP server at `https://index.admin.solidafy.com/mcp` live on the **MCP tokens** tab. See [Code index MCP server](/docs/code-review/mcp-server).

### Dashboard and dashboard environment

When you connect the app, Solidafy sets up a Code Review data source, pipelines and a dashboard showing your review activity: runs, blocking findings and usage. Open it with **Open dashboard** on the **Dashboard** tab. There you can also pick which of your environments it lives in, under **Observability environment** > **Environment**, and click **Save environment**; changing it rebuilds it in the new environment and removes it from the old one. See [Liveboards](/docs/dashboards/liveboards).

## Repository files

Commit a `.review-agents/` directory at the root of a repository to tune the review for that repository:

```text
.review-agents/
  config.yaml          which reviewers run, blocking thresholds, ignored paths, license policy
  common.md            guidance every reviewer reads
  security.md          guidance for one reviewer (any of the six names)
  correctness.md
  ...
```

Every file is optional. A repository with no `.review-agents/` directory is reviewed with your organization settings.

### How the repository files are read

- **From the default branch only.** The files are read from the repository's default branch, never from the pull request being reviewed. A pull request that edits `.review-agents/` is reviewed under the current default-branch version, and the app posts an advisory note on it saying the changes take effect once merged. This stops a pull request from rewriting the rules for its own review.
- **Cached briefly.** After a change merges, it can take up to five minutes to apply.
- **Size limit.** Each Markdown file can be up to 32 KB. A Markdown file over the limit is skipped entirely, and a pull request that pushes one over the limit gets an advisory note saying so. `config.yaml` has its own limit of 16 KB; a larger one is ignored.
- **Forgiving parsing.** In `config.yaml`, an unknown key, an unknown reviewer name or an invalid value is ignored and the rest of the file still applies. Invalid YAML means the whole file is ignored. A bad config never fails a review.

> **Tip:** Since these files steer every review of the repository, protect them like code. A `CODEOWNERS` entry for `/.review-agents/` makes changes need approval from the people who own review policy.

### config.yaml

Every key is optional.

```yaml
# .review-agents/config.yaml

# Which reviewers run on this repository.
enabled_agents:
  - security
  - correctness
  - reliability
  - testing

# The severity at or above which each reviewer blocks the merge.
blocking_severity:
  security: high
  testing: never

# Paths to leave out of review in this repository.
path_ignores:
  - "docs/**"
  - "**/*.snap"

# Dependency licenses to always flag in this repository.
license_policy:
  deny:
    - AGPL-3.0-only
```

#### enabled_agents

A list of reviewers that run on this repository: any of `security`, `correctness`, `reliability`, `architecture`, `testing`, `best-practices`.

This list **replaces** the organization setting for this repository rather than narrowing it. A reviewer you turned off for the organization runs here if it's in the list, and one you turned on org-wide doesn't run here if it's missing. Leave the key out to follow the organization setting.

#### blocking_severity

A map from reviewer name to the lowest severity that blocks the merge. Values:

| Value | Effect |
| --- | --- |
| `critical`, `high`, `medium`, `low`, `info` | Findings at or above this severity block. |
| `never` (also `none`, `off`, or YAML `null`) | The reviewer is advisory only: it still reports findings but never blocks. |

Reviewers you don't list keep the built-in threshold, which is `medium` for all six. Blocking thresholds can only be set here, per repository; there's no organization-wide setting for them. The threshold also tells the reviewer how to calibrate, so a reviewer set to `high` knows which findings will block.

#### path_ignores

A list of glob patterns, matched against paths from the repository root. They're added to the organization's **Ignored paths**: a repository can ignore more, but can't un-ignore a path the organization ignores. The same limits apply (200 patterns, 200 characters each, at most 16 `*` wildcards per pattern).

#### license_policy

How the [open-source license check](/docs/code-review/overview#open-source-licenses) judges the dependencies this repository declares. Every field is optional, and the file can only make the check **stricter** than the built-in policy, never looser.

| Field | What it does |
| --- | --- |
| `deny` | SPDX ids to always flag, whatever category they fall into, including when they appear inside an `OR` expression that would otherwise pass. Up to 500 ids. |
| `enforce` | `true` raises a denied or copyleft dependency from `low` to `high`, so it stands out in the summary. It does not make it fail the check: no license finding blocks a merge today. |

Ids are matched case-insensitively, so `mit` and `MIT` are the same.

```yaml
license_policy:
  deny:
    - AGPL-3.0-only
    - SSPL-1.0
  enforce: true
```

Two more fields are accepted and currently have no effect, so there's nothing to gain by setting them. `allow` is narrowed to the ids the built-in policy also allows, and it allows none by name, so an `allow` list ends up empty. `unknown` can only be raised above its `warn` default, and the only value above it, `block`, behaves exactly like `warn` for now; `ignore` is read but loses to the default, so an undeterminable license is always reported.

### Building config.yaml in the portal

**Per repository** on the Code Review page has a builder. It starts from the reviewers your organization runs: switch each one **On** or **Off** under **Runs** and pick its **Blocks at** level, and it writes the smallest `config.yaml` that expresses your choices, leaving out whatever the repository would get with no file, ready to copy. If your choices match what the repository already gets, it tells you the repository needs no file. Below it are example `common.md` and reviewer files to start from. Nothing is written to your repository from this page.

### common.md

Plain prose about the repository, given to all six reviewers. A reviewer only sees this repository and the change in front of it, so this is where you put what it can't work out from the code:

- What the repository is, and what it isn't (for example "the web app lives in a separate repository").
- What's generated or vendored, and where it comes from.
- Cross-service contracts that look odd in isolation.
- Conventions that look like mistakes but are deliberate.

```markdown
This repository is the backend only. The web app it serves lives in a
separate repository, so do not reason about frontend code here.

Everything under src/generated/ is produced by the schema tool. Review
the schema it came from, not the output.

Each pricing version stops taking new inputs when its period closes.
That is deliberate, not a missed update.
```

### Reviewer files

`security.md`, `correctness.md`, `reliability.md`, `architecture.md`, `testing.md` and `best-practices.md` each go to one reviewer only. Use them for rules that only that reviewer needs; anything all six need belongs in `common.md`.

```markdown
Requests to internal services must carry a signed service token.
Flag any handler that accepts an unauthenticated call to an internal
endpoint, or logs a raw token or secret value.
```

Other file names in `.review-agents/` aren't read.

### Writing guidance that helps

- **State facts and reasons, not just rules.** "Each API version is frozen once released, because mobile clients pin to it" lets the reviewer reason about new cases; "don't flag old API versions" doesn't.
- **Name real paths, types and commands.** The reviewers can open files, so pointing at `src/routes/index.ts` is more useful than describing it.
- **Explain what looks wrong but isn't.** Deliberate duplication, intentional omissions, compatibility shims. These are the most common sources of noise.
- **Keep it current.** Update the files in the same pull request that changes a convention, so the next review holds the new rule. Solidafy also helps with this, by suggesting removals when a file stops matching the code (see below).
- Headings and bullet lists are fine. The files are read as Markdown.

## Guidance we suggest for you

Writing these files from scratch is work, and guidance is only true on the day it's written. So Solidafy offers to do both parts: write a first draft for a repository that has none, and keep it honest afterwards. Everything it does arrives as an ordinary pull request you can read, change, merge or close, and nothing in one affects a review until you merge it, because the reviewers only ever read `.review-agents/` from your default branch.

It's controlled by the **Suggest review guidance** setting under **Repository scope**, which is on unless you turn it off.

Besides your code, it reads what your team already wrote down: `AGENTS.md`, `CLAUDE.md`, `CONTRIBUTING.md` and `README.md`, plus the documents they link to, such as a rules file or your decision records. Those are source material, not policy: each rule found there is checked against the code before it's used.

### The first suggestion

For a repository with no `.review-agents/` directory, Solidafy reads the repository and opens one pull request, titled **Suggested code-review guidance for this repository**, with a proposed `common.md` plus whichever reviewer files the repository's shape justifies. It also includes a `config.yaml` that only restates the defaults, so nothing in the suggestion can change which reviewers run or what blocks a merge.

This is offered **once per repository, ever**. Closing it without merging is a complete answer, and you won't be asked again.

### Keeping it true

Once a repository has guidance, Solidafy re-reads it against the code at most once a week, and only after your default branch has changed. It takes out claims your code no longer supports, and adds what it can show is true and missing. Every line it adds has to be checked against your code first, it never adds a new file, and a file stops growing at the 32 KB size limit. On its own, it only takes a line out after the code that line is about has been read on two different days and disagreed with it both times. Most weeks it finds nothing worth your attention and opens nothing at all.

A line it suspects is out of date but can't prove wrong gets a comment asking whether it's still true, rather than being deleted. Answer in the thread and it acts on your answer: tell it the line is gone and it removes it there and then, as its own commit, rewriting the surrounding paragraph or deleting the whole file if that's what the removal needs; tell it the line is still right and it stops flagging it. If your answer isn't clear either way, the line stays and it says what it couldn't tell.

### Asking for a full regeneration

You don't have to wait for the weekly pass. **Full guidance run** on the **Guidance** tab of the Code Review settings page runs a full pass on one repository whenever you ask. It's offered to people who can manage your organization's settings:

1. Pick a repository under **Repository for guidance generation**. The list is searchable and holds the repositories the app is installed on.
2. Click **Generate full guidance**.

The page follows the job while it's queued and running, and says when your proposal is ready or why nothing came of it. The result arrives as a pull request like the others: it builds on the guidance you already have, can also take out a line your code no longer bears out, and changes nothing until you merge it. It's charged to your credits. It doesn't run while **Suggest review guidance** is off, and if your organization runs out of credits the page says the job is waiting for credits before it can continue.

### Asking for changes in the comments

On any of these pull requests, a comment from someone with write access is a request, and Solidafy does the work rather than handing it back to you. Write what you want in plain English, on the conversation or inline on the exact sentence you're objecting to, and it edits the files, pushes the change as a new commit and replies saying what it did. If you don't like the result, comment again. An inline comment is the clearer gesture, because it points at the sentence, but a top-level one works whenever what you mean is clear.

Some requests are declined, and the same rule governs all of them: guidance can add context but can never relax the review. It can't touch `config.yaml`, and a sentence that tells a reviewer to stop blocking, stop running or skip a path is dropped however it's phrased, which means "stop flagging missing tests in generated code" is the kind of request that gets a friendly no. Where part of a request can be done, that part is done and the reply says which part. To stop a reviewer or ignore a path, use `config.yaml` or your organization settings, which are yours to change.

### What it costs

This work is charged to your credits at the same rate a review is, and it's a visible line on the pull request. The first suggestion is roughly a third of one review, a weekly re-read is less than that, and a week where your code didn't change costs nothing. An attempt that doesn't produce a suggestion is still charged, because the work was done either way. If your organization is out of credits or over its monthly budget, none of this runs, and it's offered again after you top up. Turning the setting off stops both the pull requests and the spend.

## How the layers combine

| What | Organization setting | Repository file | Result |
| --- | --- | --- | --- |
| Which reviewers run | **Enabled** toggles | `enabled_agents` | The repository list wins when present, otherwise the organization toggles |
| Blocking thresholds | (none) | `blocking_severity` | The repository value, otherwise `medium` |
| Ignored paths | **Ignored paths** | `path_ignores` | Both lists combined |
| License policy | (none) | `license_policy` | The built-in policy, made stricter by the repository file |
| Guidance | **Your guidance** boxes | `common.md`, `<reviewer>.md` | All of it, in this order: organization (all reviews), organization (this reviewer), repository `common.md`, repository `<reviewer>.md` |
