Deploy Custom Rule
deploy_ruleDeploy a custom evaluation rule that persists and activates immediately, firing on every future evaluate_output call for its bundle with audited severity-based scoring.
Instructions
Deploy a custom rule that fires on every future evaluate_output call of its bundle — persisted, active immediately, audited.
What it does. Stores the rule and loads it into the running engine. eval_type says WHEN it fires (that bundle, and eval_type="all"); severity says what a failure does: low and medium lower the score, high and critical fail the verdict. definition.type picks the check, definition.config its keys. A taken name is refused unless replace is true. Full detail: iris://capabilities.
When not to use it. For a one-off check (custom_rules on evaluate_output). To pause a rule (delete_rule with enabled: false).
Returns. JSON: rule, replaced, warning.
Errors. IRIS_DUPLICATE_RULE; IRIS_INVALID_RULE_CONFIG, naming the field; IRIS_STORAGE_ERROR. Failures return {"error":{code,message,recovery}} with isError; follow recovery.
Siblings. list_rules — see what is deployed; delete_rule — remove or disable; evaluate_output — where it fires.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Rule name, 1-80 letters, digits, dots, dashes and underscores (used in eval results). Must be unique among deployed rules unless replace=true | |
| replace | No | true replaces a deployed rule of the same name (fresh id, audit kept); false (default) refuses | |
| evalType | No | camelCase alias of eval_type, accepted for compatibility — prefer eval_type (snake_case is canonical across the tools) | |
| severity | No | What a FAILURE of this rule means. low/medium: informational — contributes to the weighted score only (plus dashboard sort + audit alerts). high/critical: hard-fail — a failing evaluation of this rule forces the overall passed=false regardless of the weighted score | medium |
| eval_type | No | The bundle this rule fires in (and on eval_type="all"); pass one of eval_type / evalType | |
| definition | Yes | The check: type, config and optional weight; an unknown key is rejected | |
| description | No | What this rule checks for and why it matters | |
| sourceMomentId | No | camelCase alias of source_moment_id, accepted for compatibility — prefer source_moment_id | |
| source_moment_id | No | Optional id of the Decision Moment this rule came from; pass one of source_moment_id / sourceMomentId |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rule | Yes | ||
| warning | No | ||
| replaced | No |