Debug Session
Use debug session when you need detailed per-request diagnostics for one operator/client without exposing internals to all traffic.
What it does
When debug session is active for a caller, Fairvisor adds verbose headers:
X-Fairvisor-Debug-DecisionX-Fairvisor-Debug-ModeX-Fairvisor-Debug-ReasonX-Fairvisor-Debug-PolicyX-Fairvisor-Debug-RuleX-Fairvisor-Debug-Latency-UsX-Fairvisor-Debug-Matched-PoliciesX-Fairvisor-Debug-Descriptor-<N>-KeyX-Fairvisor-Debug-Descriptor-<N>-Value
In normal mode, these headers are not emitted.
Prerequisites
Set:
FAIRVISOR_DEBUG_SESSION_SECRET=<strong-random-secret>
If the secret is not set, debug endpoints return 404.
Endpoints
POST /v1/debug/session- Required header:
X-Fairvisor-Debug-Secret: <secret> - On success:
204 No ContentandSet-Cookie: fv_dbg=...
- Required header:
POST /v1/debug/logout- Clears debug cookie
Typical workflow
- Create session:
curl -i -X POST http://localhost:8080/v1/debug/session \
-H "X-Fairvisor-Debug-Secret: $FAIRVISOR_DEBUG_SESSION_SECRET"
-
Reuse returned
fv_dbgcookie in requests to/v1/decision. -
Inspect
X-Fairvisor-Debug-*headers. -
End session:
curl -i -X POST http://localhost:8080/v1/debug/logout \
-H "Cookie: fv_dbg=<cookie-value>"
Security model
Debug cookie is short-lived and scoped for operator use:
- TTL: 15 minutes
HttpOnlySecureSameSite=Strict
Recommendations:
- keep debug endpoints internal-only
- rotate
FAIRVISOR_DEBUG_SESSION_SECRET - do not log debug secrets
- do not enable global debug in public edge paths
Important contract note
For standard reject responses (429), Fairvisor returns general reject headers (X-Fairvisor-Reason, Retry-After, RateLimit*).
Policy/rule attribution is debug-only and available as:
X-Fairvisor-Debug-PolicyX-Fairvisor-Debug-Rule
Troubleshooting
404on/v1/debug/sessionFAIRVISOR_DEBUG_SESSION_SECRETis missing
403on/v1/debug/session- wrong
X-Fairvisor-Debug-Secret
- wrong
- no
X-Fairvisor-Debug-*headers after login- cookie not forwarded by client/gateway
- cookie expired
- HTTPS/cookie policy strips
Securecookie in your test path