What you need
- A Linux machine with Docker Engine 26 or newer. GitHub must be able to reach this machine on one port.
- A model key from Anthropic. You pay the model provider directly.
- Admin rights on the GitHub organisation or account that owns the repositories. You need them to register a GitHub App.
- The install bundle. It comes with the Enterprise plan: contact sales.
1. Register the GitHub App
Unpack the bundle. It holds compose.yaml, env.example, README.md, register_app.py and an images folder. There are two ways to register the App.
The first way is the script register_app.py. Run it in the folder of the bundle, on a machine with a browser. It needs Python 3.9 or later. Use the address where GitHub can reach this machine:
python3 register_app.py --hook-url https://your-host/webhooks/githubAdd --org your-org to create the App under an organisation. Without it, the App goes under your own account.
- The script prints the address of one page. Open that page.
- The page sends the settings of the App to GitHub. Press "Create GitHub App" on GitHub.
- The script saves the private key as
secrets/github-app.pem. It writesBREAKSPEC_GITHUB_APP_IDandBREAKSPEC_WEBHOOK_SECRETinto.env. - The page then links to GitHub. Install the App on the repositories that you want reviewed.
The script prints no secret. We have tested its page, its refusals and its file writing. Leave the webhook active when you create the App.
The second way is to register the App by hand. Create the App under the account or organisation that owns the repositories. Keep the App private. Use these settings:
| Setting | Value |
|---|---|
| Webhook URL | https://<host>/webhooks/github |
| Webhook secret | The value of BREAKSPEC_WEBHOOK_SECRET |
| Repository permissions | Contents: read. Pull requests: read and write. Issues: read and write. Checks: read and write. |
| Events | Pull request, Issue comment, Pull request review comment |
Generate the webhook secret with openssl rand -hex 32. You put the same value in the env file in step 2.
Leave the webhook active when you create the App.
Then do these three things:
- Download the private key of the App. Save it as
secrets/github-app.pemin the folder of the bundle. - Write down the App ID. You need it in step 2.
- Install the App on the repositories that you want reviewed.
The third event, Pull request review comment, tells Breakspec that someone replied under a review comment. Without it, reviews still run but replies get no answer.
2. Fill in the env file
The script in step 1 creates .env and fills in the first two values below. If you registered the App by hand, copy env.example to .env in the folder of the bundle. A first review needs these four values:
# GitHub signs every event with this. Generate one: openssl rand -hex 32BREAKSPEC_WEBHOOK_SECRET=# GitHub App. Save its private key as secrets/github-app.pem next to this file.BREAKSPEC_GITHUB_APP_ID=# The model. Your own key; reviews call the provider directly from this machine.ANTHROPIC_API_KEY=# The workspace reads reviews from the service with this token. Generate one: openssl rand -hex 32BREAKSPEC_API_TOKEN=The bundle does not start without BREAKSPEC_WEBHOOK_SECRET and BREAKSPEC_API_TOKEN. The other settings have defaults. The Configuration page lists all of them.
3. Start the bundle
Run these commands in the folder of the bundle:
docker load -i images/breakspec-service.tar.gzdocker load -i images/breakspec-web.tar.gzdocker compose up -dcurl -s localhost:8080/healthzThe two docker load commands load the review image and the workspace image from the bundle. The bundle contains no source code. docker compose up -d starts the receiver, the worker and the workspace. The last command gets an answer when the receiver is up.
The receiver listens on port 8080. Make sure the webhook URL of the App leads to that port on this machine.
4. Open a pull request
Open a pull request, or push to an open one, in a repository where the App is installed. Breakspec does not review draft pull requests unless you set BREAKSPEC_REVIEW_DRAFTS=1.
This command shows each review job as it runs:
docker compose logs -f workerOn our own sample project, a DMA engine with a C driver, a review costs about $1 to $1.50 in model usage in our own runs.
To run the review again, a collaborator writes the comment @breakspec review on the pull request.
What you see on the pull request
- A check on the commit.
- One summary comment. Breakspec updates this comment in place on later pushes.
- One comment on the line of each finding.
Each finding states how far it got, in one of these phrases:
- reproduced in simulation, rerun by Breakspec
- confirmed by reading the code, not run
- raised by a reviewer, not examined
A finding that is not reproduced is never shown as proven. For a reproduced finding, Breakspec keeps the waveform from its own rerun with the finding. See What a review contains.
By default the check is advisory. Set BREAKSPEC_CHECK_MODE=blocking to fail the check when a finding is reproduced in simulation.
Open the workspace
The workspace is a small web app on port 3000. It shows the pull requests that were reviewed and the findings of each one.
The workspace starts closed. Until you set up sign-in, it shows only a page that says how to open it. The steps are in Configuration.