Skip to main content
The webchat.guardrail.triggered webhook event is triggered whenever one or more guardrails are activated on an AI response in a webchat session. This can be used to monitor compliance, safety, or business rule violations in your webchat assistant.

Payload

{
  "event": "webchat.guardrail.triggered",
  "data": {
    "sessionId": "550e8400-e29b-41d4-a716-446655440000",
    "orgId": "org-abc123",
    "profile": "Default Profile",
    "origin": "https://example.com/pricing",
    "messageId": "msg_a3c5e7f9",
    "violatedGuardrails": ["741d2650-f2ff-4842-ba70-af7343d5c464"],
    "blockedContent": "The original AI response that triggered the guardrail.",
    "sanitizedContent": "The replacement message that was actually shown to the visitor.",
    "createdAt": "2024-01-15T14:30:00Z"
  },
  "timestamp": "2024-01-15T14:30:00Z"
}

Properties

PropertyTypeDescription
eventstringThe webhook event type (webchat.guardrail.triggered).
data.sessionIdstringThe unique identifier for the webchat session.
data.orgIdstringThe Apten organization ID that owns the session.
data.profilestringThe name of the webchat profile that handled the session.
data.originstringThe URL of the page where the webchat widget was opened. Only included if set.
data.messageIdstringThe unique identifier for the message that triggered the guardrail.
data.violatedGuardrailsstring[]Array of guardrail IDs that were triggered.
data.blockedContentstringThe original AI response that was blocked by the guardrail.
data.sanitizedContentstringThe replacement message that was shown to the visitor.
data.createdAtstringThe ISO 8601 timestamp when the guardrail was triggered.
timestampstringThe ISO 8601 timestamp when the webhook was sent.