Cosmin Marginean
02/26/2026, 9:57 AMlambda in resource planner: https://docs.cerbos.dev/cerbos/latest/api/index.html#resources-query-plan
From our tests and the provided examples, there are a few implied, but not explicit assumptions that I wanted to verify
1. a lambda would only appear as a child of another expression and never directly as a child of filter.condition
2. the variable in a lambda is never an attribute, it's always a name for how the variable would be referenced inside the lambda
3. the actual attribute that a lambda variable refers to is always the variable in the parent expression.
Are these assumptions correct?Cosmin Marginean
02/26/2026, 9:57 AMAlex Olivier (Cerbos)
Cosmin Marginean
02/26/2026, 4:31 PMexists expression
"expression": {
"operator": "exists",
"operands": [
{
"variable": "request.resource.attr.profiles"
},
{
"expression": {
"operator": "lambda",
"operands": [
{
"expression": {
"operator": "and",
"operands": [
{
"expression": {
"operator": "in",
"operands": [
{
"value": "admin"
},
{
"variable": "prof.roles"
}
]
}
},
{
"expression": {
"operator": "eq",
"operands": [
{
"variable": "prof.tenancyId"
},
{
"value": "12345"
}
]
}
}
]
}
},
{
"variable": "prof"
}
]
}
}
]
}Dennis (Cerbos)
Cosmin Marginean
03/03/2026, 8:37 AM