Response Headers

Header presence depends on decision path and limiter result. Not every response contains all headers.

Rate-limit headers

HeaderPresent whenNotes
RateLimit-LimitLimiter returns limitAlgorithm-dependent
RateLimit-RemainingLimiter returns remainingAlgorithm-dependent
RateLimit-ResetLimiter returns reset or retry_afterFallback 1 in some limiter paths
RateLimitA limiter result existsStructured: "<policy_or_rule>";r=<remaining>;t=<reset>

Fairvisor follows the standard RateLimit* header model from:

Reject headers

HeaderPresent when
Retry-AfterReject decisions

Retry-After includes deterministic per-identity jitter and is not runtime-configurable.

X-Fairvisor-Policy, X-Fairvisor-Rule, and the reject reason are emitted in debug-session headers only (as X-Fairvisor-Debug-Policy, X-Fairvisor-Debug-Rule, X-Fairvisor-Debug-Reason). See Debug Session.

Advisory headers

HeaderPresent when
X-Fairvisor-WarningNon-blocking warning paths (budget_warn, budget_throttle, loop_warn)
X-Fairvisor-Loop-CountLoop detector emits loop metadata

Debug headers

Debug headers are available only on requests that carry a valid signed debug cookie. Set FAIRVISOR_DEBUG_SESSION_SECRET and call POST /v1/debug/session to obtain one.

HeaderNotes
X-Fairvisor-DecisionEffective decision action
X-Fairvisor-Modeenforce or shadow
X-Fairvisor-Latency-UsDecision latency in microseconds
X-Fairvisor-Debug-DecisionSame as above (verbose form)
X-Fairvisor-Debug-ModeSame as above (verbose form)
X-Fairvisor-Debug-ReasonInternal reject reason
X-Fairvisor-Debug-PolicyPolicy ID that triggered the decision
X-Fairvisor-Debug-RuleRule name that triggered the decision
X-Fairvisor-Debug-Latency-UsSame as above (verbose form)
X-Fairvisor-Debug-Matched-PoliciesNumber of policies evaluated
X-Fairvisor-Debug-Descriptor-*Per-descriptor key/value pairs (up to 16)

See Debug Session.

Notes on token headers

Some docs/examples may show additional token-specific headers such as X-Fairvisor-TPD-Remaining. Treat those as implementation-dependent unless explicitly documented by your running version.

Shadow mode

In shadow mode, would-reject decisions are converted to allow. Reject-specific response headers are suppressed for the client path.

Top-level runtime overrides (global_shadow, kill_switch_override) also do not add client-visible response headers. Use logs and metrics to verify override state.

decision_service vs reverse_proxy

  • In decision_service, headers are returned on /v1/decision and must be forwarded by the gateway.
  • In reverse_proxy, headers are attached on proxied responses in nginx filter phases.