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
Section titled “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 §
Section titled “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
Section titled “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 |
Negated References
Section titled “Negated References”You can check that a labeled rule fails by using a negated predicate:
A **User** is denied if §eligibilityCheck fails.This evaluates the referenced rule and inverts the result — if eligibilityCheck returns false, the negated reference returns true.
| Negated Predicate | Example |
|---|---|
fails | §check fails |
does not pass | §check does not pass |
does not succeed | §check does not succeed |
does not clear | §check does not clear |
does not qualify | §check does not qualify |
does not satisfy | §check does not satisfy |
does not meet requirements | §check does not meet requirements |
is not valid | §check is not valid |
is not approved | §check is not approved |
has not passed | §check has not passed |
is not authorized | §check is not authorized |
is not certified | §check is not certified |
is not permitted | §check is not permitted |
is not satisfied | §check is not satisfied |
You can combine not with a negated predicate for a double negation (which equals the positive check):
not §check failsThis is equivalent to §check passes.
Full Example
Section titled “Full Example”Interactive Example
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)
Section titled “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.