SUPPORT.TWILIO.COM END OF LIFE NOTICE: This site, support.twilio.com, is scheduled to go End of Life on February 27, 2024. All Twilio Support content has been migrated to help.twilio.com, where you can continue to find helpful Support articles, API docs, and Twilio blog content, and escalate your issues to our Support team. We encourage you to update your bookmarks and begin using the new site today for all your Twilio Support needs.

How do I create a custom fraud detection rule from scratch?

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

  1. In the Twilio Console, select Identity & security in the left sidebar.
  2. Select Fraud Risk Engine, then Rule Management.
  3. Select Add rules.
  4. In How would you like to build your rule?, choose Create rule from scratch and select Get started.
  5. Under Rule details:
  6. Rule origin is set to Custom and cannot be changed.
  7. Enter a Rule name.
  8. Choose one or more values in Event Type. If you include the custom event type, also enter a Custom Type ID.
  9. Optionally add a Description of what the rule detects.
  10. Under Rule configuration, build the Conditions that make the rule trigger, choosing risk indicators, comparison operators, and how the conditions combine.
  11. Set the Confidence Score the rule contributes when its conditions match.
  12. Under Actions / Outcomes, choose the decision the rule returns, Allow, Block, Challenge, or Data Unavailable.
  13. 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.

Have more questions? Submit a request
Powered by Zendesk