The AbuseZero API is in public beta. Breaking changes are announced two weeks in advance.
AbuseZero

Rules

Turn risk scores into decisions that fit your business.

Rules run after scoring. Each rule has a condition and an action, and the first rule that matches decides the outcome.

Writing conditions

Conditions are expressions evaluated against the check context.

Block repeat trials
benefit.type == "free_trial" &&
  benefit.previousClaims >= 1 &&
  score >= 40
VariableTypeExample
scorenumber62
eventstring"trial_start"
benefit.typestring"credit"
benefit.previousClaimsnumber2
signalsstring[]["vpn", "alias"]

Evaluation order

Rules run from the lowest priority to the highest. If nothing matches, the default score ranges from risk checks apply.

rules.json
[
  { "name": "Allow staff", "when": "identity.email.endsWith(\"@abusezero.com\")", "action": "allow", "priority": 1 },
  { "name": "Block repeat trials", "when": "benefit.previousClaims >= 1", "action": "deny", "priority": 10 }, 
  { "name": "Review VPN users", "when": "\"vpn\" in signals", "action": "review", "priority": 20 } 
]

Order matters

A broad allow rule with a low priority will hide every rule after it. Keep allow rules narrow.

Deleting rules

Deleted rules can't be restored. Disable a rule with "enabled": false if you might need it again.

Testing a rule

Try a condition against a sample check before you save it.

// Sample check contextconst context = {score: 62,event: 'trial_start',benefit: { type: 'free_trial', previousClaims: 1 },signals: ['alias', 'vpn'],};

Manage rules from the dashboard or with the Rules API.

How is this guide?

Edit on GitHub

Last updated on

On this page