Objective
When none of Twilio's rules match the behavior you want to catch, you can write your own with full control over the conditions, the confidence score, and the decision it returns. This article walks through building a rule from an empty form.
Product
Fraud Risk Engine
Environment
Twilio Console
User Account Permission/Role(s) Required
Your user needs permission to create Fraud Risk Engine rules. Without it, Twilio reports an authorization error instead of saving the rule.
Procedure
- In the Twilio Console, select Identity & security in the left sidebar.
- Select Fraud Risk Engine, then Rule Management.
- Select Add rules.
- In How would you like to build your rule?, choose Create rule from scratch and select Get started.
- Under Rule details:
- Rule origin is set to Custom and cannot be changed.
- Enter a Rule name.
- Choose one or more values in Event Type. If you include the custom event type, also enter a Custom Type ID.
- Optionally add a Description of what the rule detects.
- Under Rule configuration, build the Conditions that make the rule trigger, choosing risk indicators, comparison operators, and how the conditions combine.
- Set the Confidence Score the rule contributes when its conditions match.
- Under Actions / Outcomes, choose the decision the rule returns, Allow, Block, Challenge, or Data Unavailable.
- Select Add rule. The rule is created and appears on the Rules Management table.
Additional Information
- Rule name must start with a letter and contain only letters, numbers, or underscores. Spaces and dashes are not allowed, and the name is limited to 100 characters.
- Custom Type ID follows the same pattern, start with a letter, then letters, numbers, or underscores, up to 64 characters. It is only required when Event Type includes the custom type.
- Description is limited to 500 characters and cannot contain control characters.
- Confidence Score must fall inside the score range the Fraud Risk Engine allows; Twilio rejects a value outside it.
- Use the configuration toggle above Conditions to switch between building conditions visually and reading them as code, with a copy control for the code view.
- Custom rules are the only ones you can edit in place afterwards.
This content was generated by AI and reviewed, edited, and verified by a human.