Configuration¶
reviewloop works with no configuration. To change its behavior, commit .reviewloop.yml at the repository root.
- It is read from the target branch of the pull request, never from the PR branch, so a pull request cannot change how it is reviewed.
- Unknown keys are errors. A key that looks like a secret (
token,secret,password,api_key) is rejected: credentials come only from CI variables.
Full example¶
version: 1
agent: claude-code # claude-code | codex | cursor
model: sonnet # passed to the agent CLI as is
language: en # language of review comments
paths:
exclude: ["**/*.snap", "docs/generated/**"]
rules:
- path: "app/Http/**"
file: .reviewloop/rules/api.md
tracker:
type: jira # github | gitlab | jira
url: https://jira.example.com
key_pattern: "[A-Z]+-\\d+"
require_context: false
security:
enabled: true
scanners: [opengrep, gitleaks]
suggestions: true
fail_on: none # none | critical | high
large_diff_lines: 3000
review_drafts: false
tool_reports:
- name: eslint
path: eslint.sarif
Keys¶
| Key | Default | Meaning |
|---|---|---|
version |
1 |
Config schema version |
agent |
claude-code |
Agent. codex and cursor also need REVIEWLOOP_EXPERIMENTAL_AGENTS=1 |
model |
none | Model passed to the agent; none uses the agent's default (auto for Cursor) |
effort |
none | Reasoning effort, low, medium or high, passed to the agent; none uses the agent's default. Env REVIEWLOOP_EFFORT |
language |
en |
Language of review comments, for example de or ja |
paths.exclude |
[] |
Globs of files never sent to the agent, on top of the built-in list |
rules |
[] |
Repository rule files, each added when a changed file matches its path glob |
tracker.type |
none | Where tickets live: github, gitlab or jira |
tracker.url |
none | Jira base URL (Jira only) |
tracker.key_pattern |
per tracker | Regex for ticket keys in the PR title, body and branch |
tracker.require_context |
false |
Skip the review when no ticket is found |
security.enabled |
true |
Run the security review branch |
security.scanners |
[opengrep, gitleaks] |
Scanners run before the security agents, when installed |
suggestions |
true |
Attach code suggestions where the platform supports them |
fail_on |
none |
Exit 1 when a finding of an initial review is at or above this severity. A recheck exits 0 or 2 only, unless no earlier review exists and it runs a full review instead |
large_diff_lines |
3000 |
Above this many changed lines the diff is split into groups |
review_drafts |
false |
Review draft pull requests when they open |
tool_reports |
[] |
SARIF files your CI wrote, sent to the agent as hints; at most 10. See Tool reports |
Excluded files¶
These files are listed in the summary as excluded with a reason and never reach the agent: binary files, deleted
files, rename-only and mode-only changes, lockfiles (*.lock, package-lock.json, pnpm-lock.yaml, go.sum, ...),
generated or vendored paths (vendor/**, node_modules/**, dist/**, build/**, *.min.js, *_pb2.py, ...) and
paths.exclude.
Repository rules¶
A rule file is Markdown with one rule per line, for example:
- API-1 [high] A controller action returns an Eloquent model directly. It leaks hidden columns. Return a resource.
Rule files are read from the target branch. They are added on top of the built-in rules for the detected stacks, and
a repository rule wins when it conflicts with a built-in one. reviewloop prefixes every rule id with REPO-
(API-1 becomes REPO-API-1), so findings never mix up a repository rule with a built-in id such as PY-1.
Scanners¶
security.scanners runs gitleaks (on the PR's commits) and opengrep (on the changed files) before the security
agents. Their output is a hint for the agents; a missing scanner is skipped with one log line.
Out of the box only gitleaks scans: the image ships the opengrep binary but no rules. opengrep runs only with rules
you provide, from REVIEWLOOP_OPENGREP_RULES (a directory of opengrep rule files) or, when that is unset, from
/opt/opengrep-rules. Either:
- mount a rules directory into the job and set
REVIEWLOOP_OPENGREP_RULESto its path, or - build a derived image that copies your rules to
/opt/opengrep-rules.
reviewloop runs opengrep with --config <rules directory> --disable-version-check, so a scan makes no network call.
When no rules are present (the variable unset and /opt/opengrep-rules missing or empty), opengrep is skipped with one
log line. reviewloop never runs --config auto, which downloads rules on every run.
Tool reports¶
reviewloop does not run your build or linters, but it can read what they already wrote. Point tool_reports at SARIF
2.1.0 files in the CI workspace; results on lines the pull request changed go to the code-review agent as hints. The
agent confirms each one in the code, posts only real problems in its own words, and cites the tool's rule as
<name>:<ruleId>. The summary shows how many results each tool had on changed lines and how many became findings.
tool_reports:
- name: dotnet-build # lowercase letters, digits and dashes
path: artifacts/build.sarif # relative to the CI workspace
- name: eslint
path: eslint.sarif
- The reviewloop job checks out the target branch, so do not run the tools there: they would analyse the old code, and building the pull request next to your model key and write token would run its code with your secrets. Run them in a separate job on the pull request head, with no secrets, and pass the SARIF files to the reviewloop job as an artifact (examples below).
pathis relative to the reviewloop job's workspace, where the artifact is downloaded.- At most 200 results are sent per run, errors first. A missing, unreadable or over 20 MB file is skipped with a note in the summary; the review still runs.
- A
pathoutside the workspace, absolute or through a symlink, is never read.
| Tool | A command that writes SARIF |
|---|---|
| .NET (compiler and Roslyn analyzers) | dotnet build --no-incremental -p:ErrorLog=$PWD/build.sarif%2Cversion=2.1 |
| ESLint | npx eslint . -f @microsoft/eslint-formatter-sarif -o eslint.sarif (install @microsoft/eslint-formatter-sarif) |
| Ruff | ruff check --output-format sarif --output-file ruff.sarif . |
| golangci-lint (v2) | golangci-lint run --output.sarif.path=golangci.sarif ./... |
| PHPStan | vendor/bin/phpstan analyse --error-format=sarif > phpstan.sarif (with jbelien/phpstan-sarif-formatter) |
A tool without SARIF output can go through a converter in your CI.
GitHub Actions: an analysis job on the pull request head, then the review job downloads its artifact after checkout.
jobs:
analyse:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v7 # the pull request head, the default for pull_request
with:
persist-credentials: false
- run: npx eslint . -f @microsoft/eslint-formatter-sarif -o eslint.sarif || true
- uses: actions/upload-artifact@v7
with:
name: tool-reports
path: eslint.sarif
review:
needs: analyse
# Keep the example's condition, prefixed with !cancelled(): on a comment the analyse job is skipped, and a job
# whose need was skipped is skipped too unless its condition says otherwise.
if: >-
!cancelled() && (github.event_name == 'pull_request' || ...)
# ... the rest of the reviewloop job from examples/github-workflow.yml; after its checkout step add:
steps:
- uses: actions/download-artifact@v7
if: github.event_name == 'pull_request'
with:
name: tool-reports
path: tool-reports
with tool_reports: [{name: eslint, path: tool-reports/eslint.sarif}]. On a /reviewloop review comment there is
no analysis job, and the review runs without tool reports. Pin each action by commit SHA, as the example workflow
does.
GitLab CI: a job in an earlier stage of the merge request pipeline, whose artifacts the reviewloop job receives.
eslint:
stage: build
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
script:
- npx eslint . -f @microsoft/eslint-formatter-sarif -o eslint.sarif || true
artifacts:
paths: [eslint.sarif]
reviewloop:
needs: [eslint]
On merged results pipelines the job analyses the merge commit, whose line numbers can differ from the merge request head; results on lines that moved may not match.
Tracker¶
tracker.type |
Credentials | Default key_pattern |
|---|---|---|
github |
the run's GITHUB_TOKEN |
#\d+ |
gitlab |
REVIEWLOOP_GITLAB_TOKEN |
#\d+ |
jira |
REVIEWLOOP_JIRA_TOKEN; Jira Cloud (*.atlassian.net) also REVIEWLOOP_JIRA_EMAIL |
\b[A-Z][A-Z0-9]+-\d+\b |
Jira Cloud uses an API token with the account email. Jira Data Center uses a personal access token.
Environment variables¶
| Variable | Meaning |
|---|---|
REVIEWLOOP_GITLAB_TOKEN |
GitLab project access token (GitLab only) |
REVIEWLOOP_BITBUCKET_TOKEN |
Bitbucket access token (Bitbucket only) |
REVIEWLOOP_JIRA_TOKEN, REVIEWLOOP_JIRA_EMAIL |
Jira tracker credentials |
REVIEWLOOP_EXPERIMENTAL_AGENTS=1 |
Allow the experimental agents codex and cursor |
REVIEWLOOP_KEEP_WORKDIR=1 |
Keep the work directory (agent inputs and transcripts) for debugging |
Agent credentials are listed on each agent page.