Policy at the edge, not in your prompts.
PII redaction, prompt-injection blocking and content policies run at the router — before traffic hits a provider. Global toggles, per-key overrides.
PII redaction
Detect and mask names, emails, phones, cards and national IDs. Re-inject on response for the caller only.
Prompt injection
Classifier scores every user turn and tool result. Block, warn, quarantine or reroute to a hardened model.
Content safety
OpenAI moderation, Llama Guard, or your own classifier. Per-category thresholds for violence, self-harm, sexual and hate.
Custom rule engine
Deny by regex, allow-list retrieved domains, cap request size, require a system prompt prefix.
Zero-retention routing
Route only to providers with signed zero-retention terms. Non-compliant peers are dropped.
Signal in every response
x-llmcloud-guardrail lists every rule that fired, with a policy_id you can trace in the audit log.
POST /v1/policies
{
"name": "prod-default",
"pii": { "action": "redact", "scope": ["email","phone","ssn"] },
"injection": { "action": "block", "threshold": 0.7 },
"content": {
"provider": "llama-guard-4",
"block": ["violence","self_harm"],
"warn": ["sexual"]
},
"routing": { "require_zero_retention": true }
}# Per-key (default policy for all requests on this key)
PATCH /v1/keys/agent-prod-router
{ "policy": "prod-default" }
# Per-request override
POST /v1/chat/completions
Headers:
X-LLMCloud-Policy: prod-default
Body:
{ "model": "auto:quality", "messages": [...] }How much latency do guardrails add?+
PII and injection classification run in parallel with routing — 6–14ms p50 overhead. Content classifiers on the response can run async for streaming.
Can I bring my own classifier?+
Yes. Point a rule at your webhook; the router calls it inline with a configurable timeout and fallback.
Do redactions round-trip?+
Optionally. Ingress maps tokens to synthetic placeholders; the router re-inflates on egress. Nothing sensitive touches the upstream.