Operating

Build features

Praxis is composed at build time with Cargo features.

Praxis v0.8.0 13 min read
On this page

Praxis is composed at build time with Cargo features. Several subsystems are optional so you can build a proxy that carries only what a deployment needs: a smaller binary, a leaner dependency tree, or no external observability and admin surface at all.

Most features are on by default. Build the standard binary with:

cargo build -p praxis-proxy --release

which includes hot-reload, the admin surface, and the policy filter with all supported builtins.

Build the leanest possible binary (every optional subsystem off) with:

cargo build -p praxis-proxy --release --no-default-features --features pingora

and add back individual features as needed:

cargo build -p praxis-proxy --release --no-default-features --features pingora,admin-api

For a policy-free build that keeps everything else, name the features you want instead:

cargo build -p praxis-proxy --release --no-default-features \
    --features pingora,config-reload,admin-api

A --no-default-features build always names its network backend (pingora today); see Network backends.

For that exact invocation the guarantee holds: every Praxis crate depends on praxis-proxy-filter without dependency defaults, so omitting policy features leaves the policy engine’s dependency tree out of the build. make release-fips is this build with the feature list kept in one place; see FIPS 140-3 for what that build is for and how to deploy it.

Selecting policy features

The standard build uses policy-builtins: the policy engine, every Policy builtin, the RustCrypto crypto backend and the experimental rate limiter (ratelimit/limitador). Because the limiter is experimental, a default build logs the experimental-features warning at startup. Compiling the limiter in adds no counting: it runs only for a policy that declares a kind: ratelimit/limitador plugin and lists it under rate_limits:, and Praxis warns at startup and on every reload when a loaded policy does.

A narrower build starts from --no-default-features and names the Policy features it wants. Policy’s builtins share one crypto backend, and a granular build must select exactly one: policy-crypto-default (RustCrypto) or policy-crypto-fips (system OpenSSL). The engine refuses to compile with neither or both, so policy-engine or policy-jwt alone does not build.

ProfilePolicy features
Standard (default)policy-builtins
Engine onlypolicy-engine,policy-crypto-default
API-key identitypolicy-api-key,policy-crypto-default
JWT identitypolicy-jwt,policy-crypto-default
Limiter without an identity builtinpolicy-experimental-ratelimit,policy-crypto-default
Limiter with JWTpolicy-experimental-ratelimit,policy-jwt,policy-crypto-default

For example, an API-key-only proxy:

cargo build -p praxis-proxy --no-default-features \
    --features pingora,config-reload,admin-api,policy-api-key,policy-crypto-default

An engine-only build registers no builtin plugin kinds. Its policies can use inline rules and host-registered plugins; a policy naming a kind: the build did not compile in (for example identity/jwt) fails to load with an error naming the kind, at startup or on reload.

policy-jwt verifies tokens on aws-lc-rs. policy-jwt-openssl-fips is the same plugin verifying through the system OpenSSL; it requires policy-crypto-fips and cannot be combined with policy-jwt. policy-api-key-fips (policy-api-key + policy-crypto-fips) and policy-jwt-fips (policy-jwt-openssl-fips + policy-crypto-fips) are convenience aliases. The default FIPS build carries no Policy feature.

Selecting policy features as a library consumer

The same holds when Praxis crates are embedded. Each crate that reaches the filter (praxis-proxy, praxis-proxy-protocol) depends on it without defaults and exposes the same policy-* features, forwarding to the filter’s. So:

  • Depending on praxis-proxy (the server as a library) with default-features = false and naming the features you want gives a policy-free build; leaving defaults on gives the complete builtin set.
  • Depending on praxis-proxy-protocol or praxis-proxy-filter directly gives no policy engine unless you enable policy-engine, policy-builtins, or an individual policy-* feature on that edge. Set default-features = false on a filter dependency when you want to choose features explicitly. praxis-proxy-core and praxis-proxy-tls never pull it.

Cargo unions features across the whole dependency graph, so one crate anywhere in your graph that depends on praxis-proxy-filter with its defaults turns policy-builtins back on for everyone, and the policy filter then becomes nameable in config in a build believed to be policy-free. Verify with cargo tree -e normal -i praxis-policy: no output means the policy engine really is out of the build.

