{
  "_comment": "Example rule file for the WoWyrd rule review collector (format wowyrd-client-rules/1). Copy it, replace the consent line, then write your own rules. A key named _comment may sit in any object; the collector skips it. Every other key is checked: a key the format does not know stops the run and names it. Run: python3 run.py ... --rules your-rules.json",
  "format": "wowyrd-client-rules/1",
  "consent": {
    "_comment": "The consent line comes first. Without it the collector reads no rule. replay_inside_our_environment must be true: you allow the replay of these rules on your own files, inside your own environment. given_by: the role of the person who approved it (for example Head of Fraud Operations), not a personal name: it is printed in the reports. date: the day they approved it (ISO date, not in the future). statement: the approval in your own words. The collector refuses text that starts with EXAMPLE: (this file's placeholder): replace all three before a run.",
    "replay_inside_our_environment": true,
    "given_by": "EXAMPLE: replace with the approver's role",
    "date": "2026-11-12",
    "statement": "EXAMPLE: replace with your own approval statement, for example: We allow the collector to replay these rule definitions on our own payment files inside our environment."
  },
  "engine": "EXAMPLE engine name and version (optional, at most 80 characters)",
  "currency": "USD",
  "rules": [
    {
      "_comment": "A single-value check. id: the rule ID exactly as your engine writes it in the hit log (1 to 64 letters, digits, '.', '_', ':' or '-'). name: a plain name for the reports. action: your engine's decision word (for example allow, review, alert, decline). check: one condition. measure value compares one column of the payment with the threshold. field: a column of your transactions file. operator: eq, neq, gt, gte, lt or lte. threshold: a number, text or true/false; amounts are in the file's currency.",
      "id": "example_large_payment",
      "name": "Single payment of 9000 or more",
      "action": "review",
      "check": {
        "measure": "value",
        "field": "amount",
        "operator": "gte",
        "threshold": 9000
      }
    },
    {
      "_comment": "A count over a time window. group_by: the column that names who is counted (here, per sender). window: seconds as a number, or text like 90s, 15m, 24h, 5d (1 second to 366 days). where: optional value checks (at most 5) that pick which earlier payments are counted. typology: optional, an ID from our typology library (for example UA-NBU-S03 or OR-03), so the report can show which typology the rule covers.",
      "id": "example_wire_burst",
      "name": "More than two wires from one sender in seven days",
      "action": "alert",
      "typology": "UA-NBU-S03",
      "check": {
        "measure": "count",
        "group_by": "sender_id",
        "window": "7d",
        "operator": "gt",
        "threshold": 2,
        "where": [
          {
            "measure": "value",
            "field": "channel",
            "operator": "eq",
            "threshold": "wire"
          }
        ]
      }
    },
    {
      "_comment": "A total over a time window. measure sum always adds the amount column, so field is amount. all_of: every check in the list must be true (any_of: at least one). Groups nest at most 3 levels, with at most 20 items each.",
      "id": "example_card_total",
      "name": "Card payments from one sender above 5000 in a day",
      "action": "decline",
      "all_of": [
        {
          "measure": "value",
          "field": "channel",
          "operator": "eq",
          "threshold": "card"
        },
        {
          "measure": "sum",
          "field": "amount",
          "group_by": "sender_id",
          "window": "24h",
          "operator": "gt",
          "threshold": 5000
        }
      ]
    },
    {
      "_comment": "A count of different values. measure distinct counts how many different values of field one group_by value had in the window: here, how many different receivers one sender paid. kind: optional, fraud (the default) or aml. A rule marked aml gets a below-the-line sample: for each number threshold, up to 20 payments in each of 3 bands just under the line, written to btl-sample.csv (kept inside your environment) for your analysts to review.",
      "id": "example_many_receivers",
      "name": "One sender pays five or more receivers in five days",
      "action": "alert",
      "typology": "UA-NBU-S15",
      "kind": "aml",
      "check": {
        "measure": "distinct",
        "field": "receiver_id",
        "group_by": "sender_id",
        "window": "5d",
        "operator": "gte",
        "threshold": 5
      }
    },
    {
      "_comment": "A rule the format cannot express (a model score, a device check, a list lookup). Give it with not_replayable and a short note (at most 200 characters). The reports list it with your note; its logged hits are still measured from your hit log.",
      "id": "example_device_model",
      "name": "Device risk score from our vendor model",
      "action": "review",
      "not_replayable": "uses a vendor model score that is not in the transactions file"
    }
  ]
}
