APIPolicies

Evaluate CEL expression

Evaluate a CEL expression against a sample context.

POST
/policies/cel/evaluate

Evaluate a CEL expression against a sample context.

Authorization

ApiKeyAuth
headerAuthorizationBearer <token>

Bearer token authentication. Send an API key (a saai_api_-prefixed token) as Authorization: Bearer <token>.

Required permission

view_policies

Request Body

application/json
  1. body
expression*string

CEL expression to evaluate

Length1 <= length
context*

The policy context to evaluate the expression against.

Response Body

The request has succeeded.

application/json
  1. response
match*boolean

Whether the expression matched (returned true)

error?string

Error message if evaluation failed

curl -X POST "https://example.com/policies/cel/evaluate" \  -H "Content-Type: application/json" \  -d '{    "expression": "string",    "context": {      "agent": {        "id": "string",        "name": "string",        "slug": "string"      },      "user": {        "id": "string",        "name": "string",        "email": "string",        "groups": [          "string"        ]      },      "mcp": {        "id": "string",        "name": "string",        "slug": "string"      }    }  }'
{  "match": true,  "error": "string"}