User and operator guide · Developer

Atlas Vector Language Specification

Status: currentReviewed: 2026-07-15Audience: developers, identity engineers, security operators, deployment engineers
On this pageConventionsLexical structureWhitespace and commentsKeywordsIdentifiers and enum symbolsOperators, delimiters, and aliasesInfix wordsLiteralsGrammarPrecedence and associativityNon-associative comparisonsis null / is not nullnot inInfix-word desugaringConstructorsMember access and callsTrailing commasParser limitsType system and static semanticsTypesAssignabilityEnumsEnum-string interoperabilityRoots and attribute access

This page is the reference rendering of the Atlas Vector Language (AVL) normative specification. The authoritative source is Vector Language engine; where this page and that document disagree, the document wins. The specification defines language version 1.0. For the platform integration view — the enforcement surfaces each context pack drives and the lifecycle subsystems behind them — see the Atlas Vector Language page.

AVL answers four classes of questions — transformation, qualification, selection, and decision — and never acts on them. The governing principle is:

AVL computes; Atlas services act.

Conventions

  • Grammar is written in EBNF: { x } = zero or more, [ x ] = optional, | = alternative, "lit" = terminal.

  • "MUST", "MUST NOT", "SHOULD" carry their usual normative force.

  • A diagnostic code (AVL-XXX) names a compile-time or runtime error or warning class; the append-only list is in Diagnostics.

  • Two version identifiers appear in artifacts. LanguageVersion ("1.0") is normative — it is embedded in every compiled artifact and decision trace and is the compatibility contract of this specification. CompilerVersion ("avlc-1.0.1") is non-normative build metadata recorded alongside a stored compilation; it identifies a compiler build, not a language version.

Lexical structure

A source text is UTF-8. Lexing always continues past an invalid token so the parser can keep reporting; an invalid lexeme becomes an ILLEGAL token.

Whitespace and comments

Space, tab, carriage return, and newline are insignificant separators. A comment runs from // to end of line. There are no block comments.

Keywords

There are exactly eleven keywords. Keywords take precedence over identifier/enum classification.

if  then  else  and  or  not  in  is  true  false  null

Identifiers and enum symbols

An identifier matches [A-Za-z_]. After the keyword check, a lexeme is classified as an *enum symbol (ENUM) if and only if every character is in [A-Z0-9_] and it contains at least one uppercase letter; otherwise it is an identifier (IDENT).

  • Enum symbols: ACTIVE, AAL3, REQUIRE_MFA, A_1.

  • Identifiers: user, _x, abc, a1.

  • A lexeme with no uppercase letter (, 123) is never an enum symbol.

An enum symbol carries no intrinsic type; its enum is inferred from the expected type at the use site (see Enums).

Operators, delimiters, and aliases

Canonical operator and delimiter tokens:

==  !=  <  <=  >  >=  +  -  *  /  %  (  )  [  ]  {  }  ,  .  :

The following friendly aliases lex to the same token as their canonical form. The canonical spelling is chosen when the expression is rendered to canonical form (see Canonicalization and checksums).

Alias Canonical

=

==

<>

!=

!

not

&&

and

`pass:[

]`

or

A lone & or | is ILLEGAL.

Infix words

The seven identifiers contains, startsWith, endsWith, matches, before, after, within remain ordinary IDENT tokens, but the parser desugars them in infix position to a same-named function call (see Infix-word desugaring). Everywhere else they are ordinary function names.

Literals

  • String: double-quoted. The only escapes are \", \\, \n, \t. Any other \x is an error; an unterminated string (EOF or newline before the closing quote) is an error. A string literal’s value is the decoded text.

  • Number: [0-9]+ ( "." [0-9]+ )? — decimal, optional single fraction. No sign (a leading - is always the unary-minus operator), no exponent, no hex. A . not followed by a digit is not part of a number (it is member access).

  • Boolean / null: the keywords true, false, null.

  • There is no dedicated duration or timestamp literal. Durations are produced only by days()/hours()/minutes(); timestamps by now()/parseTimestamp() or by coercion of a schema-typed attribute. Timestamp data arrives as RFC 3339 strings and is coerced by declared type.

