Loyalty · 03 / 26

Architecture Decisions for the Loyalty Platform

The overall decisions behind the loyalty platform, recorded as ADRs (Architecture Decision Records): context, decision, consequences and alternatives.

How the decisions are recorded

Each decision is an architecture decision record (ADR): a short, dated document with its status, the context that forced the choice, the decision, the consequences and the alternatives rejected. These records cover the whole platform. The vendor pages that follow show how each choice is implemented.

Decision log

ADRDecisionStatusDate
ADR-001Earning, tier, expiry and redemption pricing are deterministic code; models read, score and draftAccepted2026-09-02
ADR-002All model traffic goes through one enterprise AI (artificial intelligence) gatewayAccepted2026-09-04
ADR-003Prisma AIRS scans every document, message, reply and tool call; writes fail closedAccepted2026-09-09
ADR-004Databricks is the data and AI platform, governed by Unity CatalogAccepted2026-09-11
ADR-005Propose, then approve: goodwill, large credits, tier exceptions and fraud holds need a personAccepted2026-09-15
ADR-006Travel history, identity and contact data are minimised, and every send checks consentAccepted2026-09-18
ADR-007Keep the agent core portable: two reference builds behind one tool contractAccepted2026-09-23
ADR-008A release gate: no deploy unless the evaluation set passes, including fairness checksAccepted2026-09-30
ADR-009Offers are decided by rules within budgets and caps; models only draft copy inside approved templatesAccepted2026-10-06
ADR-010Fraud response is score, step up, then review: no automatic account closureAccepted2026-10-09
ADR-011Add a member-facing assistant for status questionsProposed2026-11-12

Status values: Proposed, Accepted, Superseded. Dates are the day the status last changed.

The records

ADR-001 Accepted

Earning, tier, expiry and redemption pricing are deterministic code; models read, score and draft

Context
Miles are a financial liability and a promise to members. Every credit and price must be reproducible and auditable, and models are probabilistic.
Decision
The program rules (earn, tier qualification, expiry, award pricing) are code with unit tests and versioned rules owned by the program office. Models read documents, answer questions from the terms, draft messages and score risk. A model never posts miles, sets a price or changes a tier.
Consequences
  • Results are reproducible for the same inputs.
  • Rule changes go through code review and an effective date.
  • A model upgrade cannot silently change a member's balance.
Alternatives considered
  • Let a model decide credits (rejected: not reproducible, hard to audit)
  • No models at all (rejected: claims documents and question volume are the manual bottleneck)
ADR-002 Accepted

All model traffic goes through one enterprise AI gateway

Context
Teams would otherwise hold provider keys, pick models by name and log differently. Cost, scanning and provider changes would be solved many times, badly.
Decision
Applications call the gateway with a project key and a model alias. The gateway routes, retries, falls back, enforces budgets and rate limits, attaches metadata, applies guardrails and logs every call. Provider keys exist only in the gateway.
Consequences
  • One place to change a model or provider, validated by the evaluation set.
  • Budgets and guardrails apply by default.
  • The gateway is a critical dependency with its own availability target.
Alternatives considered
  • Direct provider SDKs (Software Development Kits) in each service (rejected: key sprawl, no shared controls)
  • A shared client library only (rejected: controls can be bypassed)
ADR-003 Accepted

Prisma AIRS scans every document, message, reply and tool call; writes fail closed

Context
Claim documents, emails and chat text are untrusted input a model will read. Hidden instructions could try to credit miles or leak a member's data.
Decision
Runtime scanning sits on the gateway path and at the tool boundary. Extracted document text, retrieved terms, replies and tool arguments are scanned against a named profile. A block routes the item to a person. If scanning is unavailable, nothing that posts miles or sends a message runs.
Consequences
  • Detection is consistent across every agent.
  • Added latency stays inside the interactive and batch budgets.
  • A scanning outage slows automation to manual, not to unsafe.
Alternatives considered
  • Prompt-only defences (rejected: not enforceable)
  • Scan replies only (rejected: misses injection through documents and tools)
ADR-004 Accepted

Databricks is the data and AI platform, governed by Unity Catalog

Context
Ledger copies, flight activity, features, claims, decisions, evaluation sets and the terms index are data with access rules. Splitting them splits the governance.
Decision
Keep operational copies, features, decisions and traces in Delta tables under Unity Catalog with masks on identity and travel history. Build the terms index with Vector Search from governed tables. Use MLflow for tracing and evaluation, model serving for fraud and propensity models, and Lakeflow jobs for ingestion.
Consequences
  • One lineage and access model for data, features and models.
  • Analysts and evaluators use the tables the product writes.
  • Sync latency and quotas are design inputs.
Alternatives considered
  • A separate feature store, search service and warehouse (rejected: three access models)
ADR-005 Accepted

Propose, then approve: goodwill, large credits, tier exceptions and fraud holds need a person

