Guardrails
Check what the agent is about to say before the caller hears it, and block the things that would cost you.
Guardrails check every candidate response before it's spoken. If a response breaks one of your rules, the caller never hears it.
Why they matter
Use guardrails for policies that should hold across your agents, such as never asking for passwords or one-time codes. A shared rule set gives your team a policy it can review, test and improve before release.
Write a rule set
Rules live in reusable guardrail sets you attach to agents, so the same policy can cover a whole fleet.
In the dashboard, this is the Guardrails tab next to Agent in the builder. A set is a slug, a name, and an ordered list of rules:
Over the API, that ordered list is definition.guardrails.
{
"slug": "payment_safety",
"name": "Payment safety",
"definition": {
"guardrails": [
{
"id": "never-request-card",
"name": "Do not collect cards",
"severity": "high",
"instruction": "Never ask the caller to read a full card number, CVV, PIN, password, or one-time passcode."
},
{
"id": "prohibited-phrases",
"name": "Block credential prompts",
"severity": "block",
"kind": "static",
"phrases": [
"read me your password"
]
}
]
}
}Over the API:
POST /v1/guardrail-sets.
Two kinds of rule mix freely in one set:
staticblocks phrases you list. Matching is exact but case-insensitive and word-bounded, soasswon't matchclassandPASSWORDwon't slip pastpassword.llmhas a compliance model judge the whole drafted response against an instruction you write in plain language.
Write one testable constraint per rule. Vague instructions cause false positives, and a guardrail that fires on good calls gets switched off.
Rule text is literal policy. Variables are never expanded in it, so a rule means the same thing for every caller and no call data can rewrite the rule.
A set holds up to 100 rules. Editing a set changes every agent that references it — including production — so treat a live edit as a release: re-test it on staging. The change applies to future calls without a new agent promotion; calls already running keep the policy loaded at setup.
Limits
| Bound | Maximum |
|---|---|
| Rules per set, and cumulative rules across an agent's sets | 100 |
| LLM instruction characters (per set and per agent) | 40,000 |
| Static phrases (per set and per agent) | 1,000 |
| Static phrase characters (per set and per agent) | 100,000 |
Encoded definition | 1 MiB |
| Sets assigned per agent | 50 |
If a save exceeds a set or assigned agent's budget, we reject it and name the field to fix. Keep rules focused rather than working around those limits.
Attach a set to an agent
Agents reference sets by ID, in order:
{
"behavior": {
"guardrails": {
"guardrail_set_ids": [
"11111111-1111-4111-8111-111111111111"
]
}
}
}Send that in a draft patch, then promote and deploy. Up to 50 sets per agent. A call already in progress keeps the policy it started with.
What happens when a rule fires
The agent gets one chance to rephrase. If the second attempt also breaks the rule, it falls back to a short safe line instead — and if even that can't pass, the agent says nothing. Blocked speech is never spoken, never written to the transcript, and never remembered as part of the conversation.
If a rule can't be evaluated at all — a broken or deleted set, for example — the agent stays silent rather than speaking unchecked. "We couldn't check it" is never treated as "it's fine."
Blocked speech also cancels that turn's tool calls. Every attempted tool call counts toward the turn limit, including repeats, so a repeated frame cannot trigger an unchecked action. Only checked speech that is actually played becomes part of the transcript and conversation history.
Checks cover both the drafted text and its pronunciation-adjusted spoken form. Pronunciation rules cannot bypass guardrails.
Seeing what fired
Every block records the set, rule, severity and result, with PII redacted.
The public analytics surface provides count-based dimensions rather than raw
blocked speech or caller details. Chart it on an analysis board using the
guardrail source to see which rules fire, on which agents, and how often —
a rule that fires constantly usually needs rewriting, not celebrating.
Removing a set
A set that's still attached to an agent can't be archived; the error lists what's using it. Detach it everywhere first. Archiving keeps the slug reserved.
Guardrails reduce the chance of disallowed output. Keep authorization, business validation and transaction controls in your own systems, and review policies with the people responsible for them.
If an older set returns configuration_errors, replace its complete
definition with a corrected one before release. Promotion and deployment
validate references and budgets again. A set still in use cannot be archived
(guardrail_set_in_use); detach it first. Use the returned ETag when
editing so you do not overwrite a teammate's changes.
See also
Agents · Transfers & call actions · Pronunciation · Analysis boards