Documentation
Everything you need to get started with CodeRifts — from one-click install to full configuration reference.
Prefer to ask instead of read? Our docs are queryable by agents via MCP - see the Agents page.
Start here
Three things people arrive wanting to do. Each card names the page that answers it, and the scope that page states for itself.
Gate a merge
What change stops or asks for approval?
Make the Check Block a Merge →
Scope: failing the check only stops a merge when branch protection is set up correctly.
Guard an agent action
What happens before the agent mutates?
Agent Quickstart →
Scope: prevents the call when it goes through the returned tool table — wired guard path only.
Verify a receipt
How do I check what the system claims?
Portable Proof of Authorization →
Scope: you must distinguish “signature ok” from “currently authorized”.
Everything each capability does — and does not — is listed under Capabilities.
Run it — for operators
You already installed it. These are the pages you need when you are the one on call for it.
Posture
Where does it report, and where does it prevent?
Enforcement status — coderifts status / coderifts enforce →
Scope: reporting and prevention are different states; the page names which surface is in which.
Surfaces
Which surface actually enforces, and on what default?
Platform truth table →
Scope: derived cells come from code; the prose rows carry their own review date.
CI / CD
What stops a deploy, and how do I soften it?
Deploy gate →
Scope: fail-closed by default; the opt-out is an environment variable, not a flag.
Keys
What happens to old receipts when a key rotates?
Portable verification — key registry →
Scope: rotation is append-only — retired keys stay listed so old receipts still verify.
Incident and compliance material lives in the Trust Center.
Quick Start
Get CodeRifts running in 30 seconds:
Install the GitHub App → Install on GitHub
Open a pull request that modifies an OpenAPI spec file
CodeRifts automatically posts a governance report as a PR comment
That's it. No config file needed. No CI setup. No API keys.
Want to see what a report looks like? Check the live demo PR.
Make the Check Block a Merge
Quick Start gives you a report (a PR comment and a check run). This section is what turns that report into a gate. They are different things: a team can stop after Quick Start and use CodeRifts for visibility only. For the same honesty across every path (runtime guard, contract-gate, MCP tools, CLI), see What each path does — and does not.
If you want the check to stop a merge, all four of the following must hold. Missing any one of them leaves you with a green or advisory check that does not protect the branch. See the Platform truth table — what actually enforces, where and What each proof proves — and what it does not.
BLOCK remediation transaction — what re-submission means
Endpoint criticality weight — surface outsized downstream impact
Deploy gate — advisory reporting and opt-in enforcement
Enforcement status — see reporting and prevention posture
MCP poison-risk assessment — flag risky tools for review
Execution attestations — CAS and remediation-loop proofs, and their limits
Require the status check in branch protection for your base branch (e.g. main). The context name is CodeRifts — API Contract Check (an em dash — U+2014 — between “CodeRifts” and “API”, not a hyphen; a typed - will never match).
If missing: a red CodeRifts check is advisory only — GitHub still allows the merge.
You may also see CodeRifts / contract-gate on the same PRs: that is an additional advisory check and does not block merges today — do not require it as your gate.
Bind the check to the CodeRifts GitHub App (app_id: 2860592). Name-only matching is not enough: with app_id: null, any writer with repository write access can post a success status under that context name and satisfy the requirement.
If missing: the gate is a decoration — a forged or accidental success status unblocks the merge while the App’s real check may still be red or pending.
Example (replace OWNER, REPO, and the branch name). This sets required checks with the App bound:
gh api \
--method PUT \
-H "Accept: application/vnd.github+json" \
/repos/OWNER/REPO/branches/main/protection/required_status_checks \
-f strict=true \
--input - <<'EOF'
{
"strict": true,
"checks": [
{
"context": "CodeRifts — API Contract Check",
"app_id": 2860592
}
]
}
EOF
You can also set the same checks array in the GitHub UI under branch protection → require status checks, choosing the CodeRifts App entry when GitHub offers it.
Ship a schema CodeRifts can analyse (OpenAPI/Swagger on a discovered path, or paths listed in .coderifts.yml).
If missing: the check completes neutral. GitHub treats neutral as non-blocking, so a required check can stay green while inspecting nothing.
Include administrators in branch protection (enforce_admins), if admins must not bypass the gate.
If missing: repository admins can merge past a red required check.
Reporting without these steps is a valid setup. Add them only when you want CodeRifts to be a merge gate, not only a PR report.
What Gets Analyzed
CodeRifts triggers automatically when a pull request modifies files matching these patterns:
| Pattern | Example |
|---|---|
**/openapi*.yaml | openapi.yaml, api/openapi-v2.yaml |
**/openapi*.json | openapi.json, docs/openapi-spec.json |
**/swagger*.yaml | swagger.yaml, api/swagger-v1.yaml |
**/swagger*.json | swagger.json |
You can also define custom patterns in .coderifts.yml using the schema or spec_patterns fields (see Configuration).
Supported Formats
- OpenAPI 2.0 (Swagger)
- OpenAPI 3.0
- OpenAPI 3.1
- Both YAML and JSON formats
Understanding the Report
Every PR comment from CodeRifts includes several sections. Here's what each one means:
Decision Model (Decision Spec 2.0)
CodeRifts uses a mode-discriminated union to categorize results. The primary branch is the analysis_outcome, which classifies the risk detected under the supplied evidence (analyze mode — informational, never permission).
| Outcome | Description |
|---|---|
| NO_BREAK_DETECTED | No configured blocking signal was detected. |
| BREAKS_DETECTED | One or more breaking changes or policy violations were identified. |
| ANALYSIS_FAILED | The analysis could not be completed (e.g., malformed spec). |
On authorize responses only, the execution_action drives the control flow (analyze responses omit this field entirely):
| Action | Meaning |
|---|---|
| CONTINUE | Proceed with the operation. |
| CONTINUE_WITH_MONITORING | Proceed but alert monitoring sinks. |
| REQUEST_APPROVAL | Pause for human sign-off. |
| STOP | Do not proceed; the change is blocked. |
The risk_score (0–100) continues to be reported as a composite metric of the change's impact, but is no longer the primary branching logic. For the full technical contract, see the Decision Spec 2.0 documentation.
Breaking Changes Table
Lists every breaking change detected, including:
- The change type (endpoint removed, field type changed, required field added, etc.)
- The affected endpoint and path
- A risk label per change (when risk scoring is enabled)
- A lifecycle label showing whether the element is new, deprecated, or removed
Policy Violations
If you have analyzer policies in .coderifts.yml, this section shows which rules were violated (see also Two policy mechanisms):
- Endpoint deletion blocked —
no_deletepaths were removed - Breaking budget exceeded — more breaking changes than
breaking_budgetallows - Freeze window active — breaking changes during a configured freeze period
- Version bump required — breaking changes without a semver bump in the spec
- Unsafe migration gated — MigraGuard (opt-in) reads database migration files and the source references they touch, in memory and never persisted, and blocks a destructive migration before it merges
Security Analysis
Scans for security-sensitive changes:
- Authentication scheme changes
- New endpoints without security definitions
- Sensitive field exposure (passwords, tokens, SSNs, etc.)
- CORS or rate-limit configuration changes
Semver Suggestion
Recommends a semantic version bump based on the changes detected:
- MAJOR — breaking changes found
- MINOR — new endpoints or fields added (backward-compatible)
- PATCH — documentation or metadata changes only
API Changelog
An auto-generated changelog grouped by: breaking, added, changed, and deprecated. Copy-paste ready for your release notes.
See all of these sections in action on the live demo PR.
Two policy mechanisms
CodeRifts ships two different policy files. They use different paths and different syntax. They do not replace each other. The first thing to learn is which file you are editing — and which one can stop a merge.
| File | Who reads it | Stops a merge? |
|---|---|---|
.coderifts.ymlrepo root |
Analyzer / governance policy engine (with the rest of the App config) | Can. A blocking policy violation feeds the check outcome. The check only blocks a merge when it is a required status check under the conditions in Make the Check Block a Merge — a policy alone is not a branch-protection setting. |
.github/api-policy.yamlunder .github/ |
Webhook handler (PR comment path) | No. Outcome is rendered into the PR comment only. It does not drive the merge check by itself. |
1. .coderifts.yml — analyzer policy (can fail the check)
This is the repository config file already described in the Configuration Reference below. Policy lives under the policy object (and related top-level keys such as breaking_budget / fail_on_breaking). The analyzer evaluates it when scoring a PR; blocking violations show up as Policy Violations in the comment and can fail the GitHub check.
Keys documented on this site for governance-style rules include (non-exhaustive; see the full example under Configuration):
breaking_budget— max breaking changes allowed per PRfail_on_breaking— whether breaking changes fail the checkpolicy.no_delete— path patterns where endpoint deletion is blockedpolicy.no_delete_required_fieldspolicy.require_deprecation_before_removalpolicy.freeze— start / end / reason freeze windowpolicy.require_version_bumppolicy.freeze_on_risk_scorepolicy.freeze_hard_block— boolean, defaultfalse: during a freeze window a breaking change returns BLOCK instead of REQUIRE_APPROVALpolicy.freeze_on_risk_score_hard_block— boolean, defaultfalse: a risk-score freeze returns BLOCK instead of REQUIRE_APPROVAL
Important: failing the check only stops a merge when branch protection is set up correctly. That is not restated here — use Make the Check Block a Merge.
2. .github/api-policy.yaml — comment policy DSL (does not stop a merge)
A second file, under .github/, not the repo root. It is a separate DSL (not the policy: object in .coderifts.yml). The webhook path loads it and uses the result when building the PR comment.
What it does with the outcome: annotation only — it contributes to what you read on the pull request. It does not replace analyzer policy and does not, by itself, fail the required status check or block a merge.
Accepted keys (measured from the running App's parser): the reference below was read out of the production parser, not invented. Anything not listed is loaded by YAML but ignored — do not document extra keys as accepted.
Document (top-level)
| Key | Required | Accepted values |
|---|---|---|
version | yes | number 1 (strict — the string "1" is rejected) |
rules | yes | non-empty array |
policy.default_action | no | block | require_approval |
rules[] entry
| Key | Required | Accepted values |
|---|---|---|
id | yes | any non-empty value (no format check) |
condition | yes | see condition forms below |
action | yes | block | require_approval | warn | allow |
When several rules trigger, the strictest action wins: block > require_approval > warn > allow. Keys such as policy.dry_run, schedule and approvers are not validated by the parser — their behavior is intentionally left undocumented here.
Condition forms
A condition is accepted only if its first token is one of: endpoint_removed, risk_score, breaking_changes, omega_api, reflex_override. Two forms evaluate:
- Boolean, exact whole string:
endpoint_removedorreflex_overridealone - Numeric comparison:
FIELD OP NUMBERwith>=<=><==!=, e.g.risk_score >= 80
Minimal valid example
version: 1
rules:
- id: block-endpoint-removal
condition: endpoint_removed
action: block
- id: warn-high-risk
condition: risk_score >= 80
action: warn
policy:
default_action: block
Do not invent condition strings or actions beyond the tables above — a wrong copy-paste example is worse than none.
Do not confuse it with the homepage “Governance as code” snippet if you have seen a rules: / condition: / action: block labeled as .coderifts.yml — that labeling is wrong. Analyzer policy for merge-relevant blocking lives in .coderifts.yml under policy (and related keys in the Configuration Reference).
Test a policy before committing
The policy simulator dry-runs a policy document against a hypothetical change without touching a pull request. Use it to test a policy document before committing it.
Endpoint: https://app.coderifts.com/api/v1/policy-simulator. An API key is required. The accepted policy keys are the ones in the reference above.
Configuration Reference
All settings are optional. CodeRifts works without a config file. To customize behavior, create a .coderifts.yml file in the root of your repository. For how this file differs from .github/api-policy.yaml, see Two policy mechanisms first.
# .coderifts.yml — Full Configuration Reference
# All settings are optional. CodeRifts works without this file.
# ─── Schema Paths ─────────────────────────────────────────────
# Explicit paths to your OpenAPI spec files.
# If omitted, CodeRifts auto-discovers using default glob patterns.
schema:
- openapi/api.yaml
- docs/swagger.json
# Custom glob patterns for spec file discovery (optional)
spec_patterns:
- "**/api-spec*.yaml"
- "docs/openapi/**"
# ─── Breaking Change Budget ───────────────────────────────────
# Maximum allowed breaking changes per PR (default: unlimited)
breaking_budget: 3
# Fail the GitHub check when breaking changes are found (default: true)
fail_on_breaking: true
# ─── Policy Rules ─────────────────────────────────────────────
policy:
# Paths where endpoint deletion is blocked
no_delete: ["/payments/*", "/auth/*"]
# Block deletion of required fields
no_delete_required_fields: true
# Require deprecation before removal
require_deprecation_before_removal: true
# Freeze window — block breaking changes during this period
freeze:
start: "2026-03-01"
end: "2026-03-15"
reason: "Q1 release freeze"
# Require semver bump when breaking changes are detected
require_version_bump: true
# Auto-trigger freeze when risk score exceeds threshold (0-100)
freeze_on_risk_score: 80
# ─── Domain Ownership ─────────────────────────────────────────
# Map API paths to teams for accurate risk scoring
domains:
- name: payments
paths: ["/payments/*"]
owners: ["@payments-team"]
sensitivity: critical
- name: users
paths: ["/users/*", "/auth/*"]
owners: ["@platform-team"]
sensitivity: high
# ─── Security Analysis ────────────────────────────────────────
security:
# Additional patterns to flag as sensitive (regex)
sensitive_patterns: ["ssn", "tax_id", "passport"]
# Fail the check on critical security findings
fail_on_critical: true
# ─── Notifications ────────────────────────────────────────────
# Send alerts to Slack and/or Microsoft Teams
notifications:
on: breaking # Options: breaking (default), all, high_risk
slack:
webhook_url: "https://hooks.slack.com/services/..."
teams:
webhook_url: "https://outlook.office.com/webhook/..."
mute: # Repos to exclude from notifications
- "internal-tools"
# ─── Schema Overlap Detection ─────────────────────────────────
# Warn when other open PRs modify the same spec files (Pro only)
overlap_detection: true
overlap_ignore_branches:
- "dependabot/*"
- "renovate/*"
# ─── Risk Scoring Weights ─────────────────────────────────────
# Customize the weight of each risk dimension (must sum to 1.0)
risk_weights:
revenue_impact: 0.3
blast_radius: 0.3
compatibility: 0.2
security: 0.2
# ─── Comment Mode ─────────────────────────────────────────────
# "full" shows all sections inline; "summary" collapses details
comment_mode: full
# ─── Fun Mode ─────────────────────────────────────────────────
# Adds a haiku to the PR comment based on the analysis
fun_mode: true
Option Reference
| Option | Type | Default | Tier | Description |
|---|---|---|---|---|
schema | string[] | auto-discover | Free | Explicit paths to OpenAPI spec files |
spec_patterns | string[] | built-in globs | Free | Custom glob patterns for spec discovery |
fail_on_breaking | boolean | true | Free | Fail the GitHub check on breaking changes |
breaking_budget | number | unlimited | Free | Max breaking changes allowed per PR |
policy | object | all disabled | Pro | Governance policy rules |
domains | object[] | heuristic | Pro | Map API paths to teams for risk scoring |
security | object | defaults | Pro | Security analysis configuration |
notifications | object | disabled | Free | Slack/Teams webhook notifications |
overlap_detection | boolean | true | Pro | Warn when other PRs modify same specs |
overlap_ignore_branches | string[] | [] | Pro | Branch patterns to exclude from overlap check |
risk_weights | object | equal weights | Pro | Customize risk dimension weights |
comment_mode | string | full | Free | full or summary |
fun_mode | boolean | false | Free | Adds a haiku to the PR comment |
Delivery Channels
CodeRifts is available through 4 channels. Choose the one that fits your workflow:
| Channel | Best For | Status | Link |
|---|---|---|---|
| GitHub App | Primary use — automatic PR analysis | Available | Install |
| Web UI | Try without installing — paste a spec URL | Available | Try Now |
| REST API | CI/CD integration — programmatic access | Available | API Reference |
| CLI | Local analysis — run from your terminal | Available | npm package |
Capabilities
Every shipped capability page, in one place. Each states what it does and where it stops — link text is each page’s own title and first heading, not a summary written here.
Report vs prevent
- What each path does — and does not
- Platform truth table — what actually enforces, where
- What each proof proves — and what it does not
Gates and outcomes
- Deploy Gate — Deploy gating reports by default. Enforcement is opt-in.
- Enforcement Status — See where your posture reports — and where it prevents.
- Remediation Transaction — A BLOCK is not a dead end.
Proofs and signals
- Execution Attestations — CAS attestation and remediation-loop attestation
- Endpoint Criticality Weight — See the changed endpoints with outsized downstream impact.
- MCP Poison-Risk Assessment — Flag MCP tools that deserve review.
Agent surface
- Agent Onboarding — From keyless discovery to receipt-gated governance
- Agent Contract Lockfile — Lock the observed agent-contract surface.
- Execution Proof — A final answer can carry its own execution proof.
FAQ
Does CodeRifts read my source code?
No. CodeRifts only reads OpenAPI spec files (YAML/JSON). It does not access, analyze, or store your application source code, tests, or any other files.
What permissions does it need?
| Permission | Level | Why |
|---|---|---|
| Contents | Read | Read OpenAPI spec files from your repository |
| Pull Requests | Write | Post the governance report as a PR comment |
| Checks | Write | Create a check run with pass/fail status |
| Metadata | Read | Required by GitHub for all App installations |
Is it free?
Yes. The Free tier includes unlimited public repositories and up to 3 private repositories. All Pro features (risk scoring, governance, security analysis, deprecation enforcement) are included free during the beta. See pricing.
What happens if my spec file is not in the root directory?
CodeRifts auto-discovers spec files using glob patterns that search all directories. If your file is at api/v2/openapi.yaml, it will be found automatically. You can also configure explicit paths in .coderifts.yml:
schema:
- api/v2/openapi.yaml
- docs/swagger.json
Can I use it with GitLab or Bitbucket?
The GitHub App is GitHub-only. However, the REST API and CLI work with any Git platform. You can integrate them into GitLab CI, Bitbucket Pipelines, or any CI/CD system.
How do I disable it for a specific PR?
Add [skip coderifts] to the PR title. CodeRifts will skip the analysis entirely for that PR.
Where is the API Reference?
The interactive API reference (Swagger UI) is available at app.coderifts.com/api/docs.
Ready to get started?
Install CodeRifts in one click and get your first governance report on the next PR.