Grammar

expr           = ifExpr | orExpr ;
ifExpr         = "if" expr "then" expr "else" expr ;      (* else is mandatory *)
orExpr         = andExpr { "or" andExpr } ;
andExpr        = notExpr { "and" notExpr } ;
notExpr        = "not" notExpr | comparison ;
comparison     = additive [ compOp additive | "not" "in" additive | isClause | infixWord additive ] ;
compOp         = "==" | "!=" | "<" | "<=" | ">" | ">=" | "in" ;
isClause       = "is" [ "not" ] "null" ;
infixWord      = "contains" | "startsWith" | "endsWith" | "matches" | "before" | "after" | "within" ;
additive       = multiplicative { ( "+" | "-" ) multiplicative } ;
multiplicative = unary { ( "*" | "/" | "%" ) unary } ;
unary          = "-" unary | postfix ;
postfix        = primary { "." ( ident | enum ) [ "(" args ")" ] } ;
primary        = number | string | "true" | "false" | "null"
               | enum                                     (* enum symbol *)
               | ident [ "(" args ")" ]                   (* root ref or free function call *)
               | ident construct                          (* constructor: lowercase ident only *)
               | "(" expr ")"
               | list ;
list           = "[" [ expr { "," expr } [ "," ] ] "]" ;  (* trailing comma allowed *)
construct      = "{" field { "," field } [ "," ] "}" ;    (* trailing comma allowed *)
field          = ident ":" expr ;
args           = [ expr { "," expr } ] ;                  (* trailing comma NOT allowed *)

Precedence and associativity

Lowest to highest:

Level Construct Associativity

1

if … then … else …

— (all three parts required)

2

or

left

3

and

left

4

prefix not

right (prefix)

5

== != < ⇐ > >= in, not in, is [not] null, infix words

non-associative

6

+ -

left

7

* / %

left

8

prefix - (unary minus)

right (prefix)

9

postfix .attr / .method(…​)

left

10

primary

—

Note the deliberate asymmetry: prefix not is low precedence (not a == b parses as not (a == b)), while unary - is high precedence (-a * b parses as (-a) * b). There is no unary +.

Non-associative comparisons

A comparison level admits at most one comparison. a < b < c is a compile error (comparison operators are non-associative; combine comparisons with 'and'). Chain with and: a < b and b < c.

is null / is not null

x is null desugars to x == null; x is not null desugars to x != null. Only null (or not null) may follow is.

not in

At the comparison level, not is legal only immediately followed by in: a not in b becomes a not-in b. A prefix not elsewhere is handled at level 4.

Infix-word desugaring

a endsWith b desugars to the call endsWith(a, b). The right operand is parsed at additive precedence, so a contains b + c is contains(a, b + c).

Constructors

name { field: value, … } builds a typed object (decision { … }, assignment { … }). The constructor name must be a lowercase identifier. Field names are identifiers; a trailing comma is allowed. Unknown, duplicate, and missing-required fields are diagnosed by the checker, not the parser.

Member access and calls

After a primary, .name is member access; .name(args) is a method-style call whose receiver is the preceding expression. The name after . may be an identifier or an enum symbol. Chains left-associate. A free name(args) (no receiver) is a function call; a bare name is a context root reference.

Trailing commas

Trailing commas are allowed in list literals and constructor bodies and are forbidden in argument lists (the one place they are rejected).

Parser limits

At most 5 diagnostics are emitted per parse; nesting depth is bounded at 500. A bare if used as an operand must be parenthesized.

Type system and static semantics

Types

