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
API IMPACT ANALYSIS
────────────────────────────────────────────────

BREAKING CHANGES: 4

1. User.name  (response.property.removed)
   A response property was removed. In GET /users, POST /users, GET /users/{userId}.

   Likely affected code:

   🔴 backend/services/user_report.py:12
      return resp.json()["name"]
                         ^^^^^^

   🔴 frontend/src/components/UserProfile.tsx:18
      <h1>{user.name}</h1>
                ^^^^

2. DELETE /users/{id}
   DELETE /users/{id} was removed  (endpoint.removed)

   Likely affected code:

   🔴 frontend/src/api/users.ts:22
      await axios.delete(API_URL + "/users/" + id);
...
────────────────────────────────────────────────
Files affected: 3
Locations affected: 4
Risk: HIGH

Try it on the demo:

breakscope analyze examples/demo/api/openapi-v1.yaml examples/demo/api/openapi-v2.yaml examples/demo

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:
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@v0.5.0
        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: v0.5: impact analysis, CI mode and the GitHub Action. Supports OpenAPI 3.0/3.1, Python, TypeScript and JavaScript. See the roadmap.

License

MIT

Metadata

Release files for breakscope 0.5.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 0.5.0
File Size Uploaded Provenance Actions
breakscope-0.5.0.tar.gz 82.6 kB With provenance Details for breakscope-0.5.0.tar.gz

Built distribution (wheel)

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

Total release size: 144.4 kB

Release files / breakscope-0.5.0.tar.gz

Download URL breakscope-0.5.0.tar.gz
Size 82.6 kB
Tags Source
SHA-256 checksum
How to use checksums
947b5bb5c228f0812c025f83087c539feea507c59726ffd11aa34821954712c2
BLAKE2b-256 checksum
How to use checksums
618f79dfba37a1d6dbdbaad1f062a00731b240e48da45f0dd34e599cbe56b3c6
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-0.5.0-py3-none-any.whl

Download URL breakscope-0.5.0-py3-none-any.whl
Size 61.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd68dfff9883f4885d185aacd4e172dd639b0bacf6b9e1dcbe27935464a37304
BLAKE2b-256 checksum
How to use checksums
64ae2cc8e4dbdc9adecae67340b9398f2b0b71176be7d77589031d173c70f3a6
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 0.5.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-0.5.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