Customer rules

Site → Rules. Up to 20 ordered rules. The first enabled rule whose conditions all match wins. Each rule has 1–10 conditions and a name of up to 60 characters. Save rules publishes the full ordered list.

Model

PATCH /api/sites/:key
{ "rules": [{
  "id": "new-domain-country", "name": "New domains in US", "enabled": true,
  "when": [
    { "field": "reason", "op": "has", "value": "email_domain_new" },
    { "field": "country", "op": "in", "value": ["US"] }
  ],
  "then": "limit"
}] }

Supported decisions: allow, limit, challenge, shadow, block. Each ID must be unique and contain 1–36 letters, digits, hyphens or underscores. Lists take 1–50 entries. Unknown fields, operators and keys are rejected.

FieldOperatorsValue
verdicteq / inhuman, suspicious, bot; scalar for eq, array for in
scoregte / lteWhole number 0–100, inclusive
reasonhasOne verify reason ID, e.g. token_farm, email_domain_new, repeat_device
countryin / not_inISO2 code array
asnin / not_inUnsigned ASN number array
emailDomainin / not_inLowercased domain array; normalized from account.email
actioninAction array, case-sensitive
uaFamilyinBrowser family array, case-insensitive
agentinVerified agent name array, case-insensitive

Missing signals do not match positive conditions. A missing signal matches not_in. Empty rule lists restore the default decision policy. Demo rules are read-only.

Verified OpenAI agent → allow

{ "id": "openai", "name": "Allow verified OpenAI", "enabled": true,
  "when": [{ "field": "agent", "op": "in", "value": ["GPTBot", "ChatGPT-User", "OAI-SearchBot"] }],
  "then": "allow" }

Use the exact agent names returned by verification. The agent field does not match user-agent claims, operator names, unverified agents or spoofed agents.

Precedence

Rules run only for valid real tokens, after scoring, repeat checks and the default site/agent policy. The first match replaces the default decision. It cannot make an invalid, expired or replayed token valid. Observe mode still returns decision: allow; the rule's decision appears in wouldDecide. Block and Shadow modes enforce the rule's decision. Public test keys do not run customer rules.

A match adds a rule reason with no weight. It does not change score, verdict, repeat counts or abuse categories. Events store only the matched rule ID and name. The event drawer shows them under “Rule”. Rule evaluation stores no additional raw IP or email data.