Skip to main content
Swarm evaluates all guard checks, rule conditions, filter conditions, and on_complete branch conditions with CEL (Common Expression Language). CEL is strongly typed and non-Turing-complete: it cannot loop or call out, so no LLM can improvise a route and there is no unbounded evaluation.

Context variables

A CEL expression reads from a fixed set of namespaces: Declared entity fields are always readable at a type-valid value; referencing an undeclared field is a contract error caught at boot.

Examples

Supported operations include comparison (== != < <= > >=), logical (&& || !), arithmetic (+ - * /), membership (in, contains), string (startsWith, endsWith, matches), and list (size, exists, all, filter, map).

The prefix rule

Every condition must carry a context prefix, payload., entity., policy., accumulated., or fan_out.. Writing category instead of payload.category is an error — every name must say which namespace it comes from. See Dialect rules and the full CEL reference. CEL’s conditional operator is available too: cond ? a : b — the way to write a running max/min fold in a data_accumulation expression.