Guardrails
Block a request at the proxy before it reaches the model, and stay in control with the kill switch.
A guardrail stops a request at the Runtime Proxy before it reaches the model. It uses the same YAML as any other policy, with three settings:
mode: guardrailstage: pre_callverdict: block
Before forwarding a call, the proxy can check the requested model, the provider and the operation.
YAML
policy:
name: "block-denied-models"
version: 1
mode: guardrail
severity: critical
applies_to:
agents: ["*"]
when:
stage: pre_call
all:
- field: gen_ai.request.model
in: ["gpt-3.5-turbo", "gpt-4o-mini"]
then:
verdict: block
message: "Model is on the denylist"
dimension: policy_complianceWhat happens when a request is blocked
- The proxy answers 403 and the call is never sent to the provider. The response body carries your policy's
message. - The blocked request appears in the run as a step marked BLOCKED, lowers the trust score on the policy's dimension, and can trigger an alert.
- Every block is listed on the Enforcement page.
HTTP response
HTTP/1.1 403 Forbidden
Content-Type: application/problem+json
{
"type": ".../guardrail-blocked",
"title": "Request blocked by a guardrail policy",
"detail": "Model is on the denylist",
"status": 403,
"instance": "/v1/chat/completions"
}Handle a 403 from Elgeon in your agent the way you would handle a refused action: stop, or choose a permitted alternative. Guardrail changes apply as soon as you save the policy.
Enforcement controls
In Settings, under Guardrail enforcement:
| Control | What it does |
|---|---|
| Enforcement enabled | The kill switch. Turn it off to stop all guardrail blocking in your workspace at once; every request is let through. Turn it back on to resume. |
| Fail closed | What happens if Elgeon can't evaluate your guardrails. Off by default (fail open), so a problem on our side never breaks your traffic. Turn it on to block instead. |
| Interventions per run | How many blocks in one run count toward the trust score and alerts. Blocks beyond it are still enforced and logged, so an agent stuck retrying a blocked call can't wipe out its score or flood your alerts. The default is 5. |
Changing these needs the admin or developer role, and each change is recorded in the audit log.