Network backends

The layer that owns sockets, TLS acceptors, HTTP framing, connection pooling and the async runtime is a backend, and a build runs on exactly one. Pingora is the production backend and the pingora feature is on by default; hyper is an experimental second backend, off by default (see hyper backend for what it covers and what is not at parity yet). Everything above the backend (configuration, filters, routing, health checks, retries, the admin handlers, the sub-request client) is backend-neutral and does not change with it.

Because Cargo features are additive, a backend cannot be turned off by turning another on, and the two backends are mutually exclusive: a build with both refuses to compile. The build that wants the hyper backend therefore starts from --no-default-features and names it:

cargo build -p praxis-proxy --release --no-default-features \
    --features hyper,config-reload,admin-api,policy-builtins

make build-hyper is the same build without --release, into target/hyper, and make test-integration BACKEND=hyper runs the suites on it. A build with no backend feature refuses to compile the praxis-proxy binary. The library crates do compile that way, with a stand-in connector that refuses every connection, so lean-build checks still work.

Library consumers that depend on praxis-proxy, praxis-proxy-protocol or praxis-proxy-core with default-features = false name the backend feature on that edge too. Adding a backend is described in Adding a Network Backend.

Feature summary

FeatureDefaultEnablesTurn it off / on when
pingoraonThe Pingora network backend: listeners, HTTP/1 and HTTP/2 framing, connection pooling and the async runtime, from the Pingora fork.Never off on its own: a build needs a backend. A --no-default-features build names it explicitly. Mutually exclusive with hyper.
hyperoff (experimental)The hyper network backend: listeners, HTTP/1 and HTTP/2 framing, a Praxis-owned connection pool and a tokio runtime, on hyper 1.x with tokio-rustls.On, from --no-default-features, to run the proxy on hyper for testing and evaluation. Not at parity with Pingora yet; see hyper backend.
config-reloadonConfig-file and TLS-certificate hot-reload (filesystem watching).Off for a static-config deployment: drops both watchers and the notify, arc-swap, and tokio dependencies they pull into the TLS crate.
admin-apionThe admin HTTP services: management API (/api/*) on admin.address, and /healthy, /ready, /metrics on admin.metrics_address.Off when the proxy exposes no monitoring or management surface. The data path and background health checks are unaffected; only the HTTP endpoints go away.
oteloffOpenTelemetry / OTLP span export for traces.On for distributed tracing. Pulls in a heavy opentelemetry + tonic dependency graph.
policy-builtinsonThe policy filter with every Policy builtin, the RustCrypto backend and the experimental rate limiter.Off for a deployment that does no policy-based authorization: it is the heaviest optional dependency, so dropping it is the largest single saving in build time and binary size. Name granular features instead to keep only the plugin kinds a policy uses.
policy-enginevia policy-builtinsThe policy engine with no builtin plugin. Needs a crypto backend.With policy-crypto-default for policies that use only inline rules and host-registered plugins.
policy-crypto-defaultvia policy-builtinsPolicy’s RustCrypto backend, shared by every builtin.Exactly one backend per build; the ordinary choice.
policy-crypto-fipsoffPolicy’s system OpenSSL backend.Exactly one backend per build; for FIPS builds.
policy-api-keyvia policy-builtinsThe identity/api-key plugin.With a crypto backend for API-key authentication.
policy-jwtvia policy-builtinsThe identity/jwt plugin on aws-lc-rs.With a crypto backend for JWT authentication. Not FIPS.
policy-jwt-openssl-fipsoffThe identity/jwt plugin on system OpenSSL.With policy-crypto-fips; excludes policy-jwt.
policy-experimental-ratelimitvia policy-builtins (experimental)The ratelimit/limitador plugin. Outside Policy’s semver guarantees.Name it in a granular build that needs the limiter.
Other policy-* featuresvia policy-builtinsOne builtin each: policy-oauth, policy-delegator-vault, policy-elicitation-ciba, policy-cedar, policy-cel, policy-opa, policy-valkey, policy-secrets-vault.Combine only the builtins the policy documents reference. policy-secrets-vault compiles Policy’s Vault secret backend, but the policy filter registers only the env secret provider, so a kind: vault secret still fails to load.
basic-auth-filteroff (experimental)The basic_auth filter.Dev and testing only. Slated for removal in favor of the policy engine (praxis-proxy/policy); prefer that for authentication.
cloud-events-filteroff (experimental)The cloud_events filter (serialize requests into CloudEvents and ship them to an HTTP receiver).On for event export; delivery is best-effort. Adds chrono and url.
upstream-bindingoff (experimental)Logical upstream binding: the router publishes the matched cluster as a request-wide binding that bound_upstream conditions and cluster_source: bound_upstream load balancers read.On when a pipeline gates filters on the bound cluster’s application metadata or dispatches from the binding. Implied by the two features below. Off, those config forms are rejected at load time and the router never touches request extensions.
iterative-request-routeroff (experimental)The iterative_request_router filter: a bounded loop of sub-requests for provider failover and agentic/tool loops.On for callout and failover pipelines (the AI gateway relies on it). No extra dependencies; pulls in upstream-binding, since its steps dispatch from the binding.
router-json-aliasesoff (experimental)The router filter’s JSON-alias body-routing groundwork.Groundwork only: it is not wired into routing, and a route that sets json_aliases is rejected at build even with the feature on. Default builds do not accept the keys.
slow-startoff (experimental)Per-cluster slow_start config.The key is rejected unless the feature is on. With the feature on, weighted strategies apply the ramp. Hash strategies do not.
forward-proxyoff (experimental)The listener forward_proxy block (HTTP CONNECT forward proxying).The key is rejected unless the feature is on. The CONNECT runtime is not merged yet, so the block is parsed and validated but accepts no CONNECT requests.
bound-upstream-request-bodyoff (experimental)The HttpFilter::on_bound_upstream_request_body hook, run once at the logical-binding barrier.For out-of-tree filters that must inspect or rewrite the request body against the bound upstream; no in-tree filter uses it yet. Pulls in upstream-binding.
chain-bindingoff (experimental)The register_chain_binding outbound-callout API (ChainBindingContext::bind_chain) and its authority-bound deferred credentials (PendingCredentials, DeferredCredential).For out-of-tree callout filters; no in-tree consumer yet.
spiffeoff (experimental)SPIFFE X.509-SVID mTLS peer identity (the require_named listener mode) and the peer_identity_trust filter.On for mTLS peer-identity authorization. Adds spiffe and x509-parser.
access-log-syslogoff (experimental)The access_log filter’s syslog sink (RFC 3164 over a Unix socket, UDP, or TCP).On to ship access logs to a syslog collector. Adds the optional syslog crate; kept out of the default and FIPS builds.
tls-health-checkoff (experimental)TLS handshakes and HTTPS active health probes. Selects Pingora.Enables health_check.type: tls; HTTP probes on TLS clusters use HTTPS. See health checking.
hedged-requestsoff (experimental)Races one idempotent request across healthy endpoints and returns the first successful response.On when a route sets hedge_policy with max_attempts greater than 1. Off, the policy is still parsed and every request stays on one upstream.
devoffDeveloper convenience bundle (currently enables basic-auth-filter).Local development builds.
experimentaloffMarker feature set transitively by experimental features; drives a startup warning.Not selected directly; it lights up when an experimental feature is enabled.

Experimental features

Several features are experimental: each is off by default, each turns on the experimental marker feature transitively, and enabling any of them makes the server log experimental features are enabled that should not be used in production at startup. Do not run an experimental build in production.

  • hyper: the hyper network backend. Off by default; a build that wants it starts from --no-default-features and names it, since the two backends refuse to build together. It runs the same filter pipeline, admin surface and sub-request client on hyper 1.x, but several data-path behaviours are not at parity yet (compression, WebSocket upgrades, hedging, the graceful drain sequence); see hyper backend.
  • basic-auth-filter (deprecated): the basic_auth filter. Credentials live in plaintext config, so it is for development and testing only. Prefer the policy engine for authentication.
  • cloud-events-filter: the cloud_events filter, which serializes a request into a CloudEvent and ships it to a configured HTTP receiver. Delivery is best-effort and never changes the client response; review its limitations before relying on it.
  • upstream-binding: logical upstream binding. With it, a router in a pipeline that reads the binding publishes the matched cluster once per request, bound_upstream conditions match on that cluster’s application metadata, and a load_balancer with cluster_source: bound_upstream picks an endpoint from it. Without it those two config forms fail validation and nothing in the request path changes. See Upstream Binding.
  • iterative-request-router: the iterative_request_router filter, a bounded loop of sequential sub-requests through named step pipelines. It powers provider failover and LLM agentic/tool loops and is the flagship consumer path for the AI gateway. Its streaming multi-step machine is high-complexity code that is still stabilizing.
  • router-json-aliases: groundwork for routing on a JSON request-body field through the router filter. The matching primitives exist but are not wired into request routing, so a route that sets json_aliases is rejected at build even with the feature on. It is kept behind the flag for a future implementation; default builds do not carry the json_aliases keys at all.
  • slow-start: per-cluster slow_start window. Default builds reject the key. With the feature on, round robin, random, least-connections, and power-of-two-choices apply the ramp. Hash strategies keep the configured weight.
  • forward-proxy: the forward_proxy block on protocol: http listeners, which turns a listener into an HTTP CONNECT egress gateway. Default builds reject the key. The config surface (destination allowlist, tunnel timeouts, the no-open-relay check) is in place; the CONNECT tunnel runtime is still to land.
  • bound-upstream-request-body: the once-per-request bound-upstream request-body hook (bound_upstream_request_body_access and on_bound_upstream_request_body on HttpFilter). It runs right after the binding router freezes the request’s logical upstream binding, over the fully buffered body, and a read-write participant’s output becomes the body forwarded, retried, and handed to the IRR. Logical binding itself is not gated; only this hook is. It has no in-tree consumer yet.
  • chain-binding: the register_chain_binding extension API and ChainBindingContext::bind_chain, together with the authority-bound deferred-credential channel (PendingCredentials / DeferredCredential) that injects a secret into an outbound sub-request only when the resolved destination matches the authority the credential was issued for. This is the outbound-callout mechanism; it has no in-tree consumer yet and exists for out-of-tree callout filters.
  • spiffe: SPIFFE X.509-SVID mutual-TLS peer identity, including the require_named listener client-cert mode, plus the peer_identity_trust filter that authorizes clients by mTLS peer identity. Note that peer_identity_trust works with any mTLS client certificate, not only SPIFFE, so a non-SPIFFE mTLS deployment must still build with spiffe to use it.
  • access-log-syslog: the access_log filter’s sink: {type: syslog} output, sending each record as an RFC 3164 message over a Unix socket, UDP, or TCP. Each message is capped at 1024 bytes (RFC 3164 §4.1), so an overlength record is truncated and a structured (e.g. JSON) payload may not remain valid. Off by default; adds the optional syslog crate, which is crypto-free and kept out of the default and FIPS builds.

Notes

  • Runtime still gates behavior. Building with admin-api does not start the admin endpoints; they bind only when admin.address or admin.metrics_address is configured. A listener’s hot_reload: true key takes effect only when the binary was built with config-reload; otherwise the certificate is served statically and a startup warning is logged.
  • The memory allocator is not a feature. Praxis targets Linux and always uses tikv-jemallocator; there is no build toggle for it.
  • Where the savings are. Dropping policy-engine, config-reload, admin-api, and otel is what trims the dependency tree and binary size, policy-engine by the widest margin. Most filters are always compiled in and share dependencies with the core proxy, so gating them individually would not remove a crate. The experimental filter gates (upstream-binding, iterative-request-router, chain-binding, router-json-aliases, slow-start, bound-upstream-request-body) exist to keep unfinished or not-for-production surface out of default builds rather than to save a crate; spiffe, cloud-events-filter, and access-log-syslog do additionally drop dependencies (spiffe + x509-parser, chrono + url, and syslog respectively).

See also

  • Filter Reference: the per-filter Feature column shows which filters require a cargo feature.
  • Observability: metrics and tracing, gated by admin-api and otel.
  • TLS: the runtime hot_reload listener key, gated by config-reload.
  • Getting Started: the build and test workflow.