Guardrails
Guardrails let you define defensive behavior rules for the agent: which topics or responses it must avoid, how many violations it tolerates per conversation and per customer, and what message to show when a rule is broken.
The workspace-level whitelist of allowed terms is managed separately — see Guardrails whitelist .
Get Guardrails
GET https://api.platica.mx/v1/agents/{agentId}/guardrails URL parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
agentId | string | Unique identifier of the agent | ✓ |
Response
{
"enabled": true,
"rules": [
"No prometas reembolsos automáticos",
"No menciones precios fuera de la lista oficial"
],
"message": "Lo siento, no puedo ayudarte con eso.",
"conversationStrikeThreshold": 3,
"clientStrikeThreshold": 5
} Response fields
| Field | Description |
|---|---|
enabled | Whether guardrails are active |
rules | List of natural-language rules (maximum 20) |
message | Message sent to the customer when a rule is violated |
conversationStrikeThreshold | Maximum violations allowed in a single conversation (1-10) |
clientStrikeThreshold | Maximum violations allowed historically per customer (1-10) |
Update Guardrails
Every field is optional — only the ones present in the body are updated.
PATCH https://api.platica.mx/v1/agents/{agentId}/guardrails URL parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
agentId | string | Unique identifier of the agent | ✓ |
Request body
{
"enabled": true,
"rules": [
"No prometas reembolsos automáticos",
"No menciones precios fuera de la lista oficial"
],
"message": "Lo siento, no puedo ayudarte con eso.",
"conversationStrikeThreshold": 3,
"clientStrikeThreshold": 5
} | Parameter | Type | Description | Validation |
|---|---|---|---|
enabled | boolean | Turn guardrails on/off | — |
rules | array of strings | Natural-language rules | Maximum 20 entries, none empty |
message | string | Message sent to the customer when a rule is violated | Maximum 500 characters |
conversationStrikeThreshold | integer | Maximum violations per conversation | Integer between 1 and 10 |
clientStrikeThreshold | integer | Maximum violations per customer | Integer between 1 and 10 |
Response
{
"status": "success",
"message": "Agent guardrails updated successfully",
"data": {
"enabled": true,
"rules": [
"No prometas reembolsos automáticos",
"No menciones precios fuera de la lista oficial"
],
"message": "Lo siento, no puedo ayudarte con eso.",
"conversationStrikeThreshold": 3,
"clientStrikeThreshold": 5
}
} data always reflects the full guardrails state after the merge, not just the updated fields.