Skip to main content
OpenAPI 2.0 · 3.0 · 3.1

OpenAPI Diff Tool — Detect Every Change, Automatically

Compare any two OpenAPI specifications and get a categorized report of the breaking changes, deprecations, and schema modifications it detects — in seconds.

Format coverage, read 2026-10-04, is the table on the documentation page. An incomplete analysis in authorize mode is ANALYSIS_FAILED and STOP, with the gap named.

What the Diff Engine Detects

CodeRifts goes far beyond a simple text diff. It understands the semantics of your OpenAPI specification and categorizes every change by type and severity.

9 Breaking Change Types

  • ✕ Endpoint removed
  • ✕ Required request field added
  • ✕ Response field removed
  • ✕ Response type changed
  • ✕ Authentication scheme changed
  • ✕ Request body format changed
  • ✕ Path parameter renamed
  • ✕ Required header added
  • ✕ Default value changed

Non-Breaking Changes

  • ✓ New endpoint added
  • ✓ Optional request field added
  • ✓ New response field added
  • ✓ Description updated
  • ✓ New optional header

CodeRifts also detects deprecations, security changes, and documentation drift, showing you what changed and why it matters.

Enum changes, by direction

Ruleset enum-direction/2026-10-03. Removing one enum bullet from the lists above is not the rule. The rule is these four rows.

Side Change Result
RequestValue removedBreaking
RequestValue addedNot breaking
ResponseValue removedNot breaking. Kept as INFO.
ResponseValue addedBreaking. Decision REQUIRE_APPROVAL, not BLOCK.

The same enum in both directions is judged twice, and the stricter result decides. A readOnly field counts only on the response side. x-extensible-enum means a response addition needs no approval. A new response field is a different claim and stays in the non-breaking list above.

Security changes the semver will not tell you about

Removing an OAuth scope is a breaking change for every consumer that relied on it - their calls start returning 403 while the version number stays green. CodeRifts detects scope removals, security-scheme downgrades (OAuth2 replaced by an API key), and deleted security scheme definitions, and folds them into the risk verdict.

Why Automated OpenAPI Diffing Matters

Manually comparing two versions of an OpenAPI specification is not only tedious but also highly error-prone. As APIs evolve, their specifications can grow to thousands of lines, with complex interdependencies managed through $ref components. A simple text-based diff, like the one you might see in a Git commit, is insufficient because it fails to understand the semantic meaning of the OpenAPI structure.

Automated tooling is essential for managing this complexity. A purpose-built OpenAPI diff tool doesn't just compare text; it parses the specification, resolves all references, and understands the hierarchical structure of the API contract. For example, changing a property from optional to required within a referenced schema is a significant breaking change, but it might appear as a minor, one-word alteration in a text file.Without an automated, semantically-aware diff, teams risk shipping breaking changes unknowingly.

How CodeRifts Performs the Diff

CodeRifts parses both the old and new OpenAPI specifications (2.0, 3.0 or 3.1) and diffs a fixed set of fields. Local #/ references are inlined, allOf is flattened (last definition wins), and oneOf/anyOf are sorted rather than merged. An OpenAPI 3.1 webhook is diffed in the inverted direction, so authorize returns ANALYSIS_FAILED and STOP with the gap named. A changed or removed callback, or a switched or removed external or remote $ref, is the same decision. A 3.1 spec is diffed as written, the 3.0.3 conversion runs only when oasdiff did not answer, and dependentRequired is REQUIRE_APPROVAL with one breaking change.

Once the specs are fully resolved, CodeRifts performs a semantic comparison of the two structures. It categorizes every detected change—from a removed endpoint to a modified response schema—according to its severity: breaking, non-breaking, or deprecation. Each change is then assigned a risk score based on factors like the type of change and its potential impact on consumers. The final output is a rich, interactive report that helps teams make informed decisions.

Use Cases

CI/CD Pipelines

By incorporating CodeRifts into your Continuous Integration and Continuous Deployment (CI/CD) pipeline, you can automatically fail builds that introduce high-risk or unauthorized breaking changes. You can use our CLI or REST API to add a diff check as a required step in your deployment workflow.