Context
A wrong credit costs liability and a wrong hold strands a member. The decision cannot depend on how confident a model feels.
Decision
Agents draft and recommend. Credits above 10,000 miles, every goodwill gesture, every tier exception and every fraud hold are applied only after an approval recorded against a named person within their limit. Rule-based credits within the limit post automatically.
Consequences
  • Approval is explainable from the table of limits.
  • Limits are reviewed like any financial control.
  • Some low-risk work still waits for a person.
Alternatives considered
  • Confidence-based auto-approval (rejected: confidence is not authority)
ADR-006 Accepted

Travel history, identity and contact data are minimised, and every send checks consent

Context
Where members fly reveals where they have been and when. Copying it into prompts, logs and analytics would multiply the exposure, and sending offers without consent breaks the member's trust and the law.
Decision
Classify travel history, identity documents, contact data and payment tokens as restricted. Send the model only what a step needs, mask by role in the lakehouse and keep telemetry free of content. A consent service is checked at send time for channel and purpose, and its answer is logged.
Consequences
  • Lower exposure in logs, evaluations and vendor tools.
  • Evaluation data needs a masked copy.
  • A consent lookup adds a call to every send.
Alternatives considered
  • Check consent at campaign design only (rejected: preferences change between design and send)
ADR-007 Accepted

Keep the agent core portable: two reference builds behind one tool contract

Context
Platform choices differ between teams and may change. The tool contracts and policies are what must stay stable.
Decision
Define the tools, policies and evaluation set once. Build a Microsoft Foundry version and a LangGraph version with LangSmith against the same contracts and run the same evaluation set on both.
Consequences
  • Switching or comparing frameworks is a measured change.
  • Two builds cost more to maintain, so one is primary and the other a reference.
  • Contracts must be strict enough to be portable.
Alternatives considered
  • Commit to one framework with no abstraction (rejected: lock-in on the least stable layer)
ADR-008 Accepted

A release gate: no deploy unless the evaluation set passes, including fairness checks

Context
Prompt, model and rule changes can quietly make claims decisions worse, offers unfair or fraud checks looser.
Decision
Every change runs offline evaluation on a versioned set of claims, partner files, fraud scenarios and offers, including adversarial and fairness cases. Accuracy, safety, groundedness, fairness and cost must meet thresholds. Production traces are sampled into new cases.
Consequences
  • Regressions are caught before they touch a balance or a member.
  • The evaluation set needs steady care.
  • Fairness metrics need permitted data and careful interpretation.
Alternatives considered
  • Manual spot checks before release (rejected: does not scale and misses regressions)
ADR-009 Accepted

Offers are decided by rules within budgets and caps; models only draft copy inside approved templates

Context
Personalised offers cost money, reach members' inboxes and can treat groups unequally. Free-text generation to individuals would multiply the review burden.
Decision
A decisioning engine applies eligibility, budget, frequency and exclusion rules. Propensity models may rank within the eligible set. A model drafts copy only by filling templates that a person has approved, and a quarterly review checks allocation for unexplained disparity.
Consequences
  • Spend and contact frequency are controlled in one place.
  • Copy risk is limited to approved templates.
  • Less variety than free generation, by design.
Alternatives considered
  • Per-member generated emails (rejected: unreviewable and unbounded)
  • No personalisation (rejected: leaves value on the table)
ADR-010 Accepted

Fraud response is score, step up, then review: no automatic account closure

Context
Account takeover and award fraud are real losses, but a false positive can strand a genuine member with a large balance.
Decision
Models score logins, redemptions and partner earning. Medium risk triggers step-up verification. High risk places a time-limited hold and opens a case for an analyst. A model can never close an account, forfeit miles or reverse a redemption without a person.
Consequences
  • Genuine members have a quick route back.
  • Analyst capacity sets how many cases can be held.
  • Some fraud is caught later than a hard block would catch it.
Alternatives considered
  • Automatic blocks at a score (rejected: wrongful-hold cost too high)
  • Review everything after the fact (rejected: losses too late)
ADR-011 Proposed

Add a member-facing assistant for status questions

Context
Members ask the same status and expiry questions in the app and by phone. A grounded assistant could answer instantly.
Decision
Proposed: reuse the service copilot behind the app, read-only on balances and rules, unable to promise credits or exceptions. Not accepted yet: authentication, abuse resistance and the commitments the assistant may make must be tested in a pilot.
Consequences
  • Same controls apply to a new channel.
  • Risk of implied commitments needs careful policy.
  • Pending a pilot with a small group of members.
Alternatives considered
  • Agent-facing copilot only (deferred: leaves members' most common questions to the phone)

The principles behind them

Models propose, code disposes

Anything that changes a balance, a status or a message is decided by tested code or a person.

Controls live in the platform

Gateway, scanning, governance and evaluation apply to every team by default.

Step up, do not shut out

Risk controls slow a risky action and ask for proof; they do not punish a member on a score.

Measure before shipping

Accuracy, safety, fairness and cost are tested on every change, not argued about.

Build this for your business

This example is a loyalty platform for an airline, but the same pattern, deterministic financial rules, a governed gateway, runtime security, consent-aware personalisation and measured quality, fits any program that holds a customer balance and makes offers. We can scope a pilot on your own systems.

Book a discovery call