Skip to main content
Connic
Reference

Expressions

Use the safe, Python-like expression language shared by tool conditions, approval rules, tests, and drain filters.

Last updated
Examples
expressions
context.user.role == "admin"
input.tier in ["pro", "enterprise"] and not context.suspended
param.amount > 1000
entry.changes.after.guardrail_type == "prompt_injection"
status == "completed" and output.confidence >= 0.8
params.customer_id == context.fixture_customer_id and invocations == 1

Bindings by context

Each field exposes only its documented bindings. An expression with an unavailable binding is rejected or does not match, depending on where it is used.

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.
entry.<path>Log and audit drainsA field from the log or audit entry being considered for forwarding.
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. Invalid expressions are rejected or evaluate as false, depending on the field.

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.