Pre-Merge Checks

With the CodeRifts GitHub App, every pull request that modifies an OpenAPI file gets an automatic check. A detailed comment is posted directly on the PR, showing a summary of the changes and a link to the full diff report. This enables developers and reviewers to understand the impact of their changes before they are merged.

API Versioning Strategy

Automated diffing is fundamental to a sound API versioning strategy. By understanding the nature of every change, you can make deliberate decisions about when to release a new minor version (for non-breaking, backward-compatible changes) versus a new major version (for breaking changes).

Migration from Swagger to OpenAPI 3.x

Upgrading a legacy Swagger 2.0 specification to OpenAPI 3.0 or 3.1 can be a complex process with many potential pitfalls. Using the CodeRifts diff tool, you can compare your old Swagger file with the newly converted OpenAPI 3.x file to verify that the API's contract has not been unintentionally altered during the migration.

Three Ways to Diff

🌐

In-Browser

Upload two specs to app.coderifts.com/try and get a full report instantly. No signup required.

🔧

On Every PR

Install the GitHub App and CodeRifts automatically diffs your OpenAPI specs on every pull request. Zero config.

⚡

Via API or CLI

Use the REST API or CLI to integrate diff into any CI/CD pipeline, pre-commit hook, or custom workflow.

Diff OpenAPI Specs from Code or an AI Agent

Beyond the browser, the PR, and CI: you can run a full diff verdict programmatically with no API key. This is also how an AI agent checks an API change before it acts on it.

Send two specs to the zero-auth endpoint and get a single structured verdict back — no signup, no key:

curl -s -X POST https://app.coderifts.com/api/v1/demo \
  -H "Content-Type: application/json" \
  -d '{"old_spec": "<your previous OpenAPI>", "new_spec": "<your current OpenAPI>"}'

This is the zero-auth POST /api/v1/demo surface, not MCP authorize. The demo body includes decision (ALLOW / WARN / BLOCK) as explanation. Agents that need permission must call authorize and branch on execution_action (CONTINUE | CONTINUE_WITH_MONITORING | REQUEST_APPROVAL | STOP).

To turn that verdict into a one-line guardrail inside an agent, use the zero-config decorator. It has no dependencies beyond the Python standard library, it is framework-agnostic (LangGraph, AutoGen, or a plain function), and it caches the verdict per spec pair:

# coderifts_decorator.py is vendored from github.com/coderifts/agent-guard
# (examples/langgraph-guard-python/) — it is not published on PyPI; copy the file in.
from coderifts_decorator import coderifts_guard, CodeRiftsBlocked

@coderifts_guard(old_spec=previous_openapi, new_spec=current_openapi)
def run_agent_step(payload):
    # Runs only if CodeRifts does not return BLOCK.
    # On BLOCK it raises CodeRiftsBlocked before any side effect.
    return call_downstream_api(payload)

If the change would break a downstream contract, the decorator raises CodeRiftsBlocked and the agent halts before the unsafe call runs. The full runnable reference implementation — decorator plus an explicit LangGraph guard node — is an archived historical sample (last updated 2026-08-25); the maintained middleware is agent-guard. The sample is at github.com/coderifts/example-langgraph-guard.

Diff OpenAPI Specs from Claude, Cursor, or Any MCP Agent

CodeRifts runs as a hosted Model Context Protocol (MCP) server, so any MCP-compatible agent — Claude Desktop, Cursor, LangGraph, AutoGen, or a custom client — can diff two OpenAPI specs and get a governance verdict before it merges a change or calls a tool. No integration code: connect the server and the agent gets the diff tools natively.

Point any MCP client at the hosted endpoint and authenticate with a Bearer API key:

{
  "mcpServers": {
    "coderifts": {
      "url": "https://app.coderifts.com/mcp",
      "headers": { "Authorization": "Bearer <YOUR_CODERIFTS_API_KEY>" }
    }
  }
}

