Skip to main content

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

breakscope analyze output: User.name was removed, and two places read it: backend/services/user_report.py:12 and frontend/src/components/UserProfile.tsx:18

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. In GET /users, POST /users, GET /users/{userId}.

Location Code Confidence
🔴 frontend/src/components/UserProfile.tsx:19 <p>{user.email}</p> high

How it works

  1. Diff the two specs into direction-aware changes, each with the exact field path (User.name).
  2. Find call sites of every operation with tree-sitter: fetch, axios, Angular HttpClient, requests, httpx, aiohttp and custom clients.
  3. Trace the response through await, .data, .json(), .then(), destructuring, .map()/for loops, RxJS pipe(map()) and React useState, and one hop across a function return.
  4. 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.

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

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for breakscope 1.1.0
File Size Uploaded Provenance Actions
breakscope-1.1.0.tar.gz 97.8 kB With provenance Details for breakscope-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for breakscope 1.1.0
File Interpreter ABI Platform Actions
breakscope-1.1.0-py3-none-any.whl Python 3 none any Details for breakscope-1.1.0-py3-none-any.whl

Total release size: 162.1 kB

Release files / breakscope-1.1.0.tar.gz

Download URL breakscope-1.1.0.tar.gz
Size 97.8 kB
Tags Source
SHA-256 checksum
How to use checksums
70e85d495a7224f6fc20aeb8ebf72770cf98821dc15fb33c377c77661718be43
BLAKE2b-256 checksum
How to use checksums
dec6e19913cf58c5beeb4c3de1748665426f26f7d8d54ecd63d7a76458654bc2
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 log

Release files / breakscope-1.1.0-py3-none-any.whl

Download URL breakscope-1.1.0-py3-none-any.whl
Size 64.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ba8bbe6a26f72328b77b7b2e35011746963b60f51e70a428be540cdec093aa58
BLAKE2b-256 checksum
How to use checksums
c3494305fcb74f90c47c0ff59e1f026b4f73edcba823a07c12849be2878ab1bd
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 log

Security for breakscope 1.1.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.

Select from 2 files

Attestation for breakscope-1.1.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 log

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

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page