Common Expression Language: Fast, safe expression language

mooreds1 pts0 comments

CEL | Common Expression Language

Skip to main content

English

Deutsch

Español – América Latina

Français

Indonesia

Italiano

Polski

Português – Brasil

Tiếng Việt

Türkçe

Русский

עברית

العربيّة

فارسی

हिंदी

বাংলা

ภาษาไทย

中文 – 简体

中文 – 繁體

日本語

한국어

Sign in

CEL

// Simple predicates<br>'tacocat'.startsWith('taco')

// Parameterized predicates over structured data<br>account.balance >= transaction.withdrawal

// JSON objects<br>{'sub': '12345678',<br>'aud': 'example2.cel.dev',<br>'iss': 'https://example1.cel.dev/jwt-issuer'}

// Strongly typed objects<br>common.GeoPoint{ latitude: 10.0, longitude: -5.5 }

Fast, safe expression language

Common Expression Language (CEL) is an expression language that’s fast, portable, and safe to execute in performance-critical applications. CEL is designed to be embedded in an application, with application-specific extensions, and is ideal for extending declarative configurations that your applications might already use.<br>Use CEL for things like list filters for API calls, validation constraints on protocol buffers, and authorization rules for API requests.

Learn more

Get started

speed

Fast

Accelerated expression evaluation in performance-critical paths from nanoseconds to microseconds.

language

Portable

Developer friendly, light weight with common syntax across multiple Google and external systems.

hub

Extensible

Supports subsetting and extension, easy to embed and tailor to configuration and policy requirements.

verified_user

Safe

Non-Turing complete, and only accesses data provided by the host application.

Is CEL right for your project?

CEL is ideal for performance-critical applications because it was designed to evaluate safely and quickly (nanoseconds to microseconds) with predictible costs. CEL expressions are especially useful for predicate logic and simple data transformations. CEL is used most efficiently in applications where expressions are evaluated frequently, but modified infrequently. For example, evaluating an HTTP request against a security policy is an excellent use case for CEL. A CEL security policy expression would have a one-time configuration cost for validating the expression and then be evaluated very frequently at a negligible cost.<br>Still not sure? Check out the CEL overview and language definition, or just ask us! We're happy to help.

CEL overview

Language definition

Ask our team

Contribute to CEL

Want to help the CEL project? Contribute to our open source code and documentation. We'd love your help!

Contribute

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],[],[],[]]

expression language thumb common down fast

Related Articles