The kinds are: String, Number, Boolean, Timestamp, Duration, Null (the type of the null literal only), List<T>, Enum<Name>, Object<Name> (a constructor result), and Any (a schema-declared untyped value). All AVL 1.0 types are nullable; null-safety is a checker warning plus runtime propagation, not a separate non-nullable type.

Assignability

  • Null is assignable to every type.

  • Any accepts every type and every type accepts Any (both directions). Any is intended for equality, comparison, and coercion sites.

  • List<T> is covariant in T (a nil element type is a wildcard).

  • Otherwise assignability is structural equality (same kind, same name, recursively equal element type).

Enums

An enum definition has a name, a member list, and an open flag. An open enum admits any enum symbol; a closed enum checks membership (unknown member is AVL-ENUM with a "did you mean" suggestion). The checker resolves an enum symbol’s type from the use-site expected type — comparison against an enum attribute, an enum constructor field, membership in List<Enum>, or the pack result type. An enum symbol with no determinable expected enum type is AVL-ENUM.

Enum-string interoperability

An enum symbol and a string of the same text compare equal, in both directions. This holds at ==/!=, in in/not in, at result validation, and wherever text coercion applies. String functions accept enum arguments (their symbol text).

Roots and attribute access

A bare context root MUST NOT be read — user alone is AVL-CAP (bare root object cannot be read; select an explicit attribute). Only root-anchored dotted paths are readable (user.department, user.clearance). The root must be one the context pack declares (AVL-ROOT, with suggestions); the path must resolve in the schema (AVL-ATTR, with suggestions). The node’s type is the attribute’s declared type.

Operator typing

  • and / or / not: operands must be Boolean (or Any); a Null operand is an AVL-NULL warning (runtime result is null); a non-boolean non-null operand is AVL-TYPE. Result Boolean.

  • == / !=: valid when either side is assignable to the other, or they are an enum/string mix, or either is Any. Result Boolean. A literal-case mismatch such as lower(x) == "MixedCase" raises the AVL-CASE warning.

  • < ⇐ > >=: after null/Any allowance, both operands must be the same orderable kind, one of Number, String, Timestamp, Duration. Result Boolean. A nullable attribute operand not wrapped in coalesce(…​) raises AVL-NULL.

  • Arithmetic:

    • +: Number+Number→Number; String+String→String; Timestamp+Duration→Timestamp; Duration+Duration→Duration; and String + (Number|Boolean|Enum) → String (and the mirror), a friendly concatenation coercion.

    • -: Number−Number→Number; Timestamp−Timestamp→Duration; Timestamp−Duration→Timestamp; Duration−Duration→Duration.

    • * / %: Number only, to Number.

    • An Any/Null operand yields Any. Otherwise AVL-TYPE.

  • in / not in: the right side must be List<T> (or Any/Null); the left must be assignable to T (or an enum/string mix). Result Boolean.

  • unary -: operand Number (or Any/Null), to Number.

if

The condition must be Boolean (a Null condition is an AVL-NULL warning: the runtime errors). The branches are unified: equal produces that type; one Null produces the other; either Any produces Any; assignable produces the wider; otherwise AVL-TYPE. The pack’s expected result type propagates into both branches.

Lists

A list literal’s element type is the fold of the non-null element types; an empty or all-null list takes the expected element type or Any.

Constructors (checking)

The constructor must be declared by the context pack (AVL-CONSTRUCT). Unknown field, duplicate field, and missing required field are AVL-CONSTRUCT. Each field is checked against its declared type with expected-type propagation.

Result validation

The checked root type must be assignable to the pack’s declared result type (AVL-RESULT); a pack result type of Any accepts any result. Enum/string interop applies.

Null semantics and evaluation

Evaluation is three-valued, bounded, snapshotted, and optionally traced. On any error the runtime returns a null value plus the error — it never fabricates a value. The evaluation timestamp is pinned from the snapshot (or the supplied Now, or the process clock at start); now() and all time-bound functions read only this pinned time.

