Reference
Expressions
Use the safe, Python-like expression language shared by tool conditions, approval rules, and test assertions.
Last updated
Examples
expressions
context.user.role == "admin"
input.tier in ["pro", "enterprise"] and not context.suspended
param.amount > 1000
status == "completed" and output.confidence >= 0.8
params.customer_id == context.fixture_customer_id and invocations == 1Bindings by context
Only the bindings provided by the field you are configuring are available. An unknown name fails validation.
| Binding | Used by | Value |
|---|---|---|
| input.<path> | Conditional tools | The incoming connector JSON payload. |
| context.<path> | Conditions, approvals, tests | Values added to run or test-builder context. |
| param.<path> / params.<path> | Approvals / tests | Arguments for the tool invocation being evaluated. |
| output | Test assertions | JSON-decoded agent output when possible, otherwise its raw string. |
| error | Test assertions | The run error or null. |
| status | Test assertions | The final run status. |
| invocations | Tool-call assertions | The number of matching calls to a tool. |
Grammar
Comparisons
==, !=, <, <=, >, >=, in, not in, is, and is not.Boolean operators
Combine checks with
and, or, and not. A bare accessor is a truthiness check.Literals
Strings, numbers,
true, false, null, and list, tuple, set, or object literals.Accessors
Read nested data with dot notation or subscripts, such as
context.user.id or input["items"][0].Deliberately limited
Function calls, imports, arithmetic, assignments, and private attribute access are not supported. Expressions are limited to 2,000 characters and validated before use.
Interpolation is different
Expressions return a value for a conditional field. Interpolation inserts a value into text: use $${VAR_NAME} for environment variables and, where documented, $${context.user_id} for per-run context. Prompt templates use {name}; see Context.