Run a guardrails check
Evaluate text against the authenticated project’s enabled guardrails at runtime. Returns whether the text is allowed, the per-guardrail results, and any modified (e.g. redacted) text. A result with errored: true means that guardrail couldn’t run; its action follows the guardrail’s If the check can’t run setting, which defaults to applying the guardrail’s action. Requires x-api-key.
Send x-zespan-deadline-ms to tell Zespan how long you’ll wait. It fits its rules into that budget and answers in time; AI rules it had no time to start are returned as errored results, handled per their If the check can’t run setting, and listed in skippedForDeadline. The SDKs send this header automatically, set to their check timeout (5 seconds by default).
Guardrail executions and events are recorded a few seconds after the response, so a check you just ran can take a moment to appear in the dashboard. The stored reason is redacted with your project’s PII settings.
Authorizations
Project API key. Manage keys in the Zespan dashboard under project settings.
Headers
How long, in milliseconds, the caller will wait for the response. Any value outside 50 to 60000 is ignored.
50 <= x <= 60000Body
1 - 50000"My card number is 4111 1111 1111 1111."
Whether this is checking input (pre) or output (post).
pre, post "gpt-4o"
200200100Only read by a require_confirmation rule (at most 10 entries are read; a malformed entry is dropped on its own). The confirmations your own app recorded for the current tool call, sent by the SDK. Each entry has ref (an opaque id), toolName, optional argsHash, kind, outcome, optional actorRole and ageMs. Text, tool results and arguments never count as a confirmation.
50Present as { "v": 1 } when the caller keeps a confirmation ledger. Without it a require_confirmation rule cannot tell "no confirmation" from "an SDK that sends none", so it reports sdk_no_ledger and blocks nothing.
Response
Guardrail evaluation result.

