How it works
1
You create a guardrail
Define a
name, a prompt describing what should trigger it, and a response_message. See Creating a Guardrail.2
You attach it to an agent
One guardrail can be attached to many agents. See Attach to Agents.
3
The LLM decides whether to call it
On each turn, the agent’s LLM weighs the user’s message against every attached guardrail’s
prompt and decides whether one applies, exactly like any other tool.4
It fires
The agent speaks the configured
response_message and the turn ends immediately. If a callback_url is set, a guardrail_triggered event is POSTed to it. See Runtime Behavior.A guardrail only fires if the LLM decides to call it. There’s no code-level enforcement forcing the check. Reliability depends heavily on your system prompt explicitly telling the agent to use its guardrails. See Prompting Strategies.
Example categories
category is a free-text field with no fixed list. Use whatever taxonomy makes sense for your workspace. A few common ones to start from:
Verifying a guardrail
There’s no test sandbox for guardrails yet. Attach it to an agent and talk to it directly:- Attach the guardrail to a test agent.
- Start a session and send a message designed to trigger it.
- Confirm the agent responds with your exact
response_message. - If you set a
callback_url, confirm theguardrail_triggeredevent arrived. See Runtime Behavior.
Known limitations
- No single-item fetch. Only
POST(create),GET(list all),PUT(update), andDELETEexist. There’s noGET /ext/guardrail/{id}. - No partial detach. Removing one guardrail from an agent means
PUT-ing the full attached list minus that entry. See Attaching. - No test/sandbox affordance. Verify by attaching and talking to the agent.
What’s Next?
Creating a Guardrail
Field reference, validation rules, and how to write an effective guardrail prompt.
Attach to Agents
Wire a guardrail to one or many agents via the Studio, the API, or PATCH vs PUT.
Runtime Behavior
What actually happens when a guardrail fires, and the
guardrail_triggered webhook payload.Prompting Strategies
Make sure your system prompt actually tells the agent to check its guardrails.