> ## Documentation Index
> Fetch the complete documentation index at: https://www.marqeta.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Real-Time Decisioning for Token Provisioning

> Learn how Marqeta's Real-Time Decisioning (RTD) engine integrates with token provisioning flows to detect and block fraud in real time.

Marqeta's Real-Time Decisioning (RTD) rule engine can be extended into the token provisioning flow.
Programs can write risk rules that evaluate token provisioning requests using the same RTD rule engine that powers authorization decisioning.
This feature is only available for Visa and Mastercard.

This integration allows programs to:

* **Block bank identification number (BIN) attacks in real time:** Detect and block systematic primary account number (PAN) enumeration attempts before a response is returned to the card network.
* **Apply velocity-based rules:** Configure thresholds for token requestors and devices, and automatically block sources that exceed configurable decline-rate thresholds.

This guide covers how Real-Time Decisioning (RTD) integrates with the token provisioning flow, the events involved, and how to configure decisioning for your program.

At the end of this guide, you will understand:

* How RTD fits into the token provisioning flow
* How RTD behaves when it is not operating on full capacity or unavailable
* How to use RTD events to configure risk rules for your program

## Prerequisites

RTD for token provisioning requires additional activation steps.
To activate it for your program, contact your Marqeta representative.

You must also understand the following before using this feature:

* Marqeta's [Real-Time Decisioning](https://www.marqeta.com/docs/developer-guides/real-time-decisioning-dashboard-quick-start/) engine and rule configuration.
* The token provisioning flow for your card network (Visa and/or Mastercard).

## How RTD for token provisioning works

RTD is performed before the final decision of a token provisioning request.
When a token provisioning is requested, the Token Provisioning service sends a `TOKEN_PROVISION_RT` event to RTD before returning a response to the card network.
RTD evaluates the request against your program's configured rules and returns its recommendation.
The Token Provisioning Service incorporates this recommendation into the final response it constructs for the card network.

### Token provisioning flow

For Visa and Mastercard provisioning, the Token Provisioning service sends a `TOKEN_PROVISION_RT` event to RTD for recommendation before finalizing the token provisioning request.
RTD's recommendation factors into the Token Provisioning service's final decision — if RTD returns a `RISK` decision, the token provisioning request is denied.

### Token provisioning when RTD is unavailable

RTD for token provisioning does not block a provisioning request if RTD is unavailable.

If RTD is unavailable or does not respond within the 100 ms timeout, the Token Provisioning service proceeds as normal and RTD does not affect the provisioning request.
Your program does not depend on RTD availability as a mandatory check in the token provisioning flow.

## How to integrate RTD token provisioning into your workflow

To integrate the RTD token provisioning into your workflow you must write rules and configure decisioning for your program.

The `TOKEN_PROVISION_RT` event schema defines the fields included in each real-time token provisioning event sent to RTD.
Use this schema for risk rules and configuration.

For the full schema reference, including request and response field definitions, AVS and CVV2 code tables, and Marqeta platform-specific reason codes, see the [Token Provision Schema](https://www.marqeta.com/docs/developer-guides/token-provision-rt-schema/).


## Related topics

- [Using Real-Time Decisioning for Token Provisioning](/docs/developer-guides/using-real-time-decisioning-for-token-provisioning.md)
- [Real-Time Decisioning Authorizations](/docs/diva-api/real-time-decisioning-authorizations.md)
- [Real-Time Decisioning Dashboard Quick Start](/docs/developer-guides/real-time-decisioning-dashboard-quick-start.md)
- [RiskControl Overview](/docs/developer-guides/real-time-decisioning-landing-page.md)
- [Token Provision Schema](/docs/developer-guides/token-provision-rt-schema.md)
