Agentgateway Objects context
| CEL name | Rust field | When / where it’s set |
|---|---|---|
request |
request |
HTTP request (method, uri, host, scheme, path, version, headers, body, startTime, endTime). Set from live request or from RequestSnapshot. |
response |
response |
HTTP response (code, headers, body). Only set when the executor is built with a response (e.g. new_request_and_response, new_response, or logger with response). |
jwt |
jwt |
JWT claims. Present when JWT auth is enabled and a token was verified. |
apiKey |
api_key |
API key claims. Present when API key auth is enabled. |
basicAuth |
basic_auth |
Basic auth claims (e.g. username). Present when Basic auth is enabled. |
llm |
llm |
LLM context (streaming, models, provider, token counts, prompt, completion, params, etc.). Present for AI backends. |
llmRequest |
llm_request |
Raw LLM request JSON. Present during LLM policies; often not kept for later stages (e.g. logging). |
mcp |
mcp |
MCP resource (e.g. tool, prompt, resource with target/name). Present when the request is MCP. |
backend |
backend |
Backend info: name, type (ai/mcp/static/dynamic/service), protocol (http/tcp/a2a/mcp/llm). |
source |
source |
Downstream connection: address, port, TLS/identity fields (identity, subjectAltNames, issuer, subject, subjectCn). |
extauthz |
extauthz |
Dynamic metadata from ext_authz filters. |
extproc |
extproc |
Dynamic metadata from ext_proc filters. |
Agentgateway CEL functions
contains— check containmentsize— size of string/list/mapmax,min— numeric max/minstartsWith,endsWith— string prefix/suffixstring,bytes,double,int,uint— type conversionsmatches— string vs regexoptional.none(),optional.of(),optional.ofNonZeroValue()value,hasValue,or,orValue(on optional values)duration,timestampgetFullYear,getMonth,getDayOfYear,getDayOfMonth,getDate,getDayOfWeekgetHours,getMinutes,getSeconds,getMillisecondsjson,jsonField— parse string/bytes as JSON (or single field)to_json/toJson— value → JSON stringwith— variable bindingmapValues,merge— map operationsvariables— expose all variables (use with care)random— float in [0, 1)default— fallback when expression can’t be resolvedregexReplace— regex replace in stringfail— always fail expressionuuid— UUIDv4base64Encode/base64.encode,base64Decode/base64.decodecharAt,indexOf,lastIndexOfjoin,lowerAscii,upperAsciitrim,replace,split,substringstripPrefix,stripSuffixcidr("...")→.ip(),.masked(),.prefixLength(),.containsIP(...),.containsCIDR(...)ip("...")→.family(),.isUnspecified(),.isLoopback(),.isLinkLocalMulticast(),.isLinkLocalUnicast(),.isGlobalUnicast()isIP("...")— true if string is valid IPflatten— flatten list or map for loggingflattenRecursive/flatten_recursive— recursive flattenprecompiled_matches— used when optimizingstring.matches(regex)(not something you call directly in expressions)