writing-cel-expressions

Write CEL scoping expressions for Fianu policy criteria and index asset filters.

1|Updated Jun 11, 2026
One-click install
npx skills add https://github.com/fianulabs/fianu-skills --skill writing-cel-expressions-fianulabs
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: writing-cel-expressions
Source: https://github.com/fianulabs/fianu-skills/tree/main/skills/writing-cel-expressions
Command: npx skills add https://github.com/fianulabs/fianu-skills --skill writing-cel-expressions-fianulabs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Authoring CEL expressions for Fianu policy criteria and indexes fails with parser errors (errVarType, HTTP 400) when the required type-cast grammar is missing, and the operator vocabulary is not obvious from the API alone. ## Core Features & Use Cases - Cast grammar reference: Documents the mandatory $asset.<field>.(<type>) form with string, list_string, int64, and bool casts, including correct cast placement before string-method calls. - Operator vocabulary: Covers equals, contains, startsWith, matches, in, exists, and their negations, plus valueless exists/not_exists operators and date comparison semantics. - Multi-clause scoping: Explains combining expressions with combineWith AND/OR and the field-name differences between index expressions[].source and policy criteria expression fields. - Use Case: You need a policy variation that applies only to production repositories owned by a specific team. Use this Skill to write $asset.labels.(string).contains("tier:prod") combined with an owner startsWith clause under combineWith AND. ## Quick Start Write a CEL expression that scopes a Fianu policy to assets whose path starts with services/ and whose labels contain tier:prod.

Frequently Asked Questions about writing-cel-expressions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a CEL expression for Fianu policy criteria?▼

Use the form $asset.<field path>.(<type cast>) followed by an operator and value, such as $asset.path.(string) == "payments-app". The type cast is mandatory; without it the runtime parser returns errVarType and policy evaluation fails with a 400.

What operators are available in Fianu CEL expressions?▼

Supported operators include equals, not_equals, greater_than, less_than, starts_with, ends_with, contains, matches, not_matches, in, not_in, exists, and not_exists. The exists and not_exists operators are valueless and take no right-hand operand.

Why does my CEL expression fail with errVarType or a 400 error?▼

The failure occurs when the type cast is missing or misplaced, when the $ sigil is omitted, or when a per-type sigil like $repository is used instead of $asset. Write the canonical cast form such as $asset.labels.(string).contains("x") to resolve it.

How do I combine multiple CEL conditions with AND or OR?▼

List multiple expressions and set the combineWith field to AND or OR; the default is AND. Note that index expressions use expressions[].source while policy criteria use the singular expression field or expressions[].expression.

How do I match values inside a list field like labels or tags?▼

Cast the field as list_string and use contains, for example $asset.labels.(list_string).contains("compliance:sox"). Using a string cast on a list field is a common mistake that produces incorrect results.