Skip to content
Docs›CLI›A drift gate in your pipeline in five minutes
CLI · CI

A drift gate in your pipeline in five minutes

Deterministic binary, self-contained. Exit-code contract built for CI. Nothing leaves your machine.

/ 01section

Why it fits CI

  • The exit-code contract is scriptable: 0 success · 1 usage/IO error · 2 verification or drift failure · 3 zero-emission/schema error · 4 fidelity violation under --strict-fidelity.
  • xsecurity diff <old> <new> in PRs shows the compiled-rule blast radius before deploy.
  • xsecurity report emits SARIF (--format sarif) straight into the code-scanning tab.
/ 02section

GitHub Actions

xsecurity validate compares your annotated spec against the deployed gateway and exits 2 on critical drift — the job fails, the PR is blocked.

.github/workflows/drift-gate.yml
name: drift-gate
on: pull_request

jobs:
  drift:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      # bin/cli.mjs ships inside every plugin bundle — self-contained, no npm install
      # exit 2 = deployed gateway disagrees with spec → PR blocked
      - run: node ./tools/x-security/bin/cli.mjs validate openapi.yml --target kong --gateway http://kong:8001

The CLI ships inside every plugin bundle: grab a bundle and run bin/cli.mjs on Node 20+, and there is no install step. For the hosted continuous layer, see how the hosted platform works.