Per-operator null behavior:

  • == / !=: value equality; not null-propagating (null == null is true, null == nonnull is false); enum/string interop applies.

  • < ⇐ > >=: any Null operand yields null. Mismatched non-null kinds are AVL-TYPE.

  • + - * / %: any Null operand yields null. String concatenation coerces Number/Boolean/Enum; a result string over the string limit is AVL-LIMIT. Division or modulo by zero is an error (not null).

  • in / not in: Null on either side yields null; a non-list right side is AVL-TYPE.

  • and / or: short-circuit — false and X is false and true or X is true without evaluating X. Otherwise a Null operand yields null; a non-boolean non-null operand is AVL-TYPE.

  • not: Null yields null; non-boolean non-null is an error.

  • unary -: Null yields null; non-number is an error.

  • if: a null condition is an evaluation error (AVL-NULL, "wrap the condition in coalesce(…​)") — not a silent else. Only the taken branch is evaluated.

  • construct: fields are evaluated in sorted key order; null-valued fields are omitted from the object.

  • attribute read: a missing snapshot/root/field or a null intermediate yields null; a declared-Timestamp attribute arriving as an RFC 3339 string is coerced (parse failure yields null).

  • truthiness: a boolean result is produced only for a Boolean value; null or any other kind is not truthy — the runtime never silently coerces a non-boolean to a boolean.

Builtin function library

There are 37 builtins. Each has a name, group, one or more overloads, a purity (pure | timebound | resolver), a static cost, and an optional method-style flag (may be called receiver.fn(args)). Global rule: a null argument yields a null result, except memberOf with no wired resolver (which errors). A wrong-kind non-null argument is an error. Text coercion accepts both strings and enum symbols.

core (pure, cost 1)

Name Signature Semantics

coalesce

(Any…) → Any (variadic)

first non-null argument; all null yields null

toString

(Any) → String

render a scalar; null yields null

toNumber

(Any) → Number

Number to itself; String parsed or null; Boolean to 1/0; else null

length

(String) → Number

rune count; null yields null

isNull

(Any) → Boolean

whether the value is null

defaultTo

(Any, Any) → Any

the first argument, or the second when the first is null

string (pure, cost 1 unless noted; method-style where noted)

Name Signature Notes

lower

(String) → String

unicode-aware

upper

(String) → String

unicode-aware

trim

(String) → String

trims leading/trailing whitespace

collapseSpaces

(String) → String

trims ends and collapses internal whitespace runs to single spaces

normalizeEmail

(String) → String

lowercase + trim; null if not email-shaped (no @, or a leading/trailing @)

usernameFromEmail

(String) → String

local part before the first @; null when @ is absent or leads

contains

(String, String) → Boolean or (List<Any>, Any) → Boolean

method-style; overloaded on the first parameter — this is the only contains, in the string group

startsWith

(String, String) → Boolean

method-style

endsWith

(String, String) → Boolean

method-style

matches

(String, String) → Boolean

cost 5, method-style; RE2; the pattern must be a string literal and is length-bounded

split

(String, String) → List<String>

split on a separator

join

(List<String>, String) → String

any null element yields null

replace

(String, String, String) → String

replace all occurrences

substring

(String, Number, Number) → String

rune indices, clamped; start ≥ end yields ""

date (cost 1; method-style where noted)

Name Signature Purity Notes

now

() → Timestamp

timebound

the pinned evaluation time, never the wall clock

parseTimestamp

(String) → Timestamp

pure

RFC 3339; failure yields null

daysBetween

(Timestamp, Timestamp) → Number

pure

fractional days

addDays

(Timestamp, Number) → Timestamp

pure

fractional days allowed

days

(Number) → Duration

pure

duration constructor

hours

(Number) → Duration

pure

duration constructor

minutes

(Number) → Duration

pure

duration constructor

before

