User and operator guide · Developer

Atlas Vector Language Tutorial

Status: currentReviewed: 2026-07-16Audience: developers, identity engineers, security operators
On this pageThe mental model in one minuteLevel 1 — A single conditionLevel 2 — Combining conditionsLevel 3 — Comparisons and numbersLevel 4 — Text: producing valuesLevel 5 — Handling missing dataLevel 6 — Lists and membershipLevel 7 — Time-based rulesLevel 8 — Selecting reviewersLevel 9 — AssignmentsLevel 10 — DecisionsLevel 11 — Putting it all togetherLevel 12 — Refactoring for readabilityCommon patternsWhere to go next

This is a hands-on tutorial for writing policies in the Atlas Vector Language (AVL). It starts from a one-line group rule and builds, level by level, to a complete authorization decision. Read the Atlas Vector Language overview first for the mental model; keep the Atlas Vector Language Specification open as the reference when you want the exact rule for something.

Every example here is a real AVL expression. You author and validate them in Vector Studio (/security/vector-studio), which shows the canonical form, the result type, the static cost, and the attributes each expression reads before you activate it.

The mental model in one minute

An AVL expression reads a typed snapshot of an identity (and its context) and returns one typed result. It never acts — a policy computes an answer, and an Atlas service acts on it:

AVL computes; Atlas services act.

Two ideas shape everything below:

  • The context pack is the contract. Each use case — group membership, a SAML attribute, an authentication decision — has a context pack that fixes two things: the roots you may read (user, device, resource, …) and the result type you must return (a Boolean, a string, a list, a decision). Reading an undeclared root or returning the wrong type is a compile error, caught before activation.

  • Missing data is null, not a crash. If an attribute is absent, reading it yields null, and AVL propagates that through the expression with predictable three-valued rules. You handle absence explicitly (Level 5 — Handling missing data) rather than defending against exceptions.

Each level below notes which pack it applies to and that pack’s failure mode — what Atlas does if the expression errors or returns null (for example, "omit the attribute" or "deny").

Level 1 — A single condition

The simplest policy is a yes/no question about an identity. This is a GROUP_MEMBERSHIP rule: it returns a Boolean, and Atlas evaluates it per user to decide membership in a dynamic group.

user.department == "Engineering"

Read it aloud: "the user’s department equals Engineering." user is a root the pack declares; .department is an attribute in your directory’s profile schema; == compares them; the result is a Boolean.

Some attributes are enums — a fixed set of symbolic values. Enum symbols are written in UPPER_SNAKE_CASE and compare equal to the string of the same text, so both of these are valid and mean the same thing:

user.status == ACTIVE
Tip

If you misspell an attribute, Vector Studio rejects the expression and suggests the closest match (departmnet → "did you mean department?"). You never activate a rule that reads a field that does not exist.

Level 2 — Combining conditions

Real rules combine conditions with and, or, and not. Use parentheses when you want to be explicit about grouping.

user.department == "Engineering" and user.status == ACTIVE
user.clearance == "TS" or user.clearance == "TS/SCI"
user.department == "Engineering" and not (user.status == SUSPENDED)

and and or are short-circuit: false and X is false without evaluating X. Precedence runs or lower than and lower than not, so a or b and c means a or (b and c) — parenthesize when in doubt.

AVL also accepts friendly aliases if you prefer them; they compile to exactly the same policy:

Friendly Canonical

=

==

&&

and

`pass:[

]`

or

!

not

Level 3 — Comparisons and numbers

Beyond equality, you can order values with <, <=, >, >=, and do arithmetic with + - * / %. Ordered comparison requires both sides to be the same kind (both numbers, both strings, both timestamps).

user.failedLoginCount >= 5

Comparisons are non-associative — you cannot write 1 < x < 10. Chain them with and instead, which also reads more clearly:

user.riskScore >= 40 and user.riskScore < 70

Level 4 — Text: producing values

Not every policy answers yes/no. A PROFILE_MAPPING, SAML_ATTRIBUTE, or OIDC_CLAIM expression produces a value — the username to master, the assertion attribute to emit, the token claim to include. Its failure mode is omit: if the expression returns null or errors, the value is simply left out rather than a wrong value being emitted.

