Skip to content

BonsaiSafe expressions for rules, filters, and templates.

A constrained expression language for pricing rules, search filters, workflow conditions, and user-authored logic. Replace fragile eval()-style glue with typed errors, cacheable compilation, and real sandbox controls.

Bonsai

// Transform pipelines

" hello world " |> trim |> upper

"HELLO WORLD"

// Null-safe navigation

user?.profile?.avatar ?? "default.png"

"default.png"

// Lambda predicates

users |> filter(.age >= 18) |> map(.name)

["Alice"]

Use it where eval() would be reckless

Pricing & Eligibility

Business Rules

A pricing rule changes every quarter. With Bonsai it is a text field in your admin panel that evaluates at runtime.

order.total
  >= freeShippingThreshold
  && customer.tier == "gold"
Search & Admin UIs

Filter Builders

Store a saved view as a string and evaluate it per row, with no custom query parser to build or maintain.

orders |> filter(
  .status == "pending"
  && .total > 500
)
Notifications & Emails

Templates

Template expressions live alongside the copy, not buried in application code or a separate engine.

`Hi ${user.firstName},
  order ${order.id} ships
  ${shipDate |> formatDate}`