Skip to content
Apache-2.0 · 100% open source

Stop hand-writing WAF config for every gateway. Write one security policy. Compile it to all of them.

Your API gateway and WAF already ship auth, rate limits, request validation, and ownership checks, off by default. x-security is one policy per route, an extension of the OpenAPI spec you already have. A deterministic CLI compiles it to seven gateways. Versions in git. Drift fails CI.

  • 7 gateway targets
  • 17+ policy categories
  • deterministic · no API keys
Star on GitHub
openapi/x-security/users.id.GET.yml generated
# GET /users/:id    one route, one policy
authentication:
  type: bearer-jwt
  allowedAlgorithms: [RS256, ES256]   kills alg:none

authorization:
  type: rule-based
  rules:
    - field: resource.ownerId
      operator: equals
      value: { ref: jwt.sub }         BOLA defense

rateLimit:
  per: user-id                        not IP
  window: 60s
  max: 60

response:
  headers:
    csp: "default-src 'self'"
    hsts: { maxAge: 31536000 }

The security is already in your gateway. You're running it on defaults.

Turning that protection on means learning each vendor's config language, and the rules you write lock you into that vendor, live outside your codebase, and drift out of sync with the API they protect. So the defaults stay, wide open, because the alternative is a config project per gateway.

x-security flips that: one policy per route, in the OpenAPI file you already have — portable, versioned in git, drift-gated in CI.

Industry signal · last 12 months
83%

of organizations hit an API security incident last year. Same OWASP categories every time: broken object-level auth (API1), broken authentication (API2).

Salt Labs · State of API Security 2025

From your code to an enforced policy. Four steps, one spec.

The policy stays in source control the whole way. Every rule cites file:line and is byte-verified against your code before it compiles to a gateway rule.

One x-security block per route, in the OpenAPI file you already have. Write it by hand or with the visual builder — it versions in git and diffs like code.

x-security: { … }

Verified, or not enforced.

Three rules decide what ever reaches a live gateway. Anything unproven is dropped, not shipped.

─ 01

Byte-verified citations

Every rule cites file:line and is byte-verified against your code.

─ 02

Nothing unproven ships

Unverifiable findings are dropped to reviewRequired and never enforced.

─ 03

Log before block

Shadow mode where the gateway supports it natively.

Known limitations →·The x-security schema is open — read the source ↗

Compile to the gateway you already run.

One spec, 5 self-hosted compile targets and 2 hosted deploys — switch gateways without rewriting a line of policy. Per-gateway support matrix →

CF
Cloudflare
LIVE
AW
AWS
BETA
KO
Kong
BETA
CZ
Coraza
BETA
EN
Envoy
ALPHA
BW
BunkerWeb
BETA
OA
OpenAppSec
BETA
+
Request a gateway
OPEN ISSUE

What compiles where, and what it actually blocks.

Pick your gateway, and the coverage recomputes from the ceiling to your reality. Honest per target: every gap is flagged instead of rounded up.

Your gateway
79%ceiling (best achievable)
5 full 8 partial 1 gap 0 not measured

The most x-security can enforce at the perimeter, given an identity-aware gateway. Pick your stack to see your reality — gaps and all.

Cloudflare, AWS and BunkerWeb are independently measured today; other targets compile the same policy, not yet per-class measured. Full per-class, per-field matrix →

All delivery targets (7 gateways, 9 rows)
TargetWhat it isDeliveryStatus
cloudflareCloudflare Ruleset Engine + WAFhosted deployGA
aws-apigwAWS API Gateway + WAFv2hosted deploybeta
kongKong Gateway (decK plugin)self-hosted bundlebeta
corazaCoraza / ModSecurity WAFself-hosted bundlebeta
coraza · nginxNGINX + libcoraza (preset)self-hosted bundlebeta
bunkerwebBunkerWeb (OpenResty WAF)self-hosted bundlebeta
openappsecCheck Point Open AppSecself-hosted bundlebeta
envoyEnvoy (ext_proc / Lua)self-hosted bundlealpha
firewallHost firewall (iptables) — SSRF egress onlyself-hosted bundle—

NGINX ships as a Coraza preset and the host firewall is an SSRF-egress adjunct, not standalone gateways, so seven gateways, nine rows.

One spec. Every gateway. Apache-2.0.

x-security is 100% open source. Read the spec, install the CLI, compile to your gateway. Star the repo to follow the schema — changes are versioned and tagged.

Apache-2.0, 100% open source; fork it, self-host it
One spec compiles to 7 gateways, so you're never locked into one
Deterministic compile, with no LLM and no API keys
Every emitted rule cites a real file:line in your code