A fraud rules engine is software that checks every transaction, login or account change against conditions your team defines, then decides what happens on a match: approve, hold, reject, step up authentication or send to an analyst. The hard part is not the if-then logic. It is the data feeding the conditions, the order rules run in, the way changes get tested, and who is allowed to change them. Companies that treat the engine as a modular foundation, rather than a rulebook bolted onto a payment flow, ship rule changes faster and explain decisions more easily. That is the approach we build around at Bitecode, starting from a pre-built financial and automation baseline of up to 60% instead of a blank repository.
TL;DR
- A fraud rules engine evaluates events against team-defined conditions and triggers a predefined action. Its value is control and explainability.
- Rule order matters. In many engines the first matching rule decides the outcome, so a poorly placed rule can silently override a better one.
- Rules and workflows solve different problems: rules decide an outcome on the facts at hand, workflows coordinate what happens next across steps, vendors and people.
- Backtest and shadow-test every rule before it goes live, and measure precision, not only catch rate.
- Rules and machine learning work best together: models produce scores, rules turn scores into decisions.
What a fraud rules engine actually does
Each rule has the same anatomy: a condition on data, a point in the customer journey where it runs, an action, and feedback from outcomes. A condition might read “more than five transfers to new beneficiaries in one hour.” The checkpoint could be account creation, a profile change or pre-authorization. The action is an approval, a decline, a step-up check or a manual review. The feedback, such as confirmed fraud and chargebacks, is what lets a team tune thresholds.

The engine is the runtime that holds these rules, fetches the data they need, evaluates them and dispatches the action. Mature engines also store a history of every decision so a rule hit can be explained to a customer, a card issuer or an auditor. “The order exceeded the new-customer limit” is an answer a compliance team can defend. “The model said so” is much harder to defend.
This is also why rules remain central in regulated environments. A lender, a payments company or an insurer often has to show why a decision was made, and a deterministic rule produces that trail directly.
How rule-based fraud detection evaluates an event
The flow is similar across implementations, and the published engineering write-ups from large operators show the same pattern.
- Event arrives. A checkout, login or payout request enters at a defined checkpoint.
- Features are assembled. The engine pulls the facts the rules need: device history, account age, velocity counts, chargeback rate, model scores.
- Rules are evaluated. Conditions are compared with the facts.
- Action is dispatched. The result is a decision, a warning, a suspension or a case for review.
Instacart’s engineering team describes this lifecycle: analysts create and update rules through a UI, a feature system fetches data from ML inference services, a feature store and an analytics database, an evaluation service compares features with rule logic, and an action service issues warnings, suspensions or identity checks.
DoorDash describes a similar design in which rule definitions are decoupled from execution, so a rule can change without code changes or redeployments. Its checkpoints, such as checkout, act as entry points where only the rules relevant to that flow run. Facts are modeled as a graph of identifiers and derived signals, for example a user identifier leading to a profile and then to a chargeback rate, so only the subset needed for a given decision is fetched. That keeps latency predictable when decisions must be made in milliseconds.
Rule order and conflict resolution
Ordering is where many first implementations go wrong. Broadcom’s payment-security documentation explains one model: the engine runs all enabled rules in a ruleset and produces a score and advice for each, then parses them by a configured scoring priority, stops at the first match and returns that rule’s result as final.
The practical consequence is that a broad rule placed above a narrow one can swallow it. A rule that rejects every order over $1,000 will override a narrower exception for a trusted, long-standing customer unless the exception ranks higher. Decide your precedence model on paper before building: do explicit allow lists run first, then blocks, then reviews, and does a match stop evaluation or continue to collect signals? Write that into the engine’s design, not into tribal knowledge.
Common fraud detection rules and the data behind them
Most rules fall into a few families:
- Velocity rules: many attempts, cards, accounts or transfers from one device, IP address or beneficiary within a window.
- Threshold rules: amounts above a limit for a new account, or sudden jumps against an account’s normal behavior.
- Identity and account rules: account age, mismatched billing and shipping data, shared devices across accounts.
- Policy rules: business context no vendor model knows, such as a region you stopped serving, a product that resells on gray markets or a promo code attracting abuse.
- Score-based rules: a model score of, say, 72 means nothing until a rule states what happens above 70.
A simple starter set might accept accounts older than a set number of days, reject when several accounts share a device and send orders over a set amount to manual review. Treat these as scaffolding to be tuned against your own data. The value of a rule depends on the features behind it, and weak data quality produces weak rules. Our guides on data quality monitoring and audit-ready finance data pipelines cover the plumbing that rules depend on.
For merchants specifically, a layered ecommerce fraud prevention approach shows how rules sit alongside other controls in a payment stack.
Testing rules before they cost you customers
Fraud is rare, so a rule that flags too many legitimate transactions can look effective while burying analysts in noise. A practical method, described in the Manning book Financial AI in Practice, is to prototype rules on historical labeled transactions, count how many each rule flags and how many of those are fraudulent, and compute precision: fraudulent flagged divided by total flagged.
A worked example: a rule flags 200 transactions in a historical sample and 10 are confirmed fraud. Precision is 5%. If a tighter version flags 40 and catches 8, precision is 20% and you lose only two frauds while removing 160 reviews. Whether that trade is right depends on the cost of a missed fraud against the cost of a review and of a declined good customer.
A sound release path has three stages:
- Backtest against historical data to estimate hit rate and precision.
- Shadow evaluate on live traffic without acting, so edge cases and data issues surface. DoorDash notes that shadow evaluation exposes problems that rarely appear in offline testing.
- Promote to live, ideally to a segment first, with versioning so you can roll back.
Rules engine vs. workflow engine
The two are often confused because both execute logic. They answer different questions.
| Rules engine | Workflow engine | |
|---|---|---|
| Core question | Which outcome applies to these facts? | What happens next, and who does it? |
| State | None between calls | Holds process state over minutes, days or weeks |
| Typical output | Approve, review, reject, score | Routing, vendor calls, step-up checks, case handling |
| Who changes it | Usually the fraud team | Fraud, product, operations and finance together |
A rule is a tactic: it evaluates signals present at the moment it fires. A workflow is a strategy: it decides which population an event belongs to, which checks apply, which enrichment services are called and which actions are available. A rule cannot gather new data or wait for a customer to complete a verification step. A workflow without sharp rules is just routing.
The working rule of thumb: move a threshold into a rules engine when a business owner needs to edit it without a developer, when it changes often, when a growing list is turning into a table, or when several services need the same decision. Use workflow automation when the process waits on people or systems. Most fraud operations need both: the workflow enriches an event with identity and device data and triggers a step-up, and the rules decide on the enriched result. See our overview of AI business process automation for how that orchestration layer is built.
Combining rules with machine learning
Rules handle known patterns, business policy and decisions that must be explained. Machine learning handles patterns that shift faster than anyone can write rules. Strong programs run both, with rules acting on model scores.
Uber’s engineering team explains why it built a rules engine for fraud: logic was scattered across the codebase, fraudsters move faster than models can be retrained, heuristics can beat training data in specific cases, and a small team cannot build a model for every one of the roughly two dozen user events the system hooks into. It reserves models for important, complicated events such as trip requests and uses rules for the rest.
The design takeaway is to keep scoring and deciding separate. The model produces a risk score and the rules engine owns the policy that interprets it. That lets your team change thresholds without retraining and gives auditors a clear decision trail. Our posts on how AI enhances transaction monitoring and 100ms transaction scoring design go deeper on the scoring side.
Use cases beyond card payments
The same engine pattern serves several domains:
- Payments and ecommerce: card testing, account takeover, promo abuse, and decisions that route to smart payment routing.
- Banking and fintech: transfer velocity, new-beneficiary checks, mule-account detection, and AML conditions that share rules with fraud.
- Marketplaces and delivery: shopper and merchant abuse, using actions such as warnings or identity checks.
- Lending and insurance: application fraud, where explainability matters for regulators.
- Crypto and token settlements: wallet and transfer limits, velocity checks and approval policies on settlement flows.
Build on a foundation, or start from zero
Teams usually weigh three paths: configure an off-the-shelf fraud product, assemble open components, or build custom. A hosted product is quick to start but tends to put your policy logic inside someone else’s data model. Building from zero gives control but spends months on infrastructure that has nothing to do with your fraud policy: versioning, audit logs, role permissions, case queues, feature retrieval.
A modular foundation changes that trade. You keep ownership of the rules and data model while starting with the commodity parts already in place. That is the path we recommend for financial institutions, fintechs and SaaS companies that need a rules layer tied to their own ledger, workflows and audit requirements.
Where Bitecode fits
Bitecode builds custom enterprise software from modular, ready-made components, with up to 60% of the baseline system pre-built. For fraud and risk teams, the relevant pieces are the Financial Module (multi-currency, audit-ready), the Automation Module for workflow orchestration, and the AI Assistant, all of which can be self-hosted. For tokenized settlement flows we also offer a blockchain payment system.
If you are planning a rules layer, a workflow around it or a scoring service, you can scope it as a small MVP or a larger project and start from the modules that already exist.