The agent gets governance tools natively: preflight_change_set returns the Decision Spec governance envelope — branch on execution_action (CONTINUE | CONTINUE_WITH_MONITORING | REQUEST_APPROVAL | STOP; unrecognised values fail closed). decision (ALLOW / WARN / REQUIRE_APPROVAL / BLOCK) is explanation, not the branch key. verify_receipt returns a receipt-verification result (valid, status, currently_authorized); get_decision_details returns a stored decision envelope plus retrieval metadata. The three tools do not share one response shape. Additional governance operations are available over the separate REST API.

The endpoint is Streamable HTTP (protocol 2025-06-18) and is listed on the Official MCP Registry as io.github.coderifts/api-governance. For a one-click connect, the full tool list, and a copy-paste config, see the machine-readable page at coderifts.com/for-agents, or the MCP manifest.

More Than a Diff — A Full Governance Report

Every diff includes risk scoring, a policy decision (ALLOW / WARN / REQUIRE_APPROVAL / BLOCK), security analysis, and an auto-generated changelog. It's not just what changed — it's whether you should ship it.

📊

Risk Score

Every change gets a 0–100 risk score based on severity, blast radius, and affected consumers.

🛡️

Policy Engine

Enforce naming conventions and versioning rules automatically.

🔒

Security Analysis

Detect authentication downgrades, exposed sensitive fields, and OWASP API risks.

📝

Auto-Changelog

Get a human-readable changelog generated from the diff — ready for release notes.

Raw Diff Tools vs CodeRifts

Raw diff tools like oasdiff and the openapi-diff CLI give you the delta. CodeRifts adds a governance layer that decides whether the change is safe to ship.

Tool Approach Setup Governance
Raw diff CLIs (oasdiff, openapi-diff) Raw structural diff plus a breaking or non-breaking classification Assemble your own CI pipeline None - the delta only
CodeRifts Diff plus a decision on whether the change is safe to ship Zero-config GitHub App PR comment 0-100 risk score, policy decision (ALLOW / WARN / REQUIRE_APPROVAL / BLOCK), OWASP-aligned security analysis, auto-generated changelog

Verified finding

The diff verdict is cryptographically signed — verify it, don't just trust us. On the public demo pull request coderifts/demo#4 (2026-07-21), CodeRifts issued a deterministic BLOCK on 3 breaking changes and signed the verdict as an Ed25519 receipt.

  • Verdict fingerprint: sha256:70699341…cfec
  • Change IR hash: sha256:f3de7721…a334
  • Receipt key / issued: 2026-07-k1 · 2026-07-21

The receipt is in the PR comment. Verify the receipt yourself — offline, no live CodeRifts API call needed.

Live demo PR · Open-source verifier · Receipt format

Frequently Asked Questions

What is an OpenAPI diff?

An OpenAPI diff (or differential) is the result of comparing two versions of an OpenAPI specification to identify all the changes between them. Unlike a simple text diff, a proper OpenAPI diff tool understands the structure and semantics of the specification. It can pinpoint specific changes like a removed endpoint, a modified data type, or a new required parameter, and classify them as breaking or non-breaking.

How do I compare two OpenAPI specs?

You can compare two OpenAPI specs using a specialized tool like CodeRifts. You can use our free in-browser tool by simply uploading your two specification files. For a more automated workflow, you can integrate our GitHub App to get a comparison on every pull request, or use our CLI or REST API to run a comparison in your own scripts or CI/CD pipelines.

What counts as a breaking change?

A breaking change is any modification to an API contract that can cause existing client applications to fail. Common examples include removing an endpoint, adding a new required request parameter, removing a field from a response, or changing the data type of a field. CodeRifts maintains a comprehensive list of over 10 common breaking change types that it detects automatically.

Does CodeRifts support OpenAPI 3.1?

