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:
0success ·1usage/IO error ·2verification or drift failure ·3zero-emission/schema error ·4fidelity violation under--strict-fidelity. xsecurity diff <old> <new>in PRs shows the compiled-rule blast radius before deploy.xsecurity reportemits 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:8001The 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.