Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.kaireonai.com/llms.txt

Use this file to discover all available pages before exploring further.

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. Supports optimistic concurrency via rowVersion.

Request Body

FieldTypeRequiredDescription
keystringYesGuardrail key to update
namestringNoUpdated name
descriptionstringNoUpdated description
typestringNoGuardrail type
configobjectNoType-specific configuration
conditionsanyNoCondition definitions
priorityintegerNoEvaluation priority (0+)
severitystringNo"hard" or "soft"
expressionAstobjectNoUpdated expression AST
statusstringNo"draft", "active", "paused", or "archived"
scopestringNoGuardrail scope
rowVersionintegerNoOptimistic concurrency check. If provided and does not match the current version, returns 409 Conflict.

DELETE /api/v1/guardrails

Soft-delete a guardrail by key.

Query Parameters

ParameterTypeRequiredDescription
keystringYesGuardrail key to delete

Response 200

{ "success": true }