(Timestamp, Timestamp) → Boolean

pure

method-style; strict <

after

(Timestamp, Timestamp) → Boolean

pure

method-style; strict >

within

(Timestamp, Duration) → Boolean

timebound

method-style; abs(ts − now) ≤ d

collection (pure, cost 2)

Name Signature Notes

size

(List<Any>) → Number

element count

isEmpty

(List<Any>) → Boolean or (String) → Boolean

list length 0, or empty string

first

(List<Any>) → Any

first element; empty yields null

distinct

(List<String>) → List<String>

deduplicate, first-seen order

intersects

(List<Any>, List<Any>) → Boolean

share any element

lookup (resolver, cost 10)

lookup(String table, String key) → Any resolves a snapshot-bound lookup row; a missing key is null. The table argument must be a string literal (so the dependency can be extracted).

identity (resolver, cost 10)

memberOf(Any subject, String group) → Boolean is resolver-backed; with no wired resolver it is an evaluation error, not false.

The decision function group

Two packs list a decision function group, but no builtin belongs to it — decisions are produced by the decision { … } constructor, not by a function. The group is a reserved, currently-empty forward-compatibility slot.

Context packs

A context pack is the per-use-case contract: the roots an expression may read, the function groups it may call, its result type, its resource budget, its failure mode, its readable input sensitivities, and its trace policy. Failure modes are enforcement-point contracts (the runtime always returns the error): DENY, NO_MATCH, OMIT, REJECT_UPDATE, PRESERVE, SUSPEND, INDETERMINATE, ERROR_BRANCH.

Shared enums:

  • Effect (closed): ALLOW, DENY, NOT_APPLICABLE, INDETERMINATE, DEFER, REQUIRE_APPROVAL

  • AssignmentEffect (closed): ASSIGN, UNASSIGN, NOT_APPLICABLE

  • Assurance (closed): AAL1, AAL2, AAL3

  • Obligation (open)

Shared constructors:

  • decision { effect (required), reason, requiredAssurance, obligations, advice, sessionDurationSeconds, confidence }

  • assignment { effect (required), entitlementSet, expiresAt, reason }

The built-in packs:

Pack Ver Roots Result Failure mode Readable sensitivities

PROFILE_MAPPING

1.1

source, user, tenant, evaluation

Any

REJECT_UPDATE

public, internal only

GROUP_MEMBERSHIP

1.0

user, tenant, evaluation

Boolean

PRESERVE

all declared

APP_ASSIGNMENT

1.0

user, application, tenant, evaluation

Object<assignment>

INDETERMINATE

all declared

OIDC_CLAIM

1.0

user, application, session, tenant, evaluation

Any

OMIT

all declared

SAML_ATTRIBUTE

1.0

user, application, session, tenant, evaluation

Any

OMIT

all declared

AUTHENTICATION_POLICY

1.0

user, session, device, risk, application, tenant, evaluation

Object<decision>

DENY

all declared

AUTHORIZATION_POLICY

1.0

user, session, device, risk, resource, application, request, tenant, evaluation

Object<decision>

DENY

all declared

WORKFLOW_CONDITION

1.0

user, request, resource, application, tenant, evaluation

Boolean

ERROR_BRANCH

all declared

REVIEWER_SELECTION

1.0

user, request, resource, tenant, evaluation

List<String>

INDETERMINATE

all declared

PROFILE_MAPPING v1.1 is the one pack that restricts readable input sensitivities to public and internal: the gateway’s schema-projection adapter filters controlled and secret-classified attributes out of the projected user/source roots before compilation, so a PROFILE_MAPPING expression cannot read them.

Evaluation, snapshot, and resource limits

Evaluation runs against an input snapshot built before execution; no undeclared lookup or clock access happens after snapshot construction. Timestamps in the snapshot arrive as RFC 3339 strings and are coerced by declared type. Whole-root reads are rejected both at compile time (AVL-CAP) and at IR-validation time.

