Skip to main content
Connic
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 == 1

Bindings by context

Only the bindings provided by the field you are configuring are available. An unknown name fails validation.

BindingUsed byValue
input.<path>Conditional toolsThe incoming connector JSON payload.
context.<path>Conditions, approvals, testsValues added to run or test-builder context.
param.<path> / params.<path>Approvals / testsArguments for the tool invocation being evaluated.
outputTest assertionsJSON-decoded agent output when possible, otherwise its raw string.
errorTest assertionsThe run error or null.
statusTest assertionsThe final run status.
invocationsTool-call assertionsThe 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.