Where the settings are
Copy env.example to .env in the folder of the bundle and fill it in. After you change .env, apply the change with this command:
docker compose up -dIn the tables below, "none" means that the setting is empty until you set it.
Required settings
The bundle does not start without these two settings.
| Setting | Default | What it does |
|---|---|---|
| BREAKSPEC_WEBHOOK_SECRET | none | GitHub signs each event with this secret. Use the same value in the GitHub App. Generate one with openssl rand -hex 32. |
| BREAKSPEC_API_TOKEN | none | The workspace reads reviews from the service with this token. Generate one with openssl rand -hex 32. |
A review also needs a GitHub credential and a model key. See the next two sections.
GitHub
| Setting | Default | What it does |
|---|---|---|
| BREAKSPEC_GITHUB_APP_ID | none | The ID of your private GitHub App. Save the private key of the App as secrets/github-app.pem next to compose.yaml. |
| BREAKSPEC_GITHUB_TOKEN | none | Use this in place of an App: a token for a bot account with write access to pull requests. |
| BREAKSPEC_GITHUB_API_URL | https://api.github.com | The API URL of your GitHub Enterprise Server instance. |
| BREAKSPEC_GITHUB_URL | https://github.com | The web URL of your GitHub Enterprise Server instance. |
We recommend the App. With a token, you add the webhook to the repository or organisation by hand, with the same URL, secret and events. The result then shows as a commit status in place of a check. The Quickstart lists the settings of the App.
The model
Reviews call the model provider directly from your machine, with your own key. Only the review containers get these values.
| Setting | Default | What it does |
|---|---|---|
| ANTHROPIC_API_KEY | none | Your Anthropic model key. |
| BREAKSPEC_MODEL_PROVIDER | none | Set to bedrock to use Amazon Bedrock in place of an Anthropic key. |
| AWS_ACCESS_KEY_ID | none | For Amazon Bedrock. |
| AWS_SECRET_ACCESS_KEY | none | For Amazon Bedrock. |
| AWS_REGION | none | For Amazon Bedrock. |
All our own runs used an Anthropic key. Model usage was about $1 to $1.50 for each review in those runs.
What goes to the model provider
The reviewers send the code they read in the model calls. They have read access to the whole repository. Nothing goes to Breakspec.
| Setting | Where the code goes | How far it is tested |
|---|---|---|
| ANTHROPIC_API_KEY | To Anthropic, under your own account and key. | All our own reviews used this. |
| BREAKSPEC_MODEL_PROVIDER=bedrock | To Amazon Bedrock in your own AWS account. | A unit test covers the model names. We have not yet run a whole review through this. |
| ANTHROPIC_BASE_URL | To the address you set, for example a proxy on your network. | We have not yet run a whole review through this. |
A path in .breakspec/ignore stops findings on that path. It does not stop the reviewers reading the path. See Files in your repository.
The workspace
The workspace starts closed. Until sign-in is set up, each workspace address shows a page that says how to open it. To open the workspace:
- Create a GitHub OAuth app. This is a plain OAuth app, separate from the review App. Its callback is
<workspace address>/api/auth/callback/github. - Put the four sign-in settings from the table below in
.env. - If a proxy is in front of the workspace, set
BREAKSPEC_PUBLIC_URL. Turn response buffering off in the proxy so that pages can stream.
| Setting | Default | What it does |
|---|---|---|
| GITHUB_CLIENT_ID | none | The client ID of the OAuth app. |
| GITHUB_CLIENT_SECRET | none | The client secret of the OAuth app. |
| AUTH_SECRET | none | Signs the session cookie. Generate one with openssl rand -hex 32. |
| BREAKSPEC_ALLOWED_USERS | none | The GitHub accounts that can open the workspace. |
| BREAKSPEC_PUBLIC_URL | none | The address that people use for the workspace, if a proxy is in front of it. |
| BREAKSPEC_WORKSPACE_ACCESS | none | Set to open to remove the sign-in. Do this only if access is already controlled in front of the workspace, for example by a VPN. |
Which pull requests are reviewed
| Setting | Default | What it does |
|---|---|---|
| BREAKSPEC_REPOS | none | Only these repositories are reviewed. A list with commas, and * matches any text: acme/fpga-*,acme/firmware. When it is empty, each repository that sends events is reviewed. Set this list. With an empty list, each repository where the App is installed is reviewed, and the code the reviewers read there goes to your model provider. |
| BREAKSPEC_REVIEW_DRAFTS | 0 | Set to 1 to review draft pull requests too. |
| BREAKSPEC_CHECK_MODE | advisory | blocking fails the check when a finding is reproduced in simulation. advisory does not fail the check. |
| BREAKSPEC_REPLIES | on | Set to off to stop answers to replies under review comments. |
| BREAKSPEC_RESOLVE_THREADS | on | Breakspec resolves the thread of a review comment on GitHub when a later review no longer raises the finding, or when a reply ends with the finding withdrawn. Set to off to leave threads open. |
| BREAKSPEC_SKIP_LABELS | no-review | A pull request with one of these labels is not reviewed. A list with commas. Set it to an empty value and no label stops a review. |
| BREAKSPEC_SKIP_AUTHORS | none | Pull requests opened by these accounts are not reviewed. A list with commas. |
| BREAKSPEC_BRANCHES | none | When set, only pull requests into these branches are reviewed. A list with commas, and * matches any text. |
| BREAKSPEC_COMMENT_SEVERITY | P3 | The least severe finding that gets a comment on its line: P0, P1, P2 or P3. With P3, all findings get a comment. |
A collaborator who writes the comment @breakspec review gets a review in each of these cases: a draft, a skip label, a skipped author, any branch.
Breakspec never reopens a thread. If GitHub refuses to resolve a thread, the thread stays open and nothing else changes. Your GitHub App can need more permission than pull requests write for this call.
Limits
| Setting | Default | What it does |
|---|---|---|
| BREAKSPEC_DAILY_LIMIT | 200 | The most reviews that can start in any 24 hours. |
| BREAKSPEC_REPLY_LIMIT | 100 | The most answers to replies in any 24 hours. One thread gets at most six answers. |
Ports
| Setting | Default | What it does |
|---|---|---|
| BREAKSPEC_PORT | 8080 | The port where GitHub delivers events. |
| BREAKSPEC_WEB_PORT | 3000 | The port where the workspace listens. |
More settings in compose.yaml
compose.yaml reads these settings from .env too. They are not in env.example, and most installs do not need them.
| Setting | Default | What it does |
|---|---|---|
| BREAKSPEC_WORKERS | 2 | The number of reviews that run at the same time. |
| BREAKSPEC_JOB_TIMEOUT | 1800 | The longest time for one review, in seconds. |
| BREAKSPEC_DOCKER_CPUS | 4 | The CPU limit of one review container. |
| BREAKSPEC_DOCKER_MEMORY | 8g | The memory limit of one review container. |
| BREAKSPEC_REVIEW_MODEL | sonnet | The model that the reviewers use. |
| BREAKSPEC_PROVE_MODEL | none | The model for the step that reproduces a finding in simulation. |
| BREAKSPEC_REPLY_MODEL | none | The model that answers replies. When it is empty, the value of BREAKSPEC_PROVE_MODEL is used. |
| ANTHROPIC_BASE_URL | none | A different address for the Anthropic API, for example a proxy on your network. |
| BREAKSPEC_BOT_NAME | breakspec | The name in the comment that runs a review again: @breakspec review. |
| BREAKSPEC_IMAGE | breakspec:service | The image of the server, the worker and the review containers. |
| BREAKSPEC_WEB_IMAGE | breakspec-web:service | The image of the workspace. |
| BREAKSPEC_SECRETS_DIR | ./secrets | The folder that holds github-app.pem. |
Files in your repository
Breakspec reviews a repository that has no Breakspec file in it. Two files are optional:
.breakspec/rules.mdholds your team rules in plain English. See Team rules..breakspec/ignorelists paths that the review must leave alone.
Write one pattern on each line of .breakspec/ignore, as in a .gitignore file. Breakspec skips blank lines and lines that start with #. The last pattern that matches a path decides, and a pattern that starts with ! keeps the path in the review.
vendor/**ip/xilinx/***.xci- Breakspec reads the file from the branch that the pull request goes into. A pull request cannot add to its own ignore list. A change to the file applies after it is merged, and the review says so.
- The reviewers are not asked to review a changed file on the list.
- Breakspec drops a finding in an ignored file before it checks the finding.
- The reviewers can still read an ignored file, because the code in the review can depend on it.
- Breakspec reads at most 500 patterns from the file.
The ignore file is tested with unit tests. No review on github.com has run with an ignore file yet.