Skip to content

CLI: evaluate

kairos evaluate performs a single stateless Substrate evaluation. It loads a calibration artifact and deployment policy, validates the license, and evaluates a request JSON.

Terminal window
kairos evaluate \
--config artifact.json \
--policy policy.json \
[--license license.key] \
[--request request.json]
FlagRequiredDescription
--configYesPath to the calibration artifact JSON
--policyYesPath to the deployment policy JSON
--licenseNoPath to the license key file (default: ~/.kairos/license.key)
--requestNoPath to the request JSON (reads stdin if omitted)

The request JSON must be an EvaluationRequest envelope:

{
"envelopeVersion": 1,
"requestId": "eval-001",
"snapshot": {
"timestamp": "2026-03-21T12:00:00.000Z",
"metrics": {
"primaryRiskMetric": 450.0,
"primaryStabilityMetric": 72.0
}
}
}

The snapshot.metrics object must include the metric keys expected by your deployment’s calibration artifact.

The command prints the EvaluationResponse as pretty-printed JSON to stdout:

{
"envelopeVersion": 1,
"requestId": "eval-001",
"decision": "PASS",
"reasonCode": "NONE",
"mode": "state_gate",
"policyVersion": 1,
"adapterVersion": 1,
"evaluation": {
"currentGamma": 0.68,
"gammaFloor": 0.20,
"currentLambda": 0.89,
"stability": 2.40,
"predictedGamma": null
},
"escalation": null,
"overrideOutcome": null,
"timestamp": "2026-03-21T12:00:00.500Z"
}

When --request is omitted, the command reads from stdin:

Terminal window
cat request.json | kairos evaluate --config artifact.json --policy policy.json
Terminal window
echo '{"envelopeVersion":1,"requestId":"r1","snapshot":{"timestamp":"2026-03-21T12:00:00Z","metrics":{"primaryRiskMetric":450,"primaryStabilityMetric":72}}}' \
| kairos evaluate --config artifact.json --policy policy.json

Errors are printed to stderr with a non-zero exit code:

ErrorCause
failed to load calibration artifactInvalid or missing artifact file
failed to load deployment policyInvalid or missing policy file
failed to parse request JSONMalformed request
License validation errorsExpired, missing, or fingerprint mismatch
  • evaluate performs a single stateless evaluation.
  • For live dashboards and stateful telemetry, use kairos observe.