Screen Chat
Analyze chat messages against a policy.
POST
/guards/v1/chatSend chat messages to be evaluated against a policy and receive an action recommendation.
Request Body
messages required
Array of message objects. See the Messages reference for supported types and fields.
policy_handle required
String identifier of the policy to evaluate against.
short_circuit optional
Boolean (default: true). When
true, stops evaluation on first "block" detection for better performance.
{
"messages": [
{
"role": "user",
"content": "What is the weather today?"
}
],
"policy_handle": "default-policy",
"short_circuit": true
}Response
blocked Boolean indicating whether the action is "block". Use this to determine if the chat should be blocked.
action String value: allow, monitor, or block.
policy_handle Echo of the policy handle used for evaluation.
event_id UUID of the logged chat event for auditing.
{
"blocked": false,
"action": "allow",
"policy_handle": "default-policy",
"event_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}Example Request
curl -X POST https://api.guards.giskard.cloud/guards/v1/chat \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"messages": [
{
"role": "user",
"content": "What is the weather today?"
}
],
"policy_handle": "default",
"short_circuit": true
}'