Skip to content
Docs›Start here›Quickstart
Start here · 60-second primer

Quickstart

One minimal x-security policy, and three ways to ship it. Full field reference: x-security v0.8 schema.

/ 01section

The minimum viable policy

x-security is an OpenAPI extension: a block you add next to a route that declares the perimeter controls the route should have. This one pins JWT verification to asymmetric algorithms and throttles per authenticated user:

openapi.yml · x-security block
paths:
  /users/{id}:
    get:
      summary: Get user by id
      x-security:
        authentication:
          type: bearer-jwt
          allowedAlgorithms: [RS256, ES256]   # asymmetric only — alg:none has no spelling
          bannedAlgorithms: [HS256, HS384, HS512, none]
        rateLimit:
          requests: 60
          window: 60s
          identifier: user-id                 # keyed by JWT subject, not IP

From here, pick your path. All three end at the same place: declared policy, enforced at the gateway.

/ 02section

Ship with your agent

  • Install the plugin — Free · no card · no signup.
  • Run /x-security-scan in Claude Code or Cursor. Your own model reads the code; the bundled LLM-free CLI verifies every finding.
  • Verified policies land in .x-security/policies/ in your repo. Every finding cites file:line. Nothing deploys automatically.
/ 03section

Write policies by hand

Add the block above to your OpenAPI file, then compile it to native gateway config:

terminal
$ xsecurity generate openapi.yml --target coraza --out ./waf

Load the emitted artifact into your gateway. Five self-hosted targets are supported — per-target load commands and capability coverage in the gateway matrix.

/ 04section

Gate CI on drift

Run xsecurity validate against the deployed gateway in CI:

terminal
# Exit 0: spec and gateway agree. Exit 2: critical drift — fail the build.
$ xsecurity validate openapi.yml --target kong --gateway http://kong:8001

Exit code 2 means the deployed gateway disagrees with the spec on something critical. The build fails before the drift ships. Setup: CI drift gate.

Where next
How detection works — what the agent path detects and how findings earn trust · The x-security CLI — every verb, deterministic and LLM-free.