The string library is the workhorse here. Concatenate with +, and clean up with lower, upper, trim, and collapseSpaces:

lower(source.givenName + "." + source.surname)

That masters Ada and Lovelace into ada.lovelace. Two purpose-built helpers handle the most common identity shapes:

normalizeEmail(source.mail)
usernameFromEmail(user.email)

normalizeEmail lowercases and trims, returning null if the value is not email-shaped (so a malformed source value is omitted, not emitted). usernameFromEmail takes the local part before the @.

For readability, seven functions can be written infix — endsWith(a, b) may be written a endsWith b:

user.email endsWith "@agency.gov"

When you need pattern matching, matches takes a regular expression (the pattern must be a literal string):

matches(user.employeeId, "^[0-9]{6}$")

Level 5 — Handling missing data

Directories are messy: attributes go missing. In AVL a missing attribute is null, and you decide what that means — you never get a runtime surprise. The core helpers are coalesce (first non-null), defaultTo (value or fallback), and isNull.

Fall back through a chain of preferences:

coalesce(user.preferredName, user.givenName, "Unknown")

Supply a default for a single attribute:

defaultTo(user.title, "Staff")

Two rules keep null behavior predictable:

  • == and != do not propagate null: user.title == null is a normal true/false test. The readable form is is null / is not null.

  • Ordered comparisons (<, >, …) on a possibly-null attribute yield null. Wrap the attribute in coalesce (or guard with is not null) so the comparison is well-defined:

user.contractEndDate is not null and user.contractEndDate > now()

Level 6 — Lists and membership

List-valued attributes (groups, roles, entitlements) have their own operators and functions. Test membership with in, and compare whole lists with intersects:

"platform-admins" in user.groups
intersects(user.roles, ["approver", "reviewer", "release-manager"])

intersects is true when the two lists share any element — a compact "does the user hold at least one of these roles?" Other list functions: size (count), isEmpty, first, distinct (dedupe), and contains (which also works on lists: contains(user.groups, "auditors")).

size(user.activeSessions) > 3

Level 7 — Time-based rules

Some memberships track the wall clock, not any attribute: "hired within 90 days," "contract expired." AVL provides now() — the single pinned evaluation timestamp — plus timestamp math (daysBetween, addDays), durations (days, hours, minutes), and the comparisons before, after, and within.

New hires, as a dynamic group:

daysBetween(user.hireDate, now()) <= 90

Everyone whose contract has lapsed:

user.contractEndDate before now()

Reviewed within the last year (within tests that a timestamp is within a duration of now):

within(user.lastAccessReview, days(365))
Note

A temporal GROUP_MEMBERSHIP rule’s membership changes as time passes even when nothing about the user changes. Atlas re-evaluates temporal rules on a schedule so membership tracks the boundary, rather than only when an attribute is edited.

Level 8 — Selecting reviewers

A REVIEWER_SELECTION expression returns a List<String> — the identities that must approve a step. Its failure mode is hold the step (it never auto-approves), so a broken rule pauses the workflow rather than waving something through.

The simplest form is a literal list:

["isso-lead", "security-officer"]

More usefully, choose the reviewers from context with if … then … else (which is an expression — it returns a value):

if resource.classification == "TS"
then ["isso-lead", "security-officer"]
else ["team-lead"]

Level 9 — Assignments

An APP_ASSIGNMENT expression returns an assignment { … } object — Atlas’s structured answer to "should this identity get this application, and with what entitlements?" The effect field is required; the rest is optional.

if user.department == "Finance"
then assignment {
  effect: ASSIGN,
  entitlementSet: "finance-standard",
  reason: "department-based baseline access"
}
else assignment { effect: NOT_APPLICABLE }

ASSIGN, UNASSIGN, and NOT_APPLICABLE are the assignment effects. Returning NOT_APPLICABLE (rather than UNASSIGN) means "this rule has no opinion" — it excludes the subject from the rule’s automation without actively removing access.