Our perspective
Most fraud rules engines fail for organizational reasons, not technical ones. The logic is simple. The trouble starts when only engineering can change a rule, when the data feeding it is inconsistent, or when nobody can say why a decision was made six months ago.
We build these systems on a modular foundation because the expensive parts are the same everywhere: ledgers, audit trails, permissions, workflow, integrations. With up to 60% of the baseline pre-built, a team spends its budget on what is unique to its fraud policy, not on rebuilding plumbing. Because modules can be self-hosted, financial data stays under the client’s control and customization remains theirs.
Our advice is to keep three layers separate: data and features, scores from models, and rules that turn both into decisions. Put orchestration in a workflow layer. That separation lets you accelerate work without accelerating chaos.
Bitecode
FAQ
What is the difference between fraud rules and machine learning?
Rules apply explicit conditions your team writes, so every decision is transparent and easy to explain. Machine learning finds patterns in data and returns a score. Most mature programs use both, with rules deciding what to do at each score level.
How many rules should a fraud rules engine have?
There is no fixed number. Organizations commonly stack dozens or hundreds of rules across identity, payment, account takeover and application fraud. What matters is that each rule has an owner, a measured precision and a review date, and that retired rules are removed.
Who should own the rules?
The fraud or risk team should own rule changes, with a controlled path for testing and promotion. Developers own the engine, the data pipeline and the integrations. Splitting ownership this way avoids the bottleneck where every threshold change requires an engineering ticket.
Do I need a workflow engine as well?
If your process includes waiting steps, such as customer verification, vendor calls or analyst review, yes. A rules engine decides on current facts and keeps no state between calls, so a workflow layer handles sequencing around it.
Sources
- Real-time Fraud Detection with Yoda and ClickHouse, Instacart Engineering
- Fighting Fraud at Scale: Insights from building a real-time rules engine, DoorDash
- How Does Rule Engine Work, Broadcom Arcot documentation
- Rule-based system in Financial AI in Practice, Manning liveBook
- Mastermind: Using Uber Engineering to Combat Fraud in Real Time
- Ecommerce Fraud Prevention: A Layered Playbook for Merchants
