Create a policy
Set the name
Give the policy a descriptive name — e.g.,
allow-support-reads, block-admin-tools, scope-to-customer.Choose the effect
| Effect | Behavior |
|---|---|
| Allow | If expression is false, the request is denied |
| Deny | If expression is true, the request is denied |
Write the CEL expression
Write the CEL expression directly in the editor. The expression is evaluated on every tool call against the request context:Available variables:
identity.name,identity.labelstask.name,task.labels,task.contextrequest.tool.name,request.tool.args
Policy editor
The console includes a code editor with:- Syntax highlighting for CEL expressions
- Access to the variable reference while editing
Organizing policies
A project can have multiple policy rules. They’re evaluated in order:- All deny rules first — if any match (
true), the request is blocked - All allow rules next — if any don’t match (
false), the request is blocked - If all rules pass, the request is allowed
Policies are drafts until published. Changes to draft policies don’t affect the gateway until you publish a new release.
Testing policies
Before publishing, test your policies mentally by checking:- Does an agent with label
team: supportcallingget_issuepass? (Should it?) - Does an agent with label
team: engineeringcallingdeploy_servicepass? (Should it?) - Does an agent without a task session get blocked? (If your allow rule references
task.context, yes — and that might be intentional.)
Next steps
Publish policies
Publish a release to start enforcing your policies.
CEL reference
Full syntax reference for policy expressions.