Guardrails
Block prompt injections, jailbreaks, and unsafe content at the gateway, before they reach your model. Powered by span-01 and free with the Respan gateway.
Guardrails check each request you send through the Respan gateway with span-01, Respan’s classification model. You pick the categories to block once for your organization, with no code changes.
Turn on guardrails
Send your requests through the gateway
Guardrails run inside the gateway, so they only cover requests sent through it. Apps that only send traces to Respan aren’t checked. To set up the gateway, see the gateway quickstart.
Guardrails apply to every gateway request in your organization. There’s no per-key or per-request setting. To turn them off, switch off Block unsafe requests and click Disable.
Categories
What gets checked
- The newest turn only. Guardrails read the latest user and tool messages after the last assistant message, with the system prompt as context. Earlier turns and model responses aren’t checked.
- Redacted text. If PII redaction is on, guardrails see the redacted messages.
- Fail open. If the check can’t run, the request goes through and counts as Skipped.
Handle a blocked request
A blocked request never reaches the model. The gateway returns HTTP 400, and the message lists every category that matched:
That’s the body on chat completions. On passthrough routes such as the Anthropic endpoint, the body is {"detail": "Request blocked by guardrail: jailbreak."}.
To show your own message, catch the error and check its code:
Review activity
The Guardrails tab shows the last 7 days (UTC): how many requests were checked, how many Passed, were Blocked, or were Skipped, and the counts Blocked by category. A request can match more than one category.
Benchmarks
On a benchmark built from 7 public security datasets, Respan Guardrails post the highest average F1 of the guardrails we tested.



