Values and identities
Facts, rule conditions, and authorization checks use two kinds of concrete values:
- Typed identities (
User:alice,Document:123) reference domain entities. - Primitive constants (
"read",3,true) represent scalar values such as action names, counts, and flags.
Typed identities
Section titled “Typed identities”A typed identity pairs an uppercase entity type (PascalCase) with an ID using TypeName:id syntax:
is_owner(User:sam, Document:sam);Both the type and the ID must match. Even though User:sam and Document:sam share the ID "sam", they are distinct values and never match each other.
The ID after the colon is always treated as a string, even when written with digits (Document:123). If an ID contains characters outside standard letters, digits, and underscores (such as @, -, or spaces), wrap the ID in double quotes:
is_owner(User:"sam@example.com", Document:"q3-roadmap");Use the exact same type and ID format when writing facts and enforcing decisions. See the Language Reference for character and escaping rules.
Primitive constants
Section titled “Primitive constants”Use primitive literals for values that are not entity references:
| Type | Examples | Common uses |
|---|---|---|
string | "read", "published" | Action names, roles, statuses, and labels |
int | 3, 100 | Counts, versions, clearance levels, timestamps |
boolean | true, false | Explicit two-state flags |
allow(user: User, "read", document: Document) if is_owner(user, document) and publication_status(document, "published") and clearance_level(user, 3);Verdict never coerces values across types: the identity Document:3, the integer 3, and the string "3" are three distinct values.
Next steps
Section titled “Next steps”- Connect values across conditions with variables in Variables and matching.
- Compare numeric and boolean properties in Attributes.
- Compare missing facts with explicit
falsebooleans in Negation and missing facts.