Skip to main content

POST /api/v1/guardrails

Create a guardrail rule.

Request Body

FieldTypeRequiredDescription
keystringYesUnique guardrail key
namestringYesGuardrail name
descriptionstringNoDescription of the constraint
severitystringNo"hard" (blocks decision, default) or "soft" (warns only)
expressionAstobjectNoExpression AST defining the guardrail condition
statusstringNo"active" (default) or "paused"

Example

curl -X POST https://playground.kaireonai.com/api/v1/guardrails \
  -H "Content-Type: application/json" \
  -H "X-Tenant-Id: my-tenant" \
  -d '{
    "key": "max-daily-spend",
    "name": "Maximum Daily Spend Guard",
    "description": "Prevents decisions that would exceed daily budget allocation",
    "severity": "hard",
    "status": "active"
  }'

Response

{
  "id": "gr_abc123",
  "key": "max-daily-spend",
  "name": "Maximum Daily Spend Guard",
  "description": "Prevents decisions that would exceed daily budget allocation",
  "severity": "hard",
  "expressionAst": {},
  "status": "active",
  "tenantId": "my-tenant",
  "createdAt": "2026-03-17T10:00:00Z",
  "updatedAt": "2026-03-17T10:00:00Z"
}

GET /api/v1/guardrails

List all guardrails for the tenant.

Response

Returns an array of guardrail objects.

PUT /api/v1/guardrails

Update a guardrail by key.

Request Body

FieldTypeRequiredDescription
keystringYesGuardrail key to update
namestringNoUpdated name
descriptionstringNoUpdated description
severitystringNoUpdated severity
expressionAstobjectNoUpdated expression AST
statusstringNoUpdated status

DELETE /api/v1/guardrails

Delete a guardrail by key.

Query Parameters

ParameterTypeRequiredDescription
keystringYesGuardrail key to delete
Response: 204 No Content