What runs where
The bundle is one Docker Compose file with two images. The images come as two files in the images folder, and you load them with docker load. The bundle contains no source code. It runs four kinds of container.
| Container | What it does | What it holds |
|---|---|---|
| server | Receives pull request events from GitHub, puts them in a queue and answers the workspace. | The webhook secret and the read token of the workspace. |
| worker | Fetches each pull request, starts its review and posts the result. | The GitHub credentials. |
| review | Runs one review. The worker starts one for each review and removes it when the review ends. | The model key and the checkout of that one pull request. No GitHub credential. |
| web | The workspace that people open in a browser, on port 3000. | The read token and the sign-in settings. No GitHub credential and no model key. |
Code from a pull request runs in the review container only. That is where testbenches and simulators run. Review containers are on a Docker network of their own, named breakspec_review.
By default a review container gets 4 CPUs and 8 GB of memory, and a review stops after 1800 seconds. The worker runs 2 reviews at the same time. You can change these values, see Configuration.
What leaves your network
The bundle makes outbound calls to two places:
- GitHub. The worker fetches the pull request and posts the check and the comments.
- The model provider. The review agents call it with your own model key. Those calls contain the code that the agents read.
The bundle sends nothing to Breakspec. Your repositories are cloned and stored on your machine only.
One connection comes in from outside: GitHub delivers events to the server on one port, 8080 by default.
Connections in and out
| Connection | Direction | Host and port |
|---|---|---|
| GitHub to the server (pull request events) | In | This machine, port 8080. Change it with BREAKSPEC_PORT. |
| Your browser to the workspace | In | This machine, port 3000. Change it with BREAKSPEC_WEB_PORT. |
| The worker to the GitHub API | Out | https://api.github.com, port 443, or the address in BREAKSPEC_GITHUB_API_URL. |
| The worker to GitHub, to fetch the repository | Out | https://github.com, port 443, or the address in BREAKSPEC_GITHUB_URL. |
| The review container to the model provider | Out | The Anthropic API over https, or the address in ANTHROPIC_BASE_URL, or Amazon Bedrock in the region in AWS_REGION. |
When sign-in is set up, the workspace also calls GitHub at the same two GitHub addresses.
The bundle makes no connection to Breakspec. The service code has no licence check, no telemetry and no update check.
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 Configuration.
The model key and the review network
The review container holds the model key and the checkout of one pull request. Code from the pull request runs in that container, so that code can read the model key. The worker holds the GitHub credential. The review container has no GitHub credential and no Docker socket.
The review container must reach one place: your model provider. That is the Anthropic API, the address in ANTHROPIC_BASE_URL, or Amazon Bedrock in the region in AWS_REGION. The worker fetches the repository, so the review container does not need GitHub.
Allow the breakspec_review network to reach only your model provider. Block everything else.
compose.yaml sets no user, no capability limit and no read-only filesystem on the server, the worker or the workspace. The worker starts each review container with these Docker options:
--cap-drop ALL--security-opt no-new-privileges--pids-limit 2048--userwith a user that is not root--memoryand--cpus, with the limits from your settings
The filesystem of the review container is not read only. The bundle applies no further container hardening yet. Rootless Docker is not yet tested.
Where data is stored
| Place | Contents |
|---|---|
| data volume | All state of the service in one SQLite file, breakspec.db. Next to it, a cache of fetched repositories. |
| breakspec_jobs volume | The working folder of each review job. A review container mounts the folder of its own job only. |
| secrets/ | The private key of the GitHub App, github-app.pem. The worker mounts this folder read only. |
| .env | Your settings, the model key included. |
The workspace container stores nothing.
How to update
An update is a new bundle that we send to you. Replace the files of the old bundle, but keep your .env file and your secrets folder. Then 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 -dThe two docker load commands load the new images from the images folder of the bundle. Docker Compose starts new containers from the new images. The volumes stay, so the reviews you already have stay too.
Update when no review is running. docker compose logs -f worker shows the jobs.
How to back up
Back up these four things:
- The
.envfile. - The
secretsfolder. - The data volume. Docker names it
breakspec_data. - The jobs volume,
breakspec_jobs.
Stop the bundle before you copy the volumes, because the SQLite file can change while the service runs. These commands write two archives to the current folder:
docker compose stopdocker run --rm --user 0 --entrypoint tar -v breakspec_data:/v:ro -v "$PWD":/backup \ breakspec:service czf /backup/breakspec-data.tgz -C /v .docker run --rm --user 0 --entrypoint tar -v breakspec_jobs:/v:ro -v "$PWD":/backup \ breakspec:service czf /backup/breakspec-jobs.tgz -C /v .docker compose startThe cache of fetched repositories is inside the data volume. Breakspec fetches a repository again if the cache is missing.
Known limits
These are the limits we know of today.
- Breakspec works with GitHub only. GitLab is not supported yet.
- The bundle runs on one machine.
- On github.com, Breakspec has run in one private test repository of our own. GitHub delivered the events over plain http. We have not yet run it with https in front of the server.
- Not yet tried on github.com: the comment
@breakspec review, and the workspace. - The review container holds the model key. Code that runs in that container can read the key. Allow the
breakspec_reviewnetwork to reach only your model provider. Block everything else. - The script
register_app.pyin the bundle has not created an App yet. The same flow created our own test App once, from an earlier copy of the script. - In our one test, an App created with its webhook off received no pull request events after we switched the webhook on.
- Rootless Docker is not yet tested.
- A review is not cancelled when a newer commit arrives. The review finishes and posts nothing. Then Breakspec reviews the newer commit.
- An answer to a reply reads the code. It does not run a new simulation.
- A finding that was withdrawn in a reply still counts in the verdict of the next review.
- Replies have been answered on github.com once, to a reply that we wrote ourselves. That answer took 18 seconds and cost 4 cents.
- Team rules have been through one real review, on our sample project. That review cost $1.49. The same change without rules cost $1.15.
- Not yet tried with team rules: a pull request on github.com, a rules file for one folder, and a pull request that edits the rules.
- A simulator that you license yourself has not been used in a whole review. It is not a supported feature yet. See Simulators.
- The workspace is read only. You cannot change a review from it. It does not show replies.
- Sign-in to the workspace has not been run from start to finish against GitHub. The closed state and the open setting have been run.
- Single sign-on, Slack and issue tracker integrations are not built yet.