Skip to main content
Vet filters dependencies with CEL expressions. A filter is a boolean expression evaluated against each package; a package is included in the results when the expression evaluates to true. This page is the reference for the filter input and CEL syntax. For the concept, see CEL.
The vet scan --filter examples below use Vet’s original filter interface. Vet also ships a newer --policy engine with a different input schema; see the Vet repository for its format.

Running a filter

Filter a scan directly, or filter cached results from a JSON dump:
Add --filter-fail to exit non-zero when any package matches, for CI/CD gating.

Filter input

Each expression receives these variables:
See the filter input specification for the full message structure.

Input example

A filter sees each package as a structured input:

CEL syntax

Functions: size() (array or map length), exists(var, condition) (any element matches), in (membership), contains(), startsWith() / endsWith(). Operators: == != < <= > >= (comparison), && || ! (logical), + - * / (arithmetic). Types: booleans (true / false), double-quoted strings, numbers, arrays (["a", "b"]), and maps ({"key": "value"}).

Example expressions

CEL

What CEL is and how SafeDep uses it.

Policy as Code

Combine expressions into reusable policy files.

Build Your Own Queries

Filter cached scan data with the query workflow.

OpenSSF Scorecard

The scorecard checks referenced in scores.