aethexDocs

Guardrails

Guardrails are safety settings that keep your agent on topic and professional during a call. They live on the agent, so you set them once and they apply to every call that agent handles. There are three: a focus guardrail, a content guardrail, and script adherence.

How guardrails work

Each guardrail adds a rule to the instructions your agent follows on a call. When a caller does something a guardrail covers, like drifting off topic or turning abusive, the agent steers the conversation back or gives a calm, neutral reply instead of going along with it. You switch each guardrail on or off with a setting on the agent, without touching your prompt.

FocusONon by defaultContentOFFoff by defaultScript adherencestrictmediumlooseThree independent settings, each with a sensible default.

Focus guardrail

The focus guardrail keeps callers from pulling the agent off its job. If someone asks about something unrelated to what the agent is for, the agent politely brings the conversation back. This one is on by default. To turn it off, set focus_guardrail_enabled: false on the agent.

Note
What counts as "on topic" comes from your system prompt. The more clearly you describe the agent's job there, the better the focus guardrail can tell a real off-topic request from a valid one.

Content guardrail

The content guardrail blocks harmful, harassing, or abusive language, from both the caller and the agent. When it triggers, the agent responds calmly and neutrally instead of engaging, and if the caller keeps it up, the agent can end the call. This guardrail is off by default. Turn it on with content_guardrail_enabled: true on the agent.

Script adherence

Script adherence controls how closely the agent sticks to a step-by-step call flow you write in its system prompt. Set script_adherence to one of three levels:- `strict` (the default): the agent follows the script word for word.
- `medium`: the agent keeps to the plan but can rephrase in its own words.
- `loose`: the agent treats the script as a rough guide.

Enabling guardrails

This request turns both guardrails on and sets script adherence to medium on an agent you already created. Swap $AGENT_ID for your agent's id.

Turn guardrails on for an existing agent
bash
curl -X PATCH https://api.aethexai.com/api/v1/agents/$AGENT_ID \
  -H "X-API-Key: $AETHEX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "focus_guardrail_enabled": true,
    "content_guardrail_enabled": true,
    "script_adherence": "medium"
  }'

Next

Guardrails work best alongside a clear system prompt. See the Agents concept page for tips on writing one.