The default resource limits — a pack may lower TimeLimit and MaxCost; all others fall to these defaults:

Limit Default

Time

50 ms

Operations

10 000

Call depth

8

List length

1 000

String length

64 KiB

Value depth

32

Value count

10 000

Snapshot bytes

4 MiB

Result bytes

256 KiB

Cost budget

1 000

Exceeding a bound is AVL-LIMIT; exceeding the pack cost budget at compile time is AVL-COST. Cost is a static estimate: constants and enum symbols cost 0, an attribute read 1, binary/unary/logical/if 1, a list 1 + len, a constructor 2, a function call its declared cost, a policy reference 25; both if branches are counted (static worst case).

Canonicalization and checksums

Every expression has a single canonical form independent of friendly-syntax spelling: binary expressions are fully parenthesized with canonical operator spelling, is null renders as (x == null), infix words render as function calls, strings are re-quoted with the four escapes. The canonical source’s SHA-256 is the SourceChecksum; the compiled IR’s canonical JSON SHA-256 is the IR Checksum. Two spellings that canonicalize identically produce the identical IR checksum — this is the basis for immutable versioning.

Diagnostics

Diagnostic codes are append-only and are never repurposed. Unknown attribute, function, and enum names produce "did you mean …" suggestions.

  • Errors: AVL-SYNTAX, AVL-ROOT, AVL-ATTR, AVL-FUNC, AVL-FUNC-CAP, AVL-ARITY, AVL-TYPE, AVL-ENUM, AVL-RESULT, AVL-COST, AVL-CONSTRUCT, AVL-CAP, AVL-LIMIT, AVL-SNAPSHOT, AVL-INTERNAL.

  • Warnings: AVL-NULL, AVL-CASE.

Reserved forms

policy("id") is a reserved call form (not a registry function): the id must be a string literal, the referenced policy must be known to the compiler, and it produces a policy reference (cost 25) that the runtime evaluates against the same snapshot, sharing the operation budget and deadline.

Versioning and stability

  • LanguageVersion is 1.0 and is embedded in every compiled artifact and decision trace. This specification defines version 1.0. Additions that do not change the meaning of any existing conformant expression (new builtins, new packs, new enum members, new diagnostics) are backward-compatible within 1.0. A change to the meaning of an existing conformant expression requires a new language version.

  • Activated expression versions are immutable; they are content-addressed by SourceChecksum and their compiled IR by Checksum.

  • CompilerVersion (avlc-1.0.1) is non-normative build metadata stored with a compilation; it is a single source of truth in the codebase (avl.CompilerVersion) and MUST NOT drift between the library and its callers.

  • The diagnostic-code list is append-only.

Exclusions (AVL 1.0)

AVL 1.0 deliberately excludes: recursion, loops, lambdas, action execution, arbitrary HTTP or I/O, user-supplied native code, unbounded graph queries, dynamic reflection, and runtime source compilation in production (production runtimes execute compiled IR loaded from signed bundles).

Conformance

An implementation conforms to this specification when, for every construct and builtin defined here, it compiles and evaluates as specified — including the null-propagation rules, the enum-string interoperability, canonicalization, each pack’s result-type and failure-mode contract, resource-limit enforcement, and the diagnostics. The conformance suite (Vector Language engine) verifies these claims, and it re-extracts every fenced example from the normative specification and asserts each compiles and evaluates exactly as written — a documentation-drift check that keeps this reference honest.

Executable examples

lower(source.givenName + "." + source.surname)
user.department == "Engineering" and user.status == ACTIVE
user.contractEndDate is not null and user.contractEndDate > now()
if user.status == ACTIVE and device.managed == true
then decision { effect: ALLOW, requiredAssurance: AAL2 }
else decision { effect: DENY, reason: "unmanaged device", obligations: [REQUIRE_MANAGED_DEVICE] }