Guardrails
Pre-call checks run on every request, post-call checks run on the response, and prompt injection is scored when capacity allows. Blocked requests return 403 — never enqueued, never billed.
Guardrails always run before routing
The guardrail pipeline runs before any routing decision. A request that fails a pre-call check returns 403 immediately — it never reaches the LLM and is never billed.
Four pre-call layers
Prompt Injection
By default, prompt injection is scored when capacity allows and recorded, not blocked. An account owner or admin can turn injection blocking on in Settings. An ML classifier also scores prompts. Detection can't be turned off per key, and these checks won't catch every attack, so set tool rules and session limits for agents too.
PII Masking
PII detection engine. Default entities: EMAIL, CREDIT_CARD, SG NRIC, ID NIK, MY MyKad, TH National ID. Opt-in: PHONE, IP_ADDRESS, URL. Four modes: redact, tokenize, synthetic, block.
Content Moderation
Keyword-based filter. English + Bahasa Indonesia. ~5ms latency. Configurable per policy group.
Conversational Guardrails
YAML + flow-rule config per policy group. Conversational flow enforcement — blocks topic steering, jailbreaks, system-prompt disclosure.
Four ways to handle detected PII
Set pii_mode per API key or policy group. The default is redact.
redact (default)
tokenize
synthetic
block
See PII protection for the full mode reference.
Override guardrail defaults per API key
An API key's guardrail_overrides JSONB can selectively bypass guardrails independent of its policy group. Only PII and content moderation can be overridden per key; injection checks can't.
Conversational flow enforcement
Configure via the dashboard Guardrails tab. YAML config + flow rules are stored per policy group and cached by config hash for performance.
Full guardrails overview: Platform / Guardrails →
Secure every AI call with guardrails
Guardrails run on every request — real-time and batch — before the model is ever called.