Overview
Yggdrasil supports 12 core operators for building rule conditions. Each operator handles type coercion automatically for CSV string values.Supported Operators
| Operator | Aliases | Description | Example |
|---|---|---|---|
>= | greater_than_or_equal, gte | Greater than or equal | amount >= 10000 |
> | greater_than, gt | Greater than | amount > 5000 |
<= | less_than_or_equal, lte | Less than or equal | amount <= 1000 |
< | less_than, lt | Less than | amount < 10000 |
== | equals, eq, equal | Equality (with type coercion) | status == "approved" |
!= | not_equals, neq, ne, not_equal | Inequality | type != "CASH_OUT" |
IN | — | Set membership | type IN ["DEBIT", "WIRE"] |
BETWEEN | — | Range check [min, max] | amount BETWEEN [8000, 10000] |
exists | — | Field is present and non-empty | email exists |
not_exists | — | Field is missing or empty | dpo_contact not_exists |
contains | includes | Case-insensitive substring match | description contains "crypto" |
MATCH | regex | Regular expression test | email MATCH "^[a-z]+@" |
Operator Normalization
The engine normalizes operator aliases from LLM extraction to standard forms:Numeric Comparisons
Operators:>=, >, <=, <
Numeric comparisons use parseFloat() on both sides to handle CSV string values:
Example
amount >= 10000.
Equality Operators
Operators:==, !=
Equality uses type coercion to handle CSV string values:
Type Coercion Examples
| CSV Value | Rule Value | Match? |
|---|---|---|
"true" | true | ✅ |
"false" | false | ✅ |
"16" | 16 | ✅ |
"10000" | 10000 | ✅ |
"approved" | "approved" | ✅ |
Set Membership
Operator:IN
Checks if a value exists in an array:
Example
transaction_type is one of the listed values.
Range Check
Operator:BETWEEN
Checks if a value is within a range (inclusive):
Example
8000 <= amount <= 10000.
Existence Operators
Operators:exists, not_exists
These operators test for field presence/absence before checking for null:
Example: Required Field
dpo_contact is present and non-empty.
Example: Missing Field
consent_withdrawn is missing or empty.
String Matching
Contains
Operator:contains (alias: includes)
Case-insensitive substring match:
Regex
Operator:MATCH (alias: regex)
Regular expression test:
Cross-Field Comparison
You can compare two fields usingvalue_type: "field":
Example: Balance Mismatch
newbalanceOrig to the expectedBalance field in the same record.
Sanity Checks
The engine includes safety guards to prevent false positives:exists/not_exists).
Compound Conditions
Operators can be combined withAND/OR logic:
Type Coercion Summary
| CSV Input | Expected Type | Coercion |
|---|---|---|
"true" | boolean | true |
"false" | boolean | false |
"123" | number | 123 |
"10000.50" | number | 10000.5 |
"approved" | string | "approved" |
Error Handling
Unknown operators are logged and returnfalse:
Next Steps
Rule Types
Learn when to use WINDOWED vs SINGLE-TX
Architecture
Understand the execution flow