Skip to main content

Guardrails

Guardrails are the runtime policy checks on every chat-completions request. They run on the normal request path — you don't wire them up separately and you can't opt out per request.

Three outcomes

Every guarded request produces one of three outcomes:

OutcomeHTTPModel called?Body
Allow200 OKYesNormal chat completion
Blocked403 ForbiddenSometimes (see below)Error, type: guardrail_error
Guardrails unavailable503 Service UnavailableNoError, code: guardrail_unavailable

Three headers on every guarded response

HeaderMeaning
x-request-idThis HTTP request
x-decision-idThe guardrails decision for this request
x-policy-versionThe policy version that produced the decision

Log all three on every request. When a response looks wrong later, x-decision-id is the fastest support handoff.

What guardrails will not do

  • Silently reroute a blocked request to a different model
  • Rewrite, redact, or partially release a blocked response
  • Continue with reduced protection when a required check is unavailable

In this section