Skip to main content
Conditions determine which Policies and Metrics evaluate each Event by matching its metadata. Use them when different users, regions, products, models, or workflow stages require different Policies and Metrics.
Conditions and Events are available in API version 2026-06-01. Send the whitecircle-version: 2026-06-01 header on every request.

How Conditions Work

For every Event with content, White Circle:
  1. Finds the active Conditions attached to the Event’s Environment
  2. Evaluates each Condition against the Event’s metadata
  3. Selects the Policies and Metrics attached to matching Conditions
  4. Applies each Policy or Metric’s Event selector, such as message.content or tool.output
  5. Evaluates Policies synchronously and queues Metrics asynchronously
If no active Condition matches an Event, no Policies or Metrics are evaluated for that Event.
Results for active Policies appear synchronously in the Event response’s Policies map. Metrics run asynchronously and appear in dashboard analytics after processing.
Use an empty object {} when a Condition should match every Event in its attached Environments. Conditions are evaluated independently for each Event, including Events in the same batch. Reference-only Events do not evaluate Conditions because they do not run a new check.

Example

Create a Condition that enables selected Policies for EU users:
Then include matching metadata on an Event:
A selected Policy result identifies the matching Conditions:

Condition Expressions

A Condition is a group of leaf conditions. Every leaf must match for the Condition to select its Policies and Metrics.

Leaf

Use dot-separated fields such as user.region to read nested Event metadata.

Group

A group holds leaf conditions and combines them with and. This Condition selects its Policies only for EU users aged 18 or over.
Conditions you create through the API in this shape stay editable in the White Circle dashboard.
Malformed expressions, unknown operators, missing fields, and invalid regular expressions do not match.

Revisions and Attachments

Every create or update operation produces an immutable Condition revision. The current revision defines the Condition’s expression, state, attached Environments, and attached Policies and Metrics. Attach Policies with policy_ids and Metrics with metric_ids. Omitting policy_ids, metric_ids, or environment_ids during an update preserves their current values; providing an empty array clears that attachment type.

Create Condition

Create a Condition and attach Environments, Policies, and Metrics.

Update Condition

Create a new revision with selected fields changed.

Check an Event

Send metadata that Conditions evaluate per Event.

Event Selectors

Configure which Event types and fields each Policy evaluates.