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

ParameterTypeDescriptionRequired
agentIdstringUnique 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

FieldDescription
enabledWhether guardrails are active
rulesList of natural-language rules (maximum 20)
messageMessage sent to the customer when a rule is violated
conversationStrikeThresholdMaximum violations allowed in a single conversation (1-10)
clientStrikeThresholdMaximum 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

ParameterTypeDescriptionRequired
agentIdstringUnique 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
}
ParameterTypeDescriptionValidation
enabledbooleanTurn guardrails on/off
rulesarray of stringsNatural-language rulesMaximum 20 entries, none empty
messagestringMessage sent to the customer when a rule is violatedMaximum 500 characters
conversationStrikeThresholdintegerMaximum violations per conversationInteger between 1 and 10
clientStrikeThresholdintegerMaximum violations per customerInteger 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.