Configurable safety rails that inspect prompts and responses for harmful or non-compliant content.
Guardrails are gateway-level inspection layers that run on every request, between your application and the model. A request that fails a check is blocked before it reaches the model.
Custom content guardrails — configure them at Settings → Guardrails (/dashboard/settings/guardrails):
422 guardrail_blocked.These apply on both the chat surface and your API (/v1) traffic.
PII redaction is also active on every request under Algeria Law 18-07 — national IDs, phone numbers, CCP, RIB, and emails are detected and (per your Privacy setting) warned/redacted/blocked. See Sensitive Info Guardrail.
Each guardrail applies its configured action, set at account level in the dashboard:
| Action | Behaviour |
|---|---|
block | Return an error; the model is never called |
redact | Replace matched spans with [REDACTED]; continue normally |
flag | Allow the request and record the match in your audit trail |
With a management key, you create guardrails and assign them to your API keys. A guardrail binds only the keys it is assigned to; a key with none of its own carries the account-level rules above.
| Rule | Does |
|---|---|
| budget | a cap in DA, reset daily, weekly or monthly |
| models | only these models run, or these never do |
| providers | only these providers serve, or these never do |
| zero data retention | only endpoints that keep nothing, per lab |
| sensitive information | email, phone, card numbers, secrets and more, redacted, blocked or flagged |
| prompt injection | known injection patterns |
| custom filters | your own patterns, redacted, blocked or flagged |
curl https://opendunes.com/v1/guardrails \
-H "Authorization: Bearer $OPENDUNES_MANAGEMENT_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Souk Bot production",
"limit": 500,
"reset_interval": "monthly",
"allowed_models": ["anthropic/claude-sonnet-5"],
"content_filter_builtins": [{ "slug": "email", "action": "redact" }]
}'Then assign it with POST /v1/guardrails/{id}/assignments/keys and the keys' hashes.
403 before it reaches a model, and nothing is charged.402 with limit_source: "guardrail".Guardrails are set on keys, never in a request: a request body has no guardrails field. Every route and field is on the Guardrails reference.
Every guardrail trigger is recorded in your account's audit log with the request ID, the rule that fired, the action taken, and a timestamp. Audit logs are retained for 90 days and accessible via the dashboard.