Level 10 — Decisions

The most powerful result is a decision { … } — used by AUTHENTICATION_POLICY (the sign-in gate) and AUTHORIZATION_POLICY (the policy decision point). A decision carries an effect (required) and optional fields: requiredAssurance, obligations, reason, advice, sessionDurationSeconds, and confidence.

A minimal authentication decision:

if user.status == ACTIVE
then decision { effect: ALLOW }
else decision { effect: DENY, reason: "account is not active" }

The real value is step-up: raise the required assurance level and attach obligations the session must satisfy. AAL1/AAL2/AAL3 are the assurance levels; obligation symbols are open (any UPPER_SNAKE_CASE name your enforcement point understands):

if device.managed == true
then decision { effect: ALLOW, requiredAssurance: AAL2 }
else decision {
  effect: ALLOW,
  requiredAssurance: AAL3,
  obligations: [REQUIRE_MANAGED_DEVICE]
}
Important

Decisions are directional by pack. An AUTHENTICATION_POLICY decision can only strengthen the sign-in requirement (raise the assurance, add step-up) — it never weakens it. An AUTHORIZATION_POLICY decision overlays the policy decision point and can only further-restrict — it can deny or raise assurance, never grant what the base decision denied. Both packs' failure mode is deny.

Level 11 — Putting it all together

Now combine the pieces into one realistic authorization policy. It reads resource sensitivity, device posture, risk, and time; and it returns a decision that defers with obligations when the context is risky and allows otherwise:

if resource.classification in ["TS", "TS/SCI"]
   and not (device.managed == true and risk.level == "low")
then decision {
  effect: DEFER,
  requiredAssurance: AAL3,
  obligations: [REQUIRE_MANAGED_DEVICE, REQUIRE_STEP_UP],
  reason: "high-sensitivity resource from an unmanaged or elevated-risk context"
}
else decision { effect: ALLOW }

Walk through it the way the checker does: the condition is a Boolean (a membership test and-ed with a negated posture test); both branches of the if return a decision, so the whole expression is a decision, which is exactly what the AUTHORIZATION_POLICY pack requires. Every root it reads — resource, device, risk — is one the pack declares. If any attribute is missing at evaluation time, the null rules make the posture test fail safe toward the stricter branch.

Level 12 — Refactoring for readability

AVL is designed so the readable spelling and the precise spelling compile to the same policy. Two expressions that canonicalize identically produce the identical compiled artifact — so you can optimize for humans without changing behavior. Compare:

endsWith(user.email, "@agency.gov") == true and (user.department != null)

with the equivalent, friendlier:

user.email endsWith "@agency.gov" and user.department is not null

Both produce the same result type, the same dependencies, and the same pinned artifact. Prefer the second — reviewers read policies far more often than they write them.

Common patterns

You want to… Idiom

Test one attribute

user.department == "Engineering"

Combine conditions

A and B, A or B, not A

A range

x >= lo and x < hi

Fall back through preferences

coalesce(a, b, "default")

Treat missing as a value

defaultTo(user.title, "Staff")

Guard a nullable comparison

x is not null and x > now()

Membership in a list

"role" in user.roles

Share any element

intersects(user.roles, […​])

Master a username

lower(source.givenName + "." + source.surname)

Normalize an email

normalizeEmail(source.mail)

"Within N days"

daysBetween(user.hireDate, now()) <= 90

Choose reviewers

if cond then […​] else […​]

Grant an application

assignment { effect: ASSIGN, entitlementSet: "…​" }

Require step-up

decision { effect: ALLOW, requiredAssurance: AAL3, obligations: […​] }

Where to go next

  • The Atlas Vector Language overview maps each context pack to the enforcement surface it drives and its failure mode.

  • The Atlas Vector Language Specification is the exact reference: the full grammar, the type and null rules, every builtin, each pack’s contract, and the resource limits.

  • Author and validate any expression here in Vector Studio (/security/vector-studio) — it type-checks against your live directory schema, shows the dependencies and cost, and only lets you activate an expression that compiles.