CEL reference explorer
Explore the CEL expression context interactively, including all available variables and their nested fields.
- request
- methodstring
- uristring
- hoststring
- schemestring
- pathstring
- pathAndQuerystring
- versionstring
- headersobject
- bodystring
- bodyPrefixstring
- startTimestring
- endTimestring
- response
- codeinteger
- grpcStatusinteger
- headersobject
- bodystring
- bodyPrefixstring
- proxy
- error
- *reasonstring
- *messagestring
- bindstring
- gateway
- namespacestring
- namestring
- listener
- namestring
- route
- namespacestring
- namestring
- kindstring
- rulestring
- requestProcessingDurationstring
- upstreamDurationstring
- responseProcessingDurationstring
- env
- podNamestring
- namespacestring
- gatewaystring
- jwt
- rawTokenstring
- apiKey
- *keystring
- basicAuth
- *usernamestring
- llm
- *streamingboolean
- *requestModelstring
- responseModelstring
- *providerstring
- inputTokensinteger
- providerInputTokensinteger
- inputImageTokensinteger
- inputTextTokensinteger
- inputAudioTokensinteger
- cachedInputTokensinteger
- cacheCreationInputTokensinteger
- outputTokensinteger
- outputImageTokensinteger
- outputTextTokensinteger
- outputAudioTokensinteger
- reasoningTokensinteger
- totalTokensinteger
- providerTotalTokensinteger
- serviceTierstring
- timeToFirstTokenstring
- timePerOutputTokenstring
- countTokensinteger
- prompt
- *rolestring
- *contentstring
- completionstring[]
- toolCalls
- *idstring
- *namestring
- *arguments
- *params
- temperaturenumber
- top_pnumber
- frequency_penaltynumber
- presence_penaltynumber
- seedinteger
- max_tokensinteger
- encoding_formatstring
- dimensionsinteger
- cost
- *totalnumber
- *inputnumber
- *outputnumber
- *cacheReadnumber
- *cacheWritenumber
- *reasoningnumber
- *inputAudionumber
- *outputAudionumber
- *pagesnumber
- costRates
- inputnumber
- outputnumber
- cacheReadnumber
- cacheWritenumber
- reasoningnumber
- inputAudionumber
- outputAudionumber
- perPagenumber
- llmRequest
- source
- addressstring
- portinteger
- rawAddressstring
- rawPortinteger
- identity
- *trustDomainstring
- *namespacestring
- *serviceAccountstring
- spiffeIdstring
- subjectAltNamesstring[]
- issuerstring
- subjectstring
- subjectCnstring
- certificatestring
- unverifiedWorkload
- namestring
- namespacestring
- serviceAccountstring
- connectHeadersobject
- destination
- addressstring
- portinteger
- hostnamestring
- mcp
- methodNamestring
- sessionIdstring
- target
- *namestring
- tool
- *targetstring
- *namestring
- argumentsobject
- result
- error
- prompt
- targetstring
- namestring
- resource
- targetstring
- namestring
- task
- *targetstring
- *namestring
- toolsList
- promptsList
- resourcesList
- resourceTemplatesList
- backend
- namestring
- endpointstring
- typestring
- protocolstring
- extauthzobject
- extprocobject
- mcpGuardrailsobject
- guardrails
- *phasestring
- *guardstring
- *actionstring
- guardrailIdstring
- guardrailVersionstring
- actionReasonstring
- assessmentsobject[]
- metadataobject
request contains attributes about the incoming HTTP requestThe HTTP method of the request. For example,
GETValidation
DefaultGET
The complete URI of the request. For example,
http://example.com/path.Validation
Default/
The hostname of the request. For example,
example.com.Validation
Defaultnull
The scheme of the request. For example,
https.Validation
Defaultnull
The path of the request URI. For example,
/path.The path and query of the request URI. For example,
/path?foo=bar.Validation
Default/
The version of the request. For example,
HTTP/1.1.Validation
DefaultHTTP/1.1
The headers of the request.
Validation
Default{}
The request's body, buffered up to
this field is not available and will fail to evaluate.
Including this attribute in an expression will trigger the body to be buffered.
maxBufferSize. If the body exceeds the max buffer size,this field is not available and will fail to evaluate.
Including this attribute in an expression will trigger the body to be buffered.
The request body buffered up to
this contains the first
maxBufferSize. If the complete body exceeds the limit,this contains the first
maxBufferSize bytes.The time the request started
The time the request completed
response contains attributes about the HTTP responseThe HTTP status code of the response.
Validation
Default0
Formatuint16
Minimum0
Maximum65535
The gRPC status code of the response, when present.
Validation
Formatuint8
Minimum0
Maximum255
The headers of the response.
Validation
Default{}
The response's body, buffered up to
this field is not available and will fail to evaluate.
Including this attribute in an expression will trigger the body to be buffered.
maxBufferSize. If the body exceeds the max buffer size,this field is not available and will fail to evaluate.
Including this attribute in an expression will trigger the body to be buffered.
The response body buffered up to
this contains the first
maxBufferSize. If the complete body exceeds the limit,this contains the first
maxBufferSize bytes.proxy contains proxy timing information for the request.The final gateway error when the response was synthesized from a failed request.
Broad classification of the failure, such as
UpstreamFailure or Timeout.Human-readable failure detail. Exact message is subject to change.
The bind that accepted the request.
The selected Gateway.
The namespace of the selected Gateway.
The name of the selected Gateway.
The selected listener.
The name of the selected listener.
The selected route.
The namespace of the selected route.
The name of the selected route.
The kind of the selected route.
The selected route rule name, when available.
Time spent processing the request before sending the primary outbound call.
Time spent waiting for the primary outbound call.
Time spent processing the primary outbound response before sending the downstream response.
env contains selected process environment attributes exposed to CEL.This does NOT expose raw environment variables, but rather a subset of well-known variables.
The name of the pod (when running on Kubernetes)
The namespace of the pod (when running on Kubernetes)
The Gateway we are running as (when running on Kubernetes)
jwt contains the claims from a verified JWT token. This is only present if the JWT policy is enabled.The raw bearer token. Redacted by default; use
jwt.rawToken.unredacted() to access the actual value.apiKey contains the claims from a verified API Key. This is only present if the API Key policy is enabled.In addition to
key, user-supplied metadata fields are flattened into this object; for example,apiKey.group. Metadata values are plain JSON and are not treated as secrets.The API key value. Redacted by default; use
apiKey.key.unredacted() to access the actual value.basicAuth contains the claims from a verified basic authentication Key. This is only present if the Basic authentication policy is enabled.basicAuth contains the claims from a verified basic authentication Key. This is only present if the Basic authentication policy is enabled.llm contains attributes about an LLM request or response. This is only present when using an ai backend.Whether the LLM response is streamed. If it is streamed some fields may be inconsistent based on when accessed during the response flow.
The model requested for the LLM request. This may differ from the actual model used.
The model that actually served the LLM response.
The provider of the LLM.
The total number of tokens in the input/prompt, including tokens read from or written to
cache. This has consistent semantics across providers.
cache. This has consistent semantics across providers.
Validation
Formatuint64
Minimum0
The provider-reported number of tokens in the input/prompt. This is inconsistent across
providers: some include cached tokens while others exclude them.
providers: some include cached tokens while others exclude them.
Validation
Formatuint64
Minimum0
The number of image tokens in the input/prompt.
Validation
Formatuint64
Minimum0
The number of text tokens in the input/prompt.
Note: this field is only set in multi-modal calls where the total token count is split out by
text/image/audio; for standard all-text calls, this is unset.
Note: this field is only set in multi-modal calls where the total token count is split out by
text/image/audio; for standard all-text calls, this is unset.
Validation
Formatuint64
Minimum0
The number of audio tokens in the input/prompt.
Validation
Formatuint64
Minimum0
The number of tokens in the input/prompt read from cache (savings)
Validation
Formatuint64
Minimum0
Tokens written to cache (costs)
Validation
Formatuint64
Minimum0
The number of tokens in the output/completion.
Validation
Formatuint64
Minimum0
The number of image tokens in the output/completion.
Validation
Formatuint64
Minimum0
The number of text tokens in the output/completion.
Validation
Formatuint64
Minimum0
The number of audio tokens in the output/completion.
Note: this field is only set in multi-modal calls where the total token count is split out by
text/image/audio; for standard all-text calls, this is unset.
Note: this field is only set in multi-modal calls where the total token count is split out by
text/image/audio; for standard all-text calls, this is unset.
Validation
Formatuint64
Minimum0
The number of reasoning tokens in the output/completion.
Validation
Formatuint64
Minimum0
The total number of input and output tokens for the request. Input tokens include tokens read
from or written to cache, giving this field consistent semantics across providers.
from or written to cache, giving this field consistent semantics across providers.
Validation
Formatuint64
Minimum0
The provider-reported total number of tokens for the request. This is inconsistent across
providers because some include cached input tokens while others exclude them.
providers because some include cached input tokens while others exclude them.
Validation
Formatuint64
Minimum0
The service tier the provider served the request under.
Time from request start until the first response token is received.
Average time from first response token to response completion per output token.
The number of tokens in the request, when using the token counting endpoint
These are not counted as 'input tokens' since they do not consume input tokens.
These are not counted as 'input tokens' since they do not consume input tokens.
Validation
Formatuint64
Minimum0
The prompt sent to the LLM. Warning: accessing this has some performance impacts for large prompts.
Message role, such as "system", "user", or "assistant".
Message text content.
The completion from the LLM. Warning: accessing this has some performance impacts for large responses.
The tool calls from the LLM. Warning: accessing this has some performance impacts for large responses.
No description for this field.
No description for this field.
The parameters for the LLM request.
No description for this field.
Validation
Formatdouble
No description for this field.
Validation
Formatint64
No description for this field.
Validation
Formatuint64
Minimum0
No description for this field.
The realized USD cost of the request from the model cost catalog.
Unset when the model could not be priced.
Unset when the model could not be priced.
No description for this field.
Validation
Formatdouble
Effective model catalog rates in USD per 1M tokens after tier selection.
Unset when the model could not be priced.
Unset when the model could not be priced.
llmRequest contains the raw LLM request before processing. This is only present *during* LLM policies;policies occurring after the LLM policy, such as logs, will not have this field present even for LLM requests.
source contains attributes about the source of the request.The IP address of the downstream connection.
Validation
Default0.0.0.0
Formatip
The port of the downstream connection.
Validation
Default0
Formatuint16
Minimum0
Maximum65535
The original TCP peer IP address of the downstream connection.
This can differ from the
This can differ from the
address when using tunneling protocols like PROXY.Validation
Default0.0.0.0
Formatip
The original TCP peer port of the downstream connection.
This can differ from the
This can differ from the
port when using tunneling protocols like PROXY.Validation
Default0
Formatuint16
Minimum0
Maximum65535
The (Istio SPIFFE) identity of the downstream connection, if available.
Validation
Defaultnull
The trust domain of the identity.
The namespace of the identity.
The service account of the identity.
The raw SPIFFE ID (first
present. Unlike
spiffe:// URI SAN) of the downstream client certificate, ifpresent. Unlike
identity, this is populated for any SPIFFE ID, not only the Istiospiffe://td/ns/<ns>/sa/<sa> format.Validation
Defaultnull
The subject alt names from the downstream certificate, if available.
Validation
Default[]
The issuer from the downstream certificate, if available.
The subject from the downstream certificate, if available.
The CN of the subject from the downstream certificate, if available.
Validation
Defaultnull
PEM of the downstream client certificate. Present only when the client presented a certificate during the TLS handshake.
Validation
Defaultnull
The workload context of the downstream connection, resolved from the
workload discovery store by source IP. Available when the source pod is
known to the controller's workload discovery store.
workload discovery store by source IP. Available when the source pod is
known to the controller's workload discovery store.
Fields are nested under
from the source IP (not cryptographically authenticated). Policy
authors should prefer
unverified to signal that they are derivedfrom the source IP (not cryptographically authenticated). Policy
authors should prefer
source.identity.* for trust-sensitive checks.The pod name of the source workload.
The namespace of the source workload.
The service account of the source workload.
HTTP CONNECT request headers, when this stream originated from a CONNECT
tunnel. Empty otherwise. Exposed in CEL as
supports the same accessors as
tunnel. Empty otherwise. Exposed in CEL as
source.connectHeaders, whichsupports the same accessors as
request.headers (indexing, join(),split(), etc.).CONNECT headers are client-supplied and unauthenticated at the transport
layer, so trust decisions should validate the values (e.g. signature or
issuer checks) rather than trusting header presence alone.
layer, so trust decisions should validate the values (e.g. signature or
issuer checks) rather than trusting header presence alone.
destination contains attributes about the downstream request destination at agentgateway.The IP address of the downstream request destination at agentgateway.
Validation
Default0.0.0.0
Formatip
The port of the downstream request destination at agentgateway.
Validation
Default0
Formatuint16
Minimum0
Maximum65535
The requested destination hostname, when known. For TLS connections this is the sniffed SNI.
mcp contains attributes about the MCP request.Request-time CEL includes identity fields (
tool, prompt, resource,task) plus methodName. Post-request CEL may also include fields likesessionId, tool payloads, and list results.No description for this field.
The MCP target for the current target-scoped operation.
The target handling the tool call after multiplexing resolution.
The resolved tool name sent to the upstream target.
The JSON arguments passed to the tool call.
The terminal tool result payload, if available.
The terminal JSON-RPC error payload, if available.
The target of the resource
The name of the resource
The target handling the task.
The task ID.
The terminal tools/list result returned to the client, if available.
The terminal prompts/list result returned to the client, if available.
The terminal resources/list result returned to the client, if available.
The terminal resources/templates/list result returned to the client, if available.
backend contains information about the backend being used.The name of the backend being used. For example,
my-service or service/my-namespace/my-service:8080.The resolved target for directly addressed backends, including the port for network endpoints.
Absent for Service backends, whose workload endpoints are selected separately.
Absent for Service backends, whose workload endpoints are selected separately.
The type of backend.
Validation
Enumai, mcp, static, dynamic, service, unknown
Defaultunknown
The protocol of backend.
Validation
Enumhttp, tcp, a2a, mcp, llm
Defaulthttp
extauthz contains dynamic metadata from ext_authz filtersextproc contains dynamic metadata from ext_proc filtersmcpGuardrails contains dynamic metadata returned by mcpGuardrails policy processors.guardrails contains entries for prompt-guard guardrail evaluations, in either therequest or response phase. Only present in CEL that runs after the request completes,
such as log and metric fields.
The phase the guardrail was evaluated in:
request or response.The guard kind that was evaluated, such as
bedrockGuardrails.The action the guardrail took (allow/mask/reject/audit/failOpen).
The configured guardrail identifier.
The configured guardrail version.
The reason the guardrail reported for its action.
Assessment detail reported by the guardrail provider, redacted to metadata
only. Content-bearing fields (such as the matched text) are never included.
only. Content-bearing fields (such as the matched text) are never included.
metadata contains values set by transformation metadata expressions.Was this page helpful?