CEL condition reference

Every CEL variable, field, operator, and macro available in SecureAuth Agent Authority policy conditions, with a worked expression for each.

Policy conditions are written in CEL, Google's Common Expression Language. This page is the field-by-field reference — every variable, operator, and macro the condition editor accepts, plus one worked expression per variable.

Variables

Four variables are available in every condition, describing the request the gateway is currently evaluating:

VariableRepresents
agentThe connected agent instance making the call
userThe signed-in user behind that agent instance
mcpThe MCP server and tool being called
requestThe live arguments of the tool call

agent

FieldTypeDescription
agent.idstringAgent instance ID
agent.namestringAgent display name
agent.slugstringAgent type slug (for example claude-code) — matches every instance of that agent
agent.tagslist<string>Tag names assigned to the agent's slug

user

FieldTypeDescription
user.idstringUser ID
user.namestringUser display name
user.emailstringUser email address
user.groupslist<string>OIDC groups the user belongs to

mcp

FieldTypeDescription
mcp.idstringMCP server ID
mcp.namestringMCP server display name
mcp.slugstringMCP server slug (for example github)
mcp.tagslist<string>Tag names assigned to the MCP server
mcp.tool.namestringName of the tool being called
mcp.tool.tagslist<string>Tag names assigned to that tool

request

FieldTypeDescription
request.args.<field>dynA field from the live tool-call arguments; its type is inferred from the matched tool's input schema

request.args is only populated for a tool-call request — see Argument-level conditions for how autocomplete and coverage chips help you reference these fields safely.

Operators

Comparison and logic: == != in && || ! < <= > >= ?: has()

Arithmetic: + - * / % — usable inside a condition as long as the whole expression still returns a bool, for example size(user.groups) + 1 > 2.

Literals include true, false, and null.

String methods, available on any string field: .startsWith() .endsWith() .contains() .matches()

size() (callable as a function, size(x), or a method, x.size()) isn't string-only — it returns length for strings, lists, and maps alike, for example size(user.groups) > 0.

type(x) returns a value's type, which is useful against dyn-typed request.args fields, for example type(request.args.count) == int.

The full CEL standard library is enabled, so its conversion functions — int(), string(), double(), and the rest — are accepted too. That matters most for request.args, whose values arrive as dyn.

List macros

Available on any list<string> field (user.groups, agent.tags, mcp.tags, mcp.tool.tags) and on list-typed request.args fields:

MacroReturnsUse it when
.exists(x, <cond>)boolAt least one element matches
.all(x, <cond>)boolEvery element matches
.exists_one(x, <cond>)boolExactly one element matches
.filter(x, <cond>)listThe subset of elements that match
.map(x, <expr>)listTransform each element

Worked expressions

One per variable:

VariableExpressionMatches
agentagent.slug == "claude-code" && "prod" in agent.tagsClaude Code instances tagged prod
useruser.groups.exists(g, g.startsWith("eng-"))Users in any eng-* group
mcpmcp.slug == "github" && mcp.tool.name.startsWith("delete_")Delete tools on the GitHub MCP server
requesthas(request.args.channel_id) && request.args.channel_id in ["C_GENERAL", "C_DEVREL"]Slack calls scoped to two channels

Limits

Expressions are capped at 1024 bytes.

Error semantics

A condition errors at runtime when it references a request.args field the live call's arguments don't include — even one the tool's schema defines as optional — or compares incompatible types. The gateway is fail-closed on that error, and which way it fails depends on the rule's effect: an allow rule with an erroring condition is skipped, so the next rule decides; a deny rule with an erroring condition still denies. Guard optional fields with has() before referencing them — see Conditions for the full evaluation model.

Next steps

  • Policies — attach a condition to a rule and test it live.
  • Argument-level conditions — autocomplete, coverage chips, and per-call authorization.
  • Tags — the source of agent.tags, mcp.tags, and mcp.tool.tags.

On this page