Labels
Labels let you name rules and reference them from other rules, enabling composable policies.
Very Important Labels cannot have spaces in them.
Defining Labels
Add a label before the article. The label ends with a period:
AgeCheck. A **Person** passes the age check if __age__ of **Person** is greater than or equal to 18.Labels can use dot notation for hierarchical naming:
theory.check. A **Person** passes the theory test if __theory_score__ of **Person** is greater than or equal to 43.
practical.check. A **Person** passes the practical test if __practical_score__ of **Person** is greater than or equal to 40.Referencing Labels with §
Use § (or $) to reference a labeled rule from another rule:
A **Person** passes the full test if §theory.check passes and §practical.check passes.The § reference evaluates the referenced rule and uses its result as a condition.
Label Predicates
When referencing a label, you can use a predicate to describe the expected outcome:
| Predicate | Example |
|---|---|
passes | §ageCheck passes |
succeeds | §theory.check succeeds |
clears | §backgroundCheck clears |
qualifies | §eligibility qualifies |
meets requirements | §minimumAge meets requirements |
satisfies | §criteria satisfies |
is valid | §emailCheck is valid |
is approved | §review is approved |
has passed | §exam has passed |
is authorized | §access is authorized |
is certified | §training is certified |
is permitted | §action is permitted |
is satisfied | §condition is satisfied |
Full Example
Interactive Example
Policy Rule
Test Data (JSON)
Try changing status to "suspended" — the age check will pass but the status check will fail, causing the overall rule to fail.
Rule References (without labels)
You can also reference rules by their outcome, without using labels:
A **user** passes the age check if __age__ of **user** is greater than or equal to 18.
A **user** is eligible if the **user** passes the age check.This form matches the rule by its selector and outcome text.