CodeRifts diffs OpenAPI 2.0, 3.0 and 3.1. An OpenAPI 3.1 webhook is diffed in the inverted direction, so authorize returns ANALYSIS_FAILED and STOP with the gap named. A changed or removed callback, or a switched or removed external or remote $ref, is the same decision. A 3.1 spec is diffed as written, the 3.0.3 conversion runs only when oasdiff did not answer, and dependentRequired is REQUIRE_APPROVAL with one breaking change.

Can I use this in CI/CD?

Absolutely. Integrating API diffing into your CI/CD pipeline is a best practice for preventing breaking changes from reaching production. CodeRifts provides both a CLI tool and a REST API that you can easily incorporate into your existing workflows, whether you use Jenkins, GitLab CI, CircleCI, or any other automation server. You can configure your pipeline to fail a build if a high-risk breaking change is detected.

Can I diff OpenAPI specs without an API key?

Yes. The in-browser tool at app.coderifts.com/try requires no signup, and the zero-auth endpoint POST /api/v1/demo returns a full diff verdict with no API key — useful for quick checks and for AI agents. For higher-volume or authenticated use, the REST API uses a free API key (free during beta, 1,000 requests a month).

How is CodeRifts different from oasdiff or the openapi-diff CLI?

oasdiff (a Go CLI by Tufin) and the openapi-diff npm and Java tools produce a raw structural diff and a breaking or non-breaking classification, which is excellent for CI pipelines you assemble yourself. CodeRifts adds a governance layer on top of the diff: a 0–100 risk score, a policy decision (ALLOW / WARN / REQUIRE_APPROVAL / BLOCK), OWASP-aligned security analysis, an auto-generated changelog, and zero-config delivery as a GitHub App PR comment. Use a raw diff tool if you only need the delta; use CodeRifts if you need a decision about whether the change is safe to ship.

Can an AI agent diff OpenAPI specs before acting on them?

Yes. CodeRifts serves a full diff verdict over a zero-auth endpoint (POST /api/v1/demo), and a zero-dependency @coderifts_guard decorator — vendored from coderifts_decorator.py in github.com/coderifts/agent-guard, not a PyPI package — turns that verdict into a one-line guardrail for LangGraph, AutoGen, or any Python agent. If a change would break a downstream contract, the agent halts before the unsafe call runs. Reference implementation: agent-guard (the earlier example-langgraph-guard sample is archived).

Can I connect CodeRifts to Claude or Cursor via MCP?

Yes. CodeRifts runs as a hosted MCP server at https://app.coderifts.com/mcp (Streamable HTTP). Add it to Claude Desktop, Cursor, or any MCP client and the agent can diff OpenAPI specs, score breaking-change risk, and get an authorize envelope. Branch on execution_action: CONTINUE, CONTINUE_WITH_MONITORING, REQUEST_APPROVAL, or STOP (unrecognised values fail closed). decision (ALLOW / WARN / REQUIRE_APPROVAL / BLOCK) is explanation, not the branch key. The one-click connect page and full tool list are at coderifts.com/for-agents.

What MCP tools does CodeRifts provide?

CodeRifts exposes exactly three MCP tools: preflight_change_set, verify_receipt, and get_decision_details. preflight_change_set returns the Decision Spec governance envelope — branch on execution_action (CONTINUE | CONTINUE_WITH_MONITORING | REQUEST_APPROVAL | STOP). verify_receipt returns a receipt-verification result (valid, status, currently_authorized). get_decision_details returns a stored decision envelope plus retrieval metadata. The three tools do not share one response shape — an agent must branch according to which tool it called. The REST API is a separate integration surface for additional governance operations. Full list and connect config: coderifts.com/for-agents.

Can I verify a CodeRifts verdict independently?

Yes. Every verdict is signed with Ed25519 and ships with a receipt. An open-source verifier (Node and Python, github.com/coderifts/receipt-verifier) checks the signature and chain linkage against the published public key — no trust in CodeRifts required. A live example is on the public demo PR.

Try the diff engine now — free.

Upload two OpenAPI specs and see the full report in seconds. No signup, no credit card.

See all 61+ features or compare pricing plans.

A diff tells you what changed. It does not tell you whether it may proceed.

How the gate decides