4 min read
Gate-only mode
Gate-only mode runs StateAnchor’s contract enforcement without generating any artifacts. Use it when you already have a generator and want StateAnchor to sit upstream in CI, blocking breaking changes before your generator ever runs.
What gate-only mode is
Gate-only mode runs StateAnchor’s contract enforcement without generating any artifacts. The gate evaluates every push, classifies changes into ERR/WARN/INFO lanes, blocks breaking changes, and logs every decision to the Merkle audit trail. No SDKs, no docs, no OpenAPI spec — just enforcement.
When to use gate-only mode
Use gate-only mode if you already have a generator — Speakeasy, Fern, Stainless, or any tool that generates SDKs or documentation from your OpenAPI spec. StateAnchor sits upstream of your generator in CI. Breaking changes are blocked before your generator runs, which means your generator only ever processes verified contracts.
Configuration
In stateanchor.yaml, omit the outputs section or set it to an empty list:
service: my-api
version: "1.0.0"
server:
base_url: https://api.example.com/v1
auth:
type: bearer
models:
# your models
endpoints:
# your endpoints
# No outputs section -- gate-only modeOr explicitly:
outputs: []GitHub Action in gate-only mode
The GitHub Action works identically in gate-only mode. The gate decision (proceed or block) is the output. Your existing generator action runs after StateAnchor in your CI workflow:
jobs:
gate:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: stateanchor-hq/sync-action@v1
# gate-only: no outputs configured in stateanchor.yaml
generate:
needs: gate # only runs if gate passes
runs-on: ubuntu-latest
steps:
- uses: speakeasy-api/sdk-generation-action@v1
# your existing Speakeasy/Fern action hereWhat you get in gate-only mode
- ERR/WARN/INFO classification on every push
- Breaking change blocking in CI
- Merkle audit trail of every gate decision
- Share links for gate decisions
- Near-miss ledger
- Drift pressure tracking
- All dashboard and cockpit features
What you don’t get in gate-only mode
- SDK generation (TypeScript, Python, Go)
- MCP server generation
- API documentation
- OpenAPI spec export
These are all available in full pipeline mode.