Skip to main content
← Back to list
01Issue
FeatureShippedSwamp Club
Assigneesstack72

Relationships

#1032 Docs: document CEL grant condition cost limits

Opened by stack72 · 7/8/2026· Shipped 7/8/2026

What changed

swamp-club/swamp#1029 adds cost-bounding checks to CEL grant conditions. After that ships, admins need to know about the new limits when writing --when conditions.

Documentation gaps

Authorization reference (content/manual/reference/swamp-serve/authorization.md)

The CEL conditions section documents the --when flag but doesn't mention any complexity limits. Add a subsection covering:

  • AST depth limit (≤ 24) — conditions with deeply nested expressions are rejected
  • Comprehension nesting limit (≤ 2) — at most 2 levels of exists/all/filter/map chaining
  • Per-condition cost budget (≤ 500) — estimated cost from AST node count + comprehension weight
  • matches() restrictions — pattern must be a string literal (not a variable), and patterns with catastrophic backtracking constructs are rejected
  • Aggregate per-decision limit (≤ 100 conditions) — if more than 100 conditions with --when are evaluated in a single access check, the request is denied

CEL expressions reference (content/manual/reference/cel-expressions.md)

May benefit from a note in the "Where Expressions Are Evaluated" section indicating that grant conditions have additional complexity limits beyond the standard CEL expression context.

Notes

  • All limits are enforced at grant creation time (write-time) except the aggregate limit which is a runtime check
  • Existing grants created before these limits are unaffected
  • Error messages identify which limit was exceeded and the actual value
02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 2 MORETRIAGE+ 5 MORECLASSIFICATION+ 3 MOREPR_MERGED+ 1 MORENOTIFICATION_SKIPPED

Shipped

7/8/2026, 5:11:36 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack727/8/2026, 4:34:34 PM

Sign in to post a ripple.