Config Reference

Field-by-field reference for an SBproxy sb.yml file.

Overview

The exhaustive field-by-field reference for an SBproxy sb.yml file. Every section listed here corresponds to a config struct in the SBproxy schema, which is the canonical source of truth: if a field appears in the schema, it is supported here, and if a field is documented here, it is in the schema.

For a tour of features with copy-paste configs, see the config overview. For a buyer-facing introduction, see the quick start.

File shape

A SBproxy config file has two required top-level keys (proxy: and origins:) and three optional ones.

proxy:           # server-wide settings
  ...
origins:         # map of hostname to per-origin config
  "api.example.com":
    ...
access_log:      # optional structured-JSON access log
  ...
agent_classes:   # optional agent-class catalog selection
  ...

origins: is a map keyed by hostname. The hostname comes from the Host header (with optional SNI fallback when TLS terminates at the proxy). Wildcard prefixes are accepted (*.api.example.com).

proxy: server-level fields

FieldTypeDefaultNotes
http_bind_portu168080HTTP listener port.
http2_cleartextboolfalseDetect the HTTP/2 preface on the plain HTTP listener (h2c).
https_bind_portu16?unsetWhen set, requires tls_cert_file + tls_key_file or acme.enabled: true.
tls_cert_filestring?unsetPEM cert path. Ignored when acme is set.
tls_key_filestring?unsetPEM key path matching tls_cert_file.
acmeobject?unsetACME-managed TLS.
http3object?unsetTemporarily disabled until native HTTP/3 lands in the proxy engine. The field still parses (enabled, max_streams default 100, idle_timeout_secs default 30) but no listener starts.
metricsobject?unsetmax_cardinality_per_label (default 1,000).
adminobject?unsetenabled, port (9090), username, password, max_log_entries (1000).
secretsobject?unsetbackend, hashicorp, map, rotation, fallback.
l2_cache_settingsobject?unsetShared-state backend. Today driver: redis. Alias: l2_cache.
cache_reserveobject?unsetLong-tail cold cache tier.
messenger_settingsobject?unsetInter-component event bus. Drivers: memory, redis, sqs, gcp_pubsub.
trusted_proxies[string][]CIDRs whose X-Forwarded-For / X-Real-IP / Forwarded headers SBproxy will trust.
correlation_idobjectdefaultsenabled: true, header: X-Request-Id, echo_response: true.
mtlsobject?unsetclient_ca_file, require: true. Requires https_bind_port.
extensionsmap{}Opaque map. OSS never parses; extension layers read their own keys.

origins: per-hostname fields

The origin block sits at origins."<hostname>":. The handler chain below action: is built inside-out at config-load time, so per-request execution does no allocation in the chain-construction path.

FieldTypeNotes
actiontyped objectRequired. See Actions below.
authentication / authtyped objectOptional. See Authentication.
policies[typed object]Optional. Evaluated in order.
transforms[typed object]Optional.
request_modifiers / response_modifiers[object]Header, body, query, method modifiers.
cors / hsts / compressionobject?Per-origin CORS, HSTS, compression.
session / session_configobject?Cookie-based session config.
force_sslboolRedirect plain HTTP to HTTPS.
allowed_methods[string]Whitelist. Empty allows all.
forward_rules[object]Inline child origins selected by path, header, or query.
fallback_origintyped objectOrigin used when the primary upstream fails.
response_cachetyped objectPer-origin response cache.
variablesmapStatic variables for template interpolation.
on_request / on_response[object]Hooks invoked when a request enters or a response is being returned.
bot_detection / threat_protectiontyped objectBot detection and IP reputation rules.
rate_limit_headerstyped objectRFC 9239 header configuration.
error_pagestyped objectCustom error pages keyed by status or status class.
traffic_capture / mirrortyped objectCapture and shadow upstream.
message_signaturestyped objectRFC 9421 HTTP Message Signatures.
connection_poolobject?Per-origin upstream pool tuning.
extensionsmapOpaque. OSS never parses.
expose_openapiboolWhen true, publish /.well-known/openapi.json and .yaml for this origin.
rate_limitsobject?Per-origin rate limits.
default_content_shapestring?markdown, json, html, pdf, other.
content_signalstring?ai-train, search, ai-input.
token_bytes_ratiof32?Markdown projection tokens-per-byte. Defaults to 0.25.

Actions

Each origin must declare exactly one action. The type: field selects the action; remaining fields are action-specific.

type:What it does
proxyReverse-proxy to url. The most common action.
redirectHTTP redirect (status, url).
staticServe static files from a root path.
echoMirror the inbound request back as the response body.
mockReturn a canned response (status, headers, body).
beaconAccept-and-204 for analytics endpoints.
ai_gatewayRoute to the AI gateway. Provider catalogue, routing strategy, guardrails.
mcp_federationAggregate tool catalogues across upstream MCP servers; route tools/call per tool.
content_negotiateTwo-pass Accept resolution. Auto-prepended when ai_crawl_control or shape transforms are present.

The proxy field is url (not target).

Authentication

Set authentication: (or its alias auth:) on an origin. Exactly one auth provider per origin.

type:What it does
api_keysHeader-based API key check. Keys list is api_keys: (not keys:).
basic_authHTTP basic auth. The legacy basic alias is not accepted.
bearerStatic bearer-token check.
jwtJWT verification with JWKS or static keys.
digestRFC 7616 HTTP Digest Auth.
forward_authForward the request to an external auth service for an allow / deny decision.
noopAllow everything. Useful for debugging.
kyaSkyfire Know-Your-Agent token verifier.
capCrawler Authorization Protocol JWT verifier.

