Skip to content

Hosted Breakspec is in private beta. Ask for access

Docsset up

Configuration

The service reads its settings from one file, .env, next to compose.yaml. Your repository needs no configuration file.

These pages are for the self-hosted bundle, which is the Enterprise plan. The hosted service is in private beta: ask for access.

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:

terminal
docker compose up -d

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

SettingDefaultWhat it does
BREAKSPEC_WEBHOOK_SECRETnoneGitHub signs each event with this secret. Use the same value in the GitHub App. Generate one with openssl rand -hex 32.
BREAKSPEC_API_TOKENnoneThe 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

SettingDefaultWhat it does
BREAKSPEC_GITHUB_APP_IDnoneThe ID of your private GitHub App. Save the private key of the App as secrets/github-app.pem next to compose.yaml.
BREAKSPEC_GITHUB_TOKENnoneUse this in place of an App: a token for a bot account with write access to pull requests.
BREAKSPEC_GITHUB_API_URLhttps://api.github.comThe API URL of your GitHub Enterprise Server instance.
BREAKSPEC_GITHUB_URLhttps://github.comThe 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.

SettingDefaultWhat it does
ANTHROPIC_API_KEYnoneYour Anthropic model key.
BREAKSPEC_MODEL_PROVIDERnoneSet to bedrock to use Amazon Bedrock in place of an Anthropic key.
AWS_ACCESS_KEY_IDnoneFor Amazon Bedrock.
AWS_SECRET_ACCESS_KEYnoneFor Amazon Bedrock.
AWS_REGIONnoneFor 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.

SettingWhere the code goesHow far it is tested
ANTHROPIC_API_KEYTo Anthropic, under your own account and key.All our own reviews used this.
BREAKSPEC_MODEL_PROVIDER=bedrockTo 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_URLTo 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:

  1. 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.
  2. Put the four sign-in settings from the table below in .env.
  3. 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.
SettingDefaultWhat it does
GITHUB_CLIENT_IDnoneThe client ID of the OAuth app.
GITHUB_CLIENT_SECRETnoneThe client secret of the OAuth app.
AUTH_SECRETnoneSigns the session cookie. Generate one with openssl rand -hex 32.
BREAKSPEC_ALLOWED_USERSnoneThe GitHub accounts that can open the workspace.
BREAKSPEC_PUBLIC_URLnoneThe address that people use for the workspace, if a proxy is in front of it.
BREAKSPEC_WORKSPACE_ACCESSnoneSet 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

SettingDefaultWhat it does
BREAKSPEC_REPOSnoneOnly 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_DRAFTS0Set to 1 to review draft pull requests too.
BREAKSPEC_CHECK_MODEadvisoryblocking fails the check when a finding is reproduced in simulation. advisory does not fail the check.
BREAKSPEC_REPLIESonSet to off to stop answers to replies under review comments.
BREAKSPEC_RESOLVE_THREADSonBreakspec 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_LABELSno-reviewA 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_AUTHORSnonePull requests opened by these accounts are not reviewed. A list with commas.
BREAKSPEC_BRANCHESnoneWhen set, only pull requests into these branches are reviewed. A list with commas, and * matches any text.
BREAKSPEC_COMMENT_SEVERITYP3The 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

SettingDefaultWhat it does
BREAKSPEC_DAILY_LIMIT200The most reviews that can start in any 24 hours.
BREAKSPEC_REPLY_LIMIT100The most answers to replies in any 24 hours. One thread gets at most six answers.

Ports

SettingDefaultWhat it does
BREAKSPEC_PORT8080The port where GitHub delivers events.
BREAKSPEC_WEB_PORT3000The 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.

SettingDefaultWhat it does
BREAKSPEC_WORKERS2The number of reviews that run at the same time.
BREAKSPEC_JOB_TIMEOUT1800The longest time for one review, in seconds.
BREAKSPEC_DOCKER_CPUS4The CPU limit of one review container.
BREAKSPEC_DOCKER_MEMORY8gThe memory limit of one review container.
BREAKSPEC_REVIEW_MODELsonnetThe model that the reviewers use.
BREAKSPEC_PROVE_MODELnoneThe model for the step that reproduces a finding in simulation.
BREAKSPEC_REPLY_MODELnoneThe model that answers replies. When it is empty, the value of BREAKSPEC_PROVE_MODEL is used.
ANTHROPIC_BASE_URLnoneA different address for the Anthropic API, for example a proxy on your network.
BREAKSPEC_BOT_NAMEbreakspecThe name in the comment that runs a review again: @breakspec review.
BREAKSPEC_IMAGEbreakspec:serviceThe image of the server, the worker and the review containers.
BREAKSPEC_WEB_IMAGEbreakspec-web:serviceThe image of the workspace.
BREAKSPEC_SECRETS_DIR./secretsThe 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.md holds your team rules in plain English. See Team rules.
  • .breakspec/ignore lists 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.

.breakspec/ignore
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.