Automating OpenAPI Breaking-Change SemVer Gates & SARIF 2.1.0 in CI/CD
Block accidental API breaking changes, unauthenticated routes, and OWASP API Top 10 regressions directly on GitHub Pull Requests using deterministic SemVer diff gates, SARIF 2.1.0 code-scanning uploads, and Apify/MCP automation.
# OpenAPI OWASP API Top 10 & MCP Readiness PR Checklist — CI-Gated Platform API
- **Score:** 100/100 (Grade A) — **HARDENED — OWASP & MCP READY**
- **Target Standard:** OpenAPI 3.1.0
- **Endpoints Modeled:** 16 ops (~2,128 MCP pre-prompt tokens/turn · $9.58/mo at 50 turns/day on $3/1M)
- **Reclaimable MCP Schema Diet:** 288 tokens/turn ($1.30/mo saved)
## Security & Schema Review Checklist
- [x] **API2-AUTH (OWASP API2:2023)** — Explicit components.securitySchemes (Bearer JWT / OAuth2 scopes) + global/op security
- Bearer JWT / OAuth2 securitySchemes and security[] requirements are enforced.
- [x] **API1-BOLA (OWASP API1:2023)** — Object-ID routes ({id}) enforce explicit 401/403 responses & tenant ownership scopes
- Parameterized {id} endpoints verify tenant ownership and document 401/403 status codes.
- [x] **API3-BOPLA (OWASP API3:2023)** — additionalProperties: false + readOnly: true on server-owned fields (role, id, plan)
- Request schemas lock additionalProperties: false and protect server fields with readOnly: true.
- [x] **API4-BOUNDS (OWASP API4:2023)** — maxLength, maxItems, maximum & bounded pagination (limit <= 100 / cursor) on inputs
- Strings, arrays, and pagination limits define strict maxLength, maxItems, and maximum bounds.
- [x] **API8-TLS (OWASP API8:2023)** — HTTPS-only servers[] URLs (zero http:// prod) + strict CORS allowlist & headers
- Production servers[] enforce HTTPS-only URLs and strict origin allowlist CORS.
- [x] **API4-429 (OWASP API4 / API8)** — Explicit 401, 403 & 429 Too Many Requests responses with Retry-After / X-RateLimit-*
- 401, 403, and 429 Too Many Requests responses include Retry-After / X-RateLimit-* headers.
- [x] **API9-INV (OWASP API9:2023)** — Versioned base paths + deprecated: true ops declare Sunset header & replacement path
- Deprecated endpoints publish Sunset headers and migration paths; zero shadow APIs.
- [x] **MCP-TOKEN (AI / MCP Readiness)** — Concise tool descriptions (<= 120 tok/op) & OpenAPI 3.1 type arrays (no nullable: true)
- Operation descriptions stay lean (~38 tok/op) and OpenAPI 3.1.0 avoids nullable drift.
## Automated Verification & Done-For-You Remediation
- Free Zero-Upload OpenAPI Diff & OWASP Audit: https://spec.runglab.dev
- $49 Done-For-You OpenAPI & MCP Remediation PR (Creem): https://www.creem.io/product/prod_4KoVJW4YEAf6XjjuSK44lp
- RapidAPI Live Endpoint (`POST /v1/openapi/audit`): https://hub.runglab.dev
- Remote MCP Tool (`audit_openapi_spec`): https://mcp-server.runglab.dev/
- Apify Cloud PPE Actor: https://apify.com/runglab/openapi-spec-diff-auditor
Zero-Upload SpecDiff$49 Remediation PR
Audit Full OpenAPI Specs or Ship a Hardened PR Today
Run a 100% browser-side breaking-change diff, OWASP API Top 10 scan & SARIF 2.1.0 export on SpecDiff (https://spec.runglab.dev), order a $49 Done-For-You OpenAPI & MCP Remediation PR on Creem, or automate via POST /v1/openapi/audit (API Hub), remote MCP tool audit_openapi_spec, and Apify Cloud PPE.
Export SARIF 2.1.0 Locally or Automate via Apify PPE
run-specdiff-apify.txt
# Option A (Zero-Upload Browser Export):
# Open https://spec.runglab.dev -> Paste Base + Head OpenAPI specs -> Download SARIF 2.1.0
#
# Option B (Apify Cloud PPE Actor for Scheduled Repo Sweeps):
# https://apify.com/runglab/openapi-spec-diff-auditor
#
# Option C ($49 Done-For-You OpenAPI & MCP Remediation PR):
# https://www.creem.io/product/prod_4KoVJW4YEAf6XjjuSK44lp
Key Engineering Takeaways
Catching OpenAPI breaking changes and OWASP API1–API9 regressions in PR review costs minutes; discovering them after publishing broken SDKs or leaked tenant routes costs weeks.
SARIF 2.1.0 integrates natively into GitHub Code Scanning alerts and PR annotations without proprietary dashboards.
Combining SpecDiff's zero-upload browser workbench for local iteration with automated CI checks (`POST /v1/openapi/audit` or `audit_openapi_spec` MCP) keeps API contracts and MCP tool schemas continuously synchronized.
Common Contract Pitfalls to Avoid
Treating OpenAPI files as hand-edited marketing docs that drift away from production routes and CI validation.
Ignoring MINOR vs MAJOR contract breaks when tightening optional fields to `required: true` or renaming enum values.
Failing to gate PRs on `http://` server regressions or newly added endpoints lacking `securitySchemes`.
How to detect Broken Object Level Authorization (OWASP API1:2023) blindspots across {id} routes in OpenAPI 3.0/3.1 specs using explicit security scopes, tenant path bindings, and mandatory 401/403 contracts.
Close OWASP API3:2023 Broken Object Property Level Authorization (BOPLA) and Mass Assignment gaps by enforcing additionalProperties: false, readOnly server attributes, and strict request DTOs.
What breaking changes does a SemVer OpenAPI diff catch automatically?
Endpoint removals, HTTP method removals, new required request properties or parameters, narrowed enums/bounds, removed success status codes, and altered response property types.
Does SpecDiff export SARIF 2.1.0 locally without sending proprietary schemas to a server?
Yes — https://spec.runglab.dev runs 100% in your browser and exports SARIF 2.1.0 directly with zero server upload.
How can AI coding assistants check OpenAPI changes before opening a PR?
Connect the Official MCP Registry server `dev.runglab/devtools` (`https://mcp-server.runglab.dev/`) and call `audit_openapi_spec` right inside Cursor, VS Code, or Claude Desktop.