Guardrails

Screen request and response content inline on every call. Redact PII, block prompts that match keywords or patterns, or flag them for review. Configure rules under Dashboard → Guardrails.

Rule anatomy

  • Typepii (built-in detectors), keyword (comma-separated), or regex.
  • Actionblock (reject the request), redact (mask matches with [REDACTED]), or flag (allow + record).
  • Scopeinput (prompt), output (response), or both.

Built-in PII detectors: email, phone, credit_card, ssn, ip. Leave the pattern blank to screen for all of them.

Enforcement

  • Input rules run before anything is sent upstream. A block returns 403 guardrail_blocked; a redact rewrites the message content.
  • Output rules run on non-streaming responses. A block withholds the content; a redact masks matches. Streamed responses pass through untouched.
json
// A blocked request
{
  "error": {
    "message": "Request blocked by guardrail 'no-confidential'.",
    "type": "guardrail_blocked",
    "code": 403
  }
}

When an output rule redacts or flags content, the response includes a guardrails field summarizing what was applied.