Screen Chat

Analyze chat messages against a policy.

POST /guards/v1/chat

Send 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.

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.

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
  }'