BreakScope
See what your API changes will break — before they reach production.
API contract changes are easy to detect. Knowing what they break isn't.
BreakScope diffs your OpenAPI specs and traces each breaking change to the exact file:line in your Python and TypeScript code that's likely affected.
pip install breakscope
breakscope analyze openapi-old.yaml openapi-new.yaml path/to/repo
Try it on the demo in this repository:
breakscope analyze examples/demo/api/openapi-v1.yaml examples/demo/api/openapi-v2.yaml examples/demo
More examples, one per stack: FastAPI, Express, React, and Angular + Python. Each marks the lines that truly break, and a test checks that BreakScope reports exactly those.
On every pull request
The GitHub Action posts the same analysis as a PR comment. It keeps that one comment updated on later pushes, and fails the check when affected code is found. See a live example →
🔴 BreakScope: 1 breaking API change, 1 affected location
Risk: HIGH · 1 file affected
1.
User.email: A response property was removed. InGET /users,POST /users,GET /users/{userId}.
Location Code Confidence 🔴 frontend/src/components/UserProfile.tsx:19<p>{user.email}</p>high
How it works
- Diff the two specs into direction-aware changes, each with the exact field path (
User.name). - Find call sites of every operation with tree-sitter:
fetch, axios, AngularHttpClient,requests,httpx, aiohttp, custom clients, generated clients (by operationId), openapi-fetch and RTK Query hooks. - Trace the response through
await,.data,.json(),.then(), destructuring,.map()/forloops, RxJS (pipe(map()),combineLatest), ReactuseStateand props, Redux (Toolkit and classicconnect), Angular signals and templates, and one hop across a function return. - Report each read of a changed field with a confidence level, and when a property was probably renamed, what to replace it with (
.name→.full_name):
| Confidence | Meaning |
|---|---|
| 🔴 high | Data flow traced from a matching API call to this line |
| 🟡 medium | Traced through a function return, or the URL match was fuzzy |
| ⚪ low | Name match only (user.name where the schema is User); hidden unless --min-confidence low |
Static analysis can't be perfect, so BreakScope tells you how sure it is instead of pretending. Accuracy on the test corpus is tracked in CI: see docs/accuracy.md.
GitHub Action
Add .github/workflows/breakscope.yml (or run breakscope init --workflow):
name: BreakScope
on: pull_request
permissions:
contents: read
pull-requests: write # to post the report comment
jobs:
api-impact:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: Himanshu1281/breakscope@v1
with:
spec: api/openapi.yaml # or set it in .breakscope.yml
On every pull request it compares the spec with the base branch. It posts one comment with the affected code and keeps it updated on later pushes, adds the report to the job summary, and fails the job when affected code at fail-on risk is found.
| Input | Default | |
|---|---|---|
spec |
from .breakscope.yml |
Spec path in the repository |
base |
the PR's base branch | Git ref to compare against |
fail-on |
high |
high, medium, low or never |
min-confidence |
medium |
Hide less certain locations |
comment |
true |
Post and update the PR comment |
sarif-file |
Also write SARIF for github/codeql-action/upload-sarif |
Outputs: risk, breaking-changes, locations, report (path to the Markdown report).
Commands
| Command | What it does |
|---|---|
breakscope analyze OLD NEW [REPO] |
Changes → affected file:line. Exit 1 if anything at --fail-on risk (default high). |
breakscope check |
CI mode: compares the spec with the base branch, using .breakscope.yml. Writes --markdown, --sarif and --json reports. |
breakscope init |
Creates .breakscope.yml, and with --workflow the GitHub Actions workflow. |
breakscope diff OLD NEW |
Contract changes only. Exit 1 on breaking changes. |
breakscope usages SPEC [REPO] |
Where your code calls each operation. |
breakscope fix OLD NEW [REPO] |
Prints a patch for renamed fields (.name → .full_name) at the traced reads. Review it, then git apply. |
Specs can be read from git: breakscope diff git:origin/main:api/openapi.yaml api/openapi.yaml. analyze also takes --format markdown|sarif. analyze and usages take --base-url /api/v1 (a path prefix your code adds) and --exclude GLOB.
No account, no API key, no hosted service. Everything runs locally.
Status: 1.0. See the changelog. Supports OpenAPI 3.0/3.1, Python, TypeScript and JavaScript. See the roadmap.
License
MIT
Metadata
Release files for breakscope 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| breakscope-1.3.0.tar.gz | 119.4 kB | With provenance | Details for breakscope-1.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| breakscope-1.3.0-py3-none-any.whl | Python 3 | none | any | Details for breakscope-1.3.0-py3-none-any.whl |
Total release size: 201.1 kB
Release files / breakscope-1.3.0.tar.gz
| Download URL | breakscope-1.3.0.tar.gz |
|---|---|
| Size | 119.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
78e9335ebfaaf7d0c9a3394ea3c726e5367374199709cd47b345177d7dfc0f65
|
|
BLAKE2b-256 checksum How to use checksums |
2311e0cce3c7d2c14479b3e936f9fb7eba5d8cbf2aad38218113cb51cfde35dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.
Transparency logRelease files / breakscope-1.3.0-py3-none-any.whl
| Download URL | breakscope-1.3.0-py3-none-any.whl |
|---|---|
| Size | 81.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
70dfff23e1fff9c2b12fdbc9186944fd3af0cf216bce3444b1587ff13d75e3bd
|
|
BLAKE2b-256 checksum How to use checksums |
275e3392d83a4ee9c1dd659c3bed21d1cb971cfde59d1e146cc0f972f2193adf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.
Transparency logSecurity for breakscope 1.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for breakscope-1.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.