Skip to main content
This page describes the shape of policies and rules: their fields, actions, operators, condition fields, and validation results. Get policy schema is documented to return the same lists in machine-readable form.

Policy fields

Rule fields

Actions

Approver id and type values come from List approver candidates. Roles include owner, admin (shown as Manager), treasury_officer, compliance_officer, internal_auditor, operator, signer, developer, and viewer.
Alert target type is email, slack, or webhook. For slack and webhook, value must be an https:// URL. Approvals expire after 24 hours by default, reported as expiry_hours in a dry-run. Saving a rule rejects an unknown action_config key with unknown_action_config_field, and a missing required key with invalid_action_config.

Operators

Not every operator works on every field. Each entry in condition_fields lists its valid_operators.

Condition values

  • Scalar operators take one value in value. Send numbers as strings, for example "10000", never as floats.
  • Range operators take min and max as separate fields. Don’t send a bracketed array.
  • Set operators take a list in values.
  • greater_than and less_than exclude the boundary. Use the _or_equal forms to include it.

Condition fields

The fields a condition can compare are the request attributes the engine evaluates. These are the same as the fields of Dry-run policy evaluation: Saving a rule with a field not on this list returns 400 invalid_condition_field. Numeric values are stored and returned as numbers.

Evaluation results

The result field of a dry-run response: The API reference also lists matched_rule and no_match. Branch on allowed first, and on result for the reason. reason is a readable sentence that names the policy and rule, for example “Blocked by policy Transfer limits / rule Block over $50,000”. Log it, but don’t parse it.

Validation diagnostics

Validate in-flight rule array and Validate stored draft policy return a diagnostics list and an issue_count by severity. valid is true when there are no errors. Diagnostics come in two tiers. Tier 1 is lexical and syntactic. Tier 2 is about how rules interact, for example a later rule that an earlier rule subsumes, so it can never match:
The validate endpoints check how rules interact. They don’t reject an unknown condition field, an unsupported operator such as gt, or a missing action_config: a rule list with those mistakes comes back valid: true. Those checks happen when you save the rule. Create draft policy and Add rule return 400 with invalid_condition_field, invalid_operator, invalid_action_config, or unknown_action_config_field.

Limits on editing

Dry-run accepts a policy in any status, including archived. Every other write applies to drafts only.