Gate form factor
SDK middleware
BetaIn-process middleware for teams that want the Gate inside the application, with per-route policy expressed in code. Node/Express ships today as Beta.
How it sits
SDK middleware runs the Gate check order inside the application process with per-route policy in code.ShippingDEMO-HACK news-server Express implementation.
- Middleware runs the same eight-stage order as the reverse proxy.
- Route handlers declare endpoint_id, policy_hash, methods, and freshness.
- Useful when you own the service code and want enforcement next to business logic.
- Reference implementation: DEMO-HACK news-server Express path.
Configuration surface
Per-endpoint policy
endpoint_id, policy_hash, method allow-list, TTL, and use count (scoped to the route being protected).
Freshness window
Tune how long an envelope remains valid for each route. Captured envelopes die when the window closes.
Fail-open vs fail-closed
Choose reject-when-Control-is-unreachable, or an explicit break-glass path for emergency access.
Audit mode
hash_only for compact evidence, or full capture when you need the complete request transcript.
When to choose SDK
- You can modify the application and prefer policy-as-code.
- Latency or topology makes an out-of-process proxy undesirable.
- You want the same envelope contract as proxy and MCP form factors.
