- Catch out-of-range measurements before they propagate into reports
- Flag missing or implausible values during data ingestion
- Validate that calculated batch outputs stay within expected bounds
- Encode methodology guardrails that your team would otherwise check by eye
Key concepts
Rule
A rule is a single named expression evaluated against either incoming event data or model calculation results. Rules belong to a project and are managed in Project Settings → Data Rules.Target
Each rule has a target that determines what it evaluates:| Target | Evaluates |
|---|---|
| Event Data | Individual datapoints as events are created or updated. Use this to validate raw measurements at ingestion. |
| Batch Calculations | Outputs of a model after a batch is generated. Use this to validate downstream calculation results. |
Rule expression
The expression is the condition that triggers the rule. Expressions are written in a domain-specific language similar to SQL — for example:Effective period
Every rule has an Effective from date and an optional Effective to date. The rule evaluates records whose date falls within this range — anything outside it is left alone.- Set Effective to to a date when the rule should stop applying (for example, when a methodology version retires).
- Leave Effective to blank to mean Ongoing — the rule keeps running on new data indefinitely.
Alert
When a rule’s expression matches a record within the effective period, Mangrove creates an alert. Alerts surface in three places:- Event drawer — alerts appear on the affected event with a link back to the rule
- Batch detail — batches with rule alerts show them on the batch page
- Reports — alerts on records included in a report are propagated to that report
Lifecycle
To stop a rule from running on new data, set or shorten its Effective to date — the rule keeps its past alerts but no longer evaluates records after that date. To remove a rule entirely, delete it — deleting a rule also removes all of its evaluations and alerts.API access
Accessing rules over the Mangrove API requires your API token to have therule scope enabled. Tokens missing this scope receive a 403 Unauthorized response from any rules endpoint. To add the scope, open Settings → API Tokens, edit the token, and tick Rules Engine in the permissions list.