Your API changed.
Your SDK didn’t.
Catch API drift in the pipeline before it reaches your agents.
StateAnchor is a git-native, build-time enforcement layer that gates every push against your declared contract -- blocking drift before it reaches production.
The problem
APIs drift silently
Your spec says one thing. Your live service does another. Your generated SDK was built from last Tuesday’s commit. Nobody knows until something breaks in production.
How it works
From push to protected
Connect your repo
Add stateanchor.yaml to your repo. One authoritative source of truth for your API contract.
The gate runs
On each push, the gate diffs your spec against the prior snapshot and classifies every change into ERR / WARN / INFO lanes.
Artifacts regenerate
Gate passes → TypeScript, Python, Go SDKs and your MCP server rebuild. Gate blocks → the PR is stopped.
Two ways to use StateAnchor
Choose your starting point
Already using Speakeasy or Fern?
Add StateAnchor’s gate on top. Your existing SDK generation stays exactly as it is — we enforce the contract before the drift reaches it.
See gate-only pricing →Starting from scratch?
StateAnchor generates your typed SDKs and MCP server artifacts, then enforces their contract on every push.
See full pipeline pricing →GitHub Actions
One workflow file. Every breaking change caught.
Copy the workflow below into .github/workflows/stateanchor-gate.yml. StateAnchor gates every spec change from the first push.
Real-time gate results, the moment you push.
The gate
Three lanes. One decision.
Every change is classified before anything deploys. The lane drives the decision -- not a score, not a heuristic.
Always blocks
Endpoint removed. Required field deleted. Type changed. Auth scheme changed. No threshold. No silent overrides -- every exception requires an explicit record in the exception ledger.
Blocks above threshold
Optional field removed. Deprecation violated. Response field made required. Configurable per team.
Always passes
New endpoint added. Optional field extended. Description changed. Additive changes never block.
MCP server
Your MCP server, kept in sync on every push
Speakeasy (and other generators) build your MCP server from your spec. StateAnchor gates every spec change before it reaches the generator, so the MCP your agents call never drifts from your deployed API.
- Gated automatically on every spec push -- breaking changes block downstream MCP regeneration
- Works with any MCP generator (Speakeasy, Fern, custom) and any MCP-compatible agent (Claude, Cursor, Copilot)
- Speakeasy builds your MCP server. StateAnchor catches spec drift in CI before it reaches production.
- MCP servers don’t fail loudly — they fail in decision-making. StateAnchor gates the contract before generation.
// stateanchor-generated // spec: 2.1.4 . commit: a3f92c1 // gate: PASS . 2 additive changes const result = await mcp.call( 'check_user_exists', { userId: req.params.id } ) // contract: GET /users/{id} // required: id (string, uuid) // response: { id, email, name, role }
SOC 2 in progress
Built for compliance buyers
StateAnchor’s exception ledger and append-only audit trail map directly to CC8.1 change management controls. Generate a structured evidence package for any audit period in one click.
See compliance docs →Why engineers trust StateAnchor
Detection accuracy
StateAnchor's spec-diff engine detects 100% of breaking changes on our 34-scenario ground-truth corpus. api-smart-diff: 65% on the same corpus.
See the comparison →Tests in CI
Every gate decision is categorical -- ERR, WARN, or INFO. No scores, no thresholds to tune. 3,596 tests keep it that way.
View changelog →Outage policy
Fail-closed by default. Explicitly configure fail-open if your team needs deploys to proceed on downtime.
Reliability docs →Start enforcing your API contract today.
Connect your repo in ~=5 min. The gate runs on every push automatically.
Free to start. No credit card required. Gate-only: unlimited. Full pipeline: 3 syncs to start.
Stay in the loop
API contract content, shipped infrequently.
New features, writing on API design, and StateAnchor updates. No noise.