Skip to main content
Devctrl policies use the Common Expression Language (CEL) — a lightweight, fast expression language designed for security policy evaluation. CEL expressions are evaluated on every tool call.

Available variables

Every CEL expression has access to three top-level objects:

identity

Information about the agent making the request.

task

Information about the active task session. Only available when the request includes an X-Task-Token header.

request

Information about the current tool call.

Operators

CEL supports standard operators:

String functions

Map access

Access nested map values using dot notation or index notation:
Accessing a map key that doesn’t exist causes an error, which results in a deny. Use has() to check for optional keys before accessing them.

Common patterns

Tool names are namespaced as serverName__toolName (e.g., github__list_issues). Use the full namespaced name in your expressions. The examples below use short names for readability.

Allow specific tools

Check identity labels

Scope access by task context

Combine multiple conditions

Block dangerous tools

Allow based on optional label

Evaluation rules

  1. Deny rules are evaluated first. If any deny rule’s expression returns true, the request is blocked.
  2. Allow rules are evaluated next. If any allow rule’s expression returns false, the request is blocked.
  3. If all rules pass, the request is allowed.
  4. If no active release exists, the project’s default action applies.
  5. If a CEL expression errors (e.g., accessing a missing key), it’s treated as a deny.
Order matters. Place deny rules before allow rules for clear, predictable behavior.

Next steps

Policy examples

Real-world policy patterns you can copy and adapt.

Write policies

Author policies in the console’s policy editor.