Safety guardrails on every call
Ontology Route for AI Agent has Guardrails built into the gateway layer. Without touching your business code, validate content entering and leaving the model for compliance, safety and format. Stop risk before it reaches your users, trace every block in the observability chain.
Built-in guardrail types
An out-of-the-box policy library covering input, output and bidirectional scenarios.
PII detection & redaction
UnavailableDetect ID cards, phone numbers, emails, bank cards and other sensitive data; redact or block automatically. Requires a dedicated service — unavailable for now.
Jailbreak & injection blocking
Detect prompt injection and jailbreak patterns and block the request before it reaches the model.
Credential leak protection
Scan for API keys, tokens and other credentials to prevent sensitive data from leaking in requests or responses.
Content moderation
Score violence, hate, adult and other categories; block or rewrite automatically above threshold.
Structured output validation
Enforce JSON Schema on output and auto-retry on missing or invalid fields.
Custom rules
Combine regex, keyword lists and LLM-as-a-Judge to orchestrate your own guardrails.
Bidirectional guardrail pipeline
Requests pass guardrail checks before reaching the model and responses before reaching the user — block, redact, rewrite or retry on policy hit.
Request guardrails · Input
PII detection
Unavailable · needs self-hosted service
Jailbreak injection
Hit jailbreak rule
Keywords
No hits
Model call
gpt-4o
Response guardrails · Output
Content moderation
toxicity 0.02
JSON Schema
Valid
Hallucination check
Low confidence
This request was blocked because it hit the jailbreak rule; the event is recorded in the corresponding trace.
Policy as code
Guardrail rules are managed declaratively, with versioning, review and canary release. Mount them flexibly per task, tenant and environment — every hit flows into the observability chain for a complete audit loop.
- 版本化与灰度发布
- 按租户 / 环境差异化挂载
- 命中记录联动 Trace 审计
- Versioned with canary release
- Per-tenant / environment mounting
- Hits linked to trace auditing
guardrails:
- id: block-jailbreak
stage: input
when: prompt_injection.score > 0.8
action: block
- id: mask-pii
stage: input
detectors: [email, phone, id_card]
action: redact
- id: enforce-schema
stage: output
schema_ref: ./order.schema.json
action: retry
max_retries: 2Start from the catalog, connect safely
Pick a model, attach guardrails, turn on observability — build trusted apps in three steps.