What you will do
You will run the prepared expression in the playground above, change one input at a time, and explain the result. Start in CEL only, then repeat the same rule in CEL + JSON.
How it works
A CEL host first parses source text, checks it against declared variables and types, and then evaluates it with concrete values. The host decides which variables, functions, macros, and optional extensions exist. CEL supplies the expression semantics; it does not discover application data by itself.
Read the prepared example
The CEL + JSON rule is:
type(request.priority) == string && request.priority in ['low', 'high']Its input is:
{
"request": {
"priority": "high"
}
}The CEL only tab contains the values and the rule in one expression. The enabled cel.bind() extension keeps each name local to its final argument.
Evaluation step by step
- The host supplies
requestwith a string memberpriority. - The type check confirms
string. - Membership in the allowed list is true, so the final result is
true.
Your task
- Run both modes.
- Change priority to
"medium". - Remove
priority, inspect the error, and state whether it belongs to syntax, declarations, or runtime input.
Expected observation: "medium" is well typed but not allowed; a missing member is an input/presence problem, not a syntax error.
Common mistake
Do not assume an expression that runs in this playground will have the same variables or extensions in every CEL host. Confirm the target host configuration.
Show the explanation
The host application declares and supplies it; CEL only evaluates the expression against it.
Knowledge check
Who defines the meaning and availability of request?
Key takeaway
Separate language rules from host configuration: parse the expression, check names and types, then evaluate with supplied data.
Sources
CEL-DEV— official CEL overview.CEL-LANG— official CEL language definition.CEL-GO-BIND— official documentation for the optionalcel.bind()extension used by the self-contained tab.