Policies

policies: is a list of policy entries that evaluate in order.

type:What it does
rate_limitingToken-bucket rate limiter. Set requests_per_second, burst, key:.
ip_filterIP allow / block. Use whitelist: and blacklist: (CIDR lists).
cel_expressionCEL boolean expression on the request context.
wafOWASP-style WAF rules.
ddos_protectionConnection-rate cap with adaptive backpressure.
csrfCSRF token enforcement. Requires secret_key.
security_headersStamps a configurable set of security headers on the response.
ai_crawl_controlPay Per Crawl. 402 plus Crawler-Payment token redemption.
exposed_credentialsCloudflare-style leaked-password check (k-anonymity prefix).
page_shieldPage Shield equivalent.
bulk_redirectsBulk redirect map.
dlp_catalogData-loss-prevention catalogue.
web_bot_authWeb Bot Auth (RFC 9421-style signed bot traffic).
http_framingSmuggling defence. Drops H2-to-H1 downgrade attacks.
a2a_envelopeAgent-to-Agent envelope policy with depth cap and cycle detection.

Lua scripts use function match_request(req, ctx) (not bare code with a global request).

Forward rules

forward_rules: lets one origin dispatch into one of several inline child origins based on path, header, or query.

forward_rules:
  - rules:
      - path: { exact: /health }
      - path: { prefix: /api/ }
      - path: { template: /users/{id:[0-9]+}/posts/{post_id} }
      - path: { regex: '^/v(?P<version>[0-9]+)/items' }
      - header: { name: X-Tenant, value: vip }
      - query: { name: debug, value: "1" }
    parameters:
      - name: id
        in: path
        required: true
        schema: { type: integer, format: int64 }
    origin:
      action: { type: proxy, url: http://upstream }

Path matchers accept prefix, exact, template, or regex. Precedence when more than one is set: template > regex > exact > prefix. parameters: follow OpenAPI 3.0 Parameter Objects verbatim.

Response cache

FieldDefaultNotes
enabledfalseGlobal on / off for this origin.
ttl_secs / ttl300Accepts 60, 60s, 5m, 2h30m.
cacheable_methods / methods["GET"]Methods eligible for caching.
cacheable_status / status_codes[200]Status codes eligible for caching.
max_size10000In-memory entry cap. Ignored for Redis.
vary / vary_by[]Headers folded into the cache key.
query_normalizesortignore_all, sort, or allowlist:[...].
stale_while_revalidate / swr_secsunsetSeconds beyond TTL to serve a stale entry while revalidating.
invalidate_on_mutationtrueMutating method to a path evicts every cached GET for the same workspace and path.

Stale replays carry x-sbproxy-cache: STALE.

Cache Reserve and L2 cache

Cache Reserve sits under the per-origin response cache. Fields: enabled, backend, sample_rate (default 0.1), min_ttl (default 3600), max_size_bytes (default 1,048,576). OSS backends: memory, filesystem (with path:), redis (with redis_url:).

L2 cache is the cluster-wide shared backend, configured under proxy.l2_cache_settings:

proxy:
  l2_cache_settings:
    driver: redis
    params:
      dsn: redis://localhost:6379/0

Rate limits

Two surfaces: per-policy (policies: entry with type: rate_limiting, token-bucket on a key) and per-origin (rate_limits: block, RFC 9239 middleware mounted ahead of policies).

FieldDefaultNotes
tenant_burst2000Burst ceiling per tenant.
tenant_sustained1000Sustained rps per tenant.
route_default100Per-route default rps when no override matches.
route_overrides{}Map keyed by literal path or /prefix/*. First match wins.
soft_threshold_rpsunsetAbove this but below tenant_sustained, requests are tagged but not throttled.

Throttled responses carry RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset, and Retry-After.

Content shape and licensing

FieldTypeDefaultNotes
default_content_shapestring?htmlmarkdown, json, html, pdf, other.
content_signalstring?unsetai-train, search, ai-input. Stamps Content-Signal on 200 responses.
token_bytes_ratiof32?0.25Markdown projection tokens-per-byte. Drives x-markdown-tokens.
expose_openapiboolfalseWhen true, publish /.well-known/openapi.json and .yaml. See OpenAPI emission.

When content_signal is unset, the proxy stamps TDM-Reservation: 1 instead of asserting a positive Content-Signal.

Extensions (opaque)

Both proxy.extensions and per-origin extensions are opaque maps that OSS never inspects. Extension layers read their own keys by name. This pattern is the standard escape hatch; OSS configs validate-clean against the OSS schema without depending on extension types.

proxy:
  extensions:
    classifier:
      endpoint: "http://127.0.0.1:9500"

origins:
  api.example.com:
    action: { type: proxy, url: http://localhost:3000 }
    extensions:
      semantic_cache:
        enabled: true
        ttl_secs: 1200

See also

  • Glossary for the vocabulary used in this reference.
  • Config overview for tour-of-features prose with copy-paste configs.
  • Extensibility for the CEL, Rego, Lua, JavaScript, and WASM hook surfaces.
  • OpenAPI emission for how expose_openapi and the admin OpenAPI route work.