Skip to Content
Tracira
API referenceRules

Evaluate a rule

Runs one rule against an output without storing a output. Useful for testing a rule before enabling it.

posthttps://www.tracira.com/api/rules/evaluate
POST
/api/rules/evaluate

Authorization

sessionAuth
cookiebetter-auth.session_token<token>

Browser session cookie used by logged-in Tracira users. Secure-prefixed variants may also be used by the browser.

Request Body

application/json
  1. body
output*string
confidence?|
Range0 <= value <= 1
rule*

Response Body

Evaluation result.

application/json
  1. response
verdict*string
Value in"pass""fail""unsure"
confidenceScore*number
explanation*string
status*string
Value in"pass""flagged""error"
appliedRules*array<>
Example Request
curl -X POST 'https://www.tracira.com/api/rules/evaluate' \  -H 'Content-Type: application/json' \  -d '{  "output": "Sure, I can give you a full refund right away.",  "confidence": 0.62,  "rule": {    "name": "No refund promises",    "type": "keyword_forbidden",    "value": "refund"  }}'
Example Response
{  "verdict": "pass",  "confidenceScore": 0,  "explanation": "string",  "status": "pass",  "appliedRules": [    {      "ruleId": "string",      "ruleName": "string",      "ruleType": "keyword_required",      "ruleValue": "string",      "scope": "global",      "projectName": "string",      "taskName": "string",      "outcome": "passed",      "summary": "string",      "evaluator": "deterministic",      "model": "string",      "llmOutput": "string"    }  ]}