Skip to content
← Back to Home

Risk Engine

Serverless fraud detection platform. Transactions are scored by Lambda and DynamoDB via an event-driven pipeline provisioned with AWS SAM. A React analyst dashboard is served from CloudFront.

LambdaAPI GatewayDynamoDBEventBridgeSAMCloudWatchReactTypeScriptCloudFrontS3WAF

Scoring Latency

Lambda P99 < 80 ms

Persistence

DynamoDB On-Demand, TTL 90d

IaC

AWS SAM: Lambda, APIGW, DDB

Observability

CloudWatch Logs + Alarms

Product Walkthrough

Overview

The Risk Engine is a serverless fraud detection platform built on AWS. Transactions arrive at API Gateway, are validated by an Ingest Lambda, then routed through EventBridge to a Scorer Lambda. The scorer writes results to DynamoDB. The entire backend is defined as infrastructure-as-code in AWS SAM. A React and TypeScript analyst dashboard, delivered via CloudFront, shows scored transactions, risk factor breakdowns, and alert queues.

Why serverless: the architecture decisions behind it

Fraud scoring is a variable-throughput workload: quiet overnight, peaking at checkout windows. Lambda scales from zero to thousands of concurrent executions in seconds. You pay only per invocation. There are no idle instances consuming cost during low-traffic periods.

Decoupling ingestion from scoring via EventBridge is a deliberate choice. The Ingest Lambda validates the payload and emits an event. It does not block on scoring. This keeps the ingest path fast regardless of scoring complexity. The scoring function can also be replaced without changing the API contract.

DynamoDB On-Demand mode was chosen because transaction volume is unpredictable and read/write patterns are simple key lookups. There is no capacity planning, no warm-up, and no throttling risk at burst.

Use cases this architecture applies to:

  • • Real-time payment fraud detection
  • • Account takeover and identity risk scoring
  • • Merchant risk classification pipelines
  • • Regulatory compliance event auditing

AWS DocsAWS Lambda Developer Guide

AWS DocsAmazon EventBridge

Backend Architecture

An API Gateway REST endpoint receives transaction payloads. An Ingest Lambda validates the schema and publishes a structured event to EventBridge. A Scorer Lambda consumes the event, runs the multi-factor risk model, and writes the scored result to DynamoDB. Both Lambda functions emit structured JSON logs to CloudWatch. IAM execution roles enforce least-privilege access across all service boundaries.

Backend Architecture Diagram · Official AWS Icons

SERVERLESS BACKEND · AWS SAMClientPOST /scoreHTTPSAPI GatewayREST endpointinvokeIngest FnValidate + emiteventEventBridgeRule busrouteScorer FnRisk enginePutItemDynamoDBOn-DemandCloudWatchLogs + MetricsStructured logs🔐IAM RoleExecution roleLeast-privilege
Event flowObservability (CloudWatch)IAM least-privilegeIcons: AWS Architecture Icons (official)
Component-level architecture explanation

API Gateway: REST endpoint. A regional REST API with a single POST /score route. Request validation is configured at the API Gateway level using a JSON Schema model. Malformed payloads are rejected with a 400 before Lambda is ever invoked. AWS DocsAPI Gateway request validation

Ingest Lambda. Receives the validated payload, runs domain-level validation (currency range checks, merchant ID format), enriches the event with a transaction ID and ingestion timestamp, and publishes to EventBridge with detail-type: TransactionReceived. Returns 202 Accepted immediately. AWS DocsLambda with EventBridge

EventBridge Rule. Matches on source: risk-engine and detail-type: TransactionReceived. Routes to the Scorer Lambda. Failed deliveries after retries go to an SQS dead-letter queue. AWS DocsEventBridge rules

Scorer Lambda. Runs the multi-factor risk model. Computes a composite score (0–100) from five weighted signals: amount, geographic risk, velocity, card-present flag, and time-of-day. Classifies the result as PASS, REVIEW, or BLOCK. Writes the full scored record to DynamoDB with a 90-day TTL. AWS DocsLambda best practices

DynamoDB: On-Demand. Stores scored transactions. The table uses a composite key (transactionId / timestamp) with two Global Secondary Indexes: one on merchantId+timestamp for per-merchant review, one on classification+timestamp for alert queue retrieval. AWS DocsDynamoDB on-demand capacity

IAM Execution Roles. Each Lambda has a separate IAM role. The Ingest role allows events:PutEvents to the specific event bus ARN only. The Scorer role allows dynamodb:PutItem to the specific table ARN only. Neither role has wildcard resource permissions. AWS DocsLambda execution roles

Architecture icons: aws.amazon.com/architecture/icons

Event Flow: Transaction to Score

1

Transaction Submitted: API Gateway

Client sends POST /score with the transaction payload. API Gateway validates the request against a JSON Schema model. Invalid payloads return 400 without invoking Lambda. AWS DocsAPI Gateway request validation

2

Ingestion: Lambda Ingest Function

The Lambda function validates domain rules, generates a transactionId (UUID v4), and publishes a TransactionReceived event to EventBridge. Structured JSON logs go to CloudWatch Logs. Returns 202 Accepted to the caller. AWS DocsLambda structured logging

3

Routing: EventBridge Rule

The EventBridge rule matches the event on source and detail-type, and routes it to the Scorer Lambda. If delivery fails after retries, the event goes to the SQS dead-letter queue. AWS DocsEventBridge dead-letter queues

4

Scoring: Lambda Scorer Function

The scoring engine evaluates five weighted risk factors, sums them into a composite score (0–100), applies classification thresholds, and constructs the full RiskScore record. Emits scoring metrics as CloudWatch EMF structured log entries. AWS DocsCloudWatch Embedded Metric Format

5

Persistence: DynamoDB PutItem

The scored record is written to DynamoDB with the composite key transactionId / timestamp and a 90-day TTL. The write is conditional on the item not already existing, preventing duplicate processing from EventBridge retries. AWS DocsDynamoDB conditional expressions

6

Dashboard Query: Analyst Review

The React dashboard queries scored transactions via API Gateway (GET /transactions), filtering by classification or merchant using DynamoDB GSI queries. REVIEW and BLOCK classifications populate the analyst queue with full factor breakdowns. AWS DocsDynamoDB Global Secondary Indexes

Risk Scoring Engine

The scoring engine is a deterministic, stateless TypeScript module deployed as the Scorer Lambda handler. Each transaction event is evaluated against five weighted risk signals. Factors are summed into a composite score. The score maps to a classification via configurable thresholds. The same module runs in the browser for the demo.

// Core types: same interface in Lambda handler and browser demo
interface Transaction {
  id:          string
  amount:      number          // USD
  merchantId:  string
  country:     string          // ISO 3166-1 alpha-2
  cardPresent: boolean
  velocity:    number          // transactions / hour on this card
  timestamp:   string          // ISO 8601
}

interface RiskScore {
  transactionId:  string
  score:          number        // 0–100
  factors:        RiskFactor[]  // ordered by weight descending
  classification: 'PASS' | 'REVIEW' | 'BLOCK'
  scoredAt:       string        // ISO 8601
}

type RiskFactor =
  | { type: 'HIGH_AMOUNT';      weight: number; value: number }
  | { type: 'GEO_MISMATCH';     weight: number; countryRisk: string }
  | { type: 'HIGH_VELOCITY';    weight: number; txPerHour: number }
  | { type: 'CARD_NOT_PRESENT'; weight: number }
  | { type: 'ODD_HOURS';        weight: number; hour: number }

Factor: High Amount (max 30 pts)

Transactions above $500 receive progressive weight scaling linearly to 30 points at $2,000+. Configurable per merchant category code: travel merchants carry a higher baseline than grocery.

Factor: Geographic Risk (max 25 pts)

Transaction country is resolved against a tiered risk register. High-risk jurisdictions contribute up to 25 points. A mismatch between transaction country and the card issuing country adds a flat 15-point penalty regardless of tier.

Factor: Transaction Velocity (max 20 pts)

More than 3 transactions per hour on the same card signals elevated activity. Above 10/hour, the factor reaches maximum contribution. Velocity is computed over a rolling window from DynamoDB transaction history in the production path.

Classification Thresholds

Score 0–39: PASS. Score 40–69: REVIEW, written to the analyst queue. Score 70–100: BLOCK, transaction declined. Thresholds are environment variables on the Scorer Lambda and can be tuned without a code deployment.

Design note: The scoring module is pure TypeScript with no AWS SDK dependency. It receives a plain Transaction object and returns a RiskScore. The Lambda handler is a thin wrapper that deserialises the EventBridge event, calls the scorer, and writes to DynamoDB. This makes the engine independently testable without mocking any AWS service.

DynamoDB Data Model

A single DynamoDB table stores all scored transactions. The access patterns drive the key design: fast single-item lookup by ID, merchant-level queries for operations teams, and classification-based queuing for analysts.

Table: RiskEngineTransactions
Billing: PAY_PER_REQUEST (On-Demand)
TTL attribute: ttl (Unix epoch, 90 days from scoredAt)

┌──────────────────────────────────────────────────────────────────┐
│ Key        │ Attribute         │ Type   │ Notes                   │
├──────────────────────────────────────────────────────────────────┤
│ PK         │ transactionId     │ String │ UUID v4                 │
│ SK         │ timestamp         │ String │ ISO 8601, sort key      │
├──────────────────────────────────────────────────────────────────┤
│ (data)     │ amount            │ Number │                         │
│            │ country           │ String │ ISO 3166-1 alpha-2      │
│            │ merchantId        │ String │                         │
│            │ cardPresent       │ Bool   │                         │
│            │ riskScore         │ Number │ 0–100                   │
│            │ classification    │ String │ PASS | REVIEW | BLOCK   │
│            │ factors           │ List   │ RiskFactor[]            │
│            │ ttl               │ Number │ Unix epoch              │
└──────────────────────────────────────────────────────────────────┘

GSI 1: MerchantIndex
  PK: merchantId   SK: timestamp
  → Merchant-level transaction history, time-sorted

GSI 2: ClassificationIndex
  PK: classification   SK: timestamp
  → Analyst review queue (REVIEW / BLOCK, newest first)

Conditional Write: Idempotency

The Scorer Lambda writes with a ConditionExpression: attribute_not_exists(transactionId). If EventBridge retries the event after a transient failure, a duplicate PutItem is silently rejected rather than overwriting the original scored record.

AWS DocsDynamoDB condition expressions

TTL: Automatic Expiry

Records expire after 90 days via DynamoDB TTL. Expired items are deleted asynchronously at no additional cost. This bounds storage cost without a scheduled cleanup job.

AWS DocsDynamoDB Time to Live (TTL)

GSI: Merchant Review Queries

Querying GSI 1 with merchantId and a timestamp range returns all transactions for a merchant in chronological order. This supports the operations team workflow of reviewing all activity for a merchant over a time window.

AWS DocsDynamoDB Global Secondary Indexes

GSI: Analyst Alert Queue

Querying GSI 2 with classification=REVIEW (or BLOCK) and a timestamp sort returns the alert backlog newest-first. This is the primary read pattern for the analyst dashboard: a single targeted query, no table scan.

AWS DocsDynamoDB Query operation

Infrastructure as Code: AWS SAM

The entire backend is defined in an AWS SAM template. Lambda functions, API Gateway, DynamoDB, EventBridge rules, IAM roles, and CloudWatch alarms are all version-controlled and deployable from a single sam deploy command. No resources are created manually.

# template.yaml (abbreviated)
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31

Globals:
  Function:
    Runtime: nodejs20.x
    Timeout: 10
    MemorySize: 256
    Environment:
      Variables:
        TABLE_NAME: !Ref TransactionsTable
        EVENT_BUS_NAME: !Ref RiskEventBus

Resources:

  RiskEventBus:
    Type: AWS::Events::EventBus
    Properties:
      Name: risk-engine-bus

  IngestFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: src/ingest/handler.handler
      Policies:
        - EventBridgePutEventsPolicy:
            EventBusName: !Ref RiskEventBus
      Events:
        ScoreApi:
          Type: Api
          Properties:
            Path: /score
            Method: post
            RestApiId: !Ref RiskApi

  ScorerFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: src/scorer/handler.handler
      Policies:
        - DynamoDBWritePolicy:
            TableName: !Ref TransactionsTable
      Events:
        TransactionReceived:
          Type: EventBridgeRule
          Properties:
            EventBusName: !Ref RiskEventBus
            Pattern:
              source: [ "risk-engine" ]
              detail-type: [ "TransactionReceived" ]

  TransactionsTable:
    Type: AWS::DynamoDB::Table
    Properties:
      BillingMode: PAY_PER_REQUEST
      AttributeDefinitions:
        - { AttributeName: transactionId,   AttributeType: S }
        - { AttributeName: timestamp,       AttributeType: S }
        - { AttributeName: merchantId,      AttributeType: S }
        - { AttributeName: classification,  AttributeType: S }
      KeySchema:
        - { AttributeName: transactionId, KeyType: HASH  }
        - { AttributeName: timestamp,     KeyType: RANGE }
      GlobalSecondaryIndexes:
        - IndexName: MerchantIndex
          KeySchema:
            - { AttributeName: merchantId, KeyType: HASH  }
            - { AttributeName: timestamp,  KeyType: RANGE }
          Projection: { ProjectionType: ALL }
        - IndexName: ClassificationIndex
          KeySchema:
            - { AttributeName: classification, KeyType: HASH  }
            - { AttributeName: timestamp,       KeyType: RANGE }
          Projection: { ProjectionType: ALL }
      TimeToLiveSpecification:
        AttributeName: ttl
        Enabled: true

SAM Transform: Serverless Abstractions

SAM extends CloudFormation with higher-level resource types (AWS::Serverless::Function, AWS::Serverless::Api). The transform expands these into the underlying CloudFormation resources: Lambda functions, execution roles, API Gateway stages, and deployment groups, without requiring manual IAM or APIGW configuration.

AWS DocsAWS SAM specification

sam build + sam deploy

sam build compiles TypeScript, installs production dependencies, and packages each function as a separate Lambda deployment archive. sam deploy uploads the artifacts to S3 and executes the CloudFormation change set. A full environment deploy takes under 2 minutes from a clean state.

AWS Docssam deploy reference

Managed Policies: Least Privilege

SAM connectors and managed policy templates (EventBridgePutEventsPolicy, DynamoDBWritePolicy) generate scoped IAM statements automatically, each scoped to the specific resource ARN. No wildcard actions or resource ARNs exist in the produced CloudFormation.

AWS DocsSAM policy templates

Repeatable, Environment-Isolated Deploys

Separate CloudFormation stacks for dev and prod ensure environment isolation. Parameter overrides (stage name, DLQ ARN, threshold values) are passed at deploy time. The same template.yaml deploys both environments without branching the IaC.

AWS DocsDeploying serverless applications

Dashboard Delivery Architecture

The analyst dashboard is a React and TypeScript SPA built with Vite, deployed to S3, and served via CloudFront at /risk-engine/*. It shares the same CloudFront distribution as the portfolio site: one WAF Web ACL, one ACM certificate, one origin access control configuration.

Architecture Diagram · Official AWS Icons

AWS EDGE NETWORKBrowserHTTPSAWS WAFEdge rulesCloudFront/risk-engine/*S3 Bucketdist/ assets🔒ACMTLS certCloudWatchMetrics + logs🛡OACOrigin AccessBehavior: /risk-engine/*
Request flowTLS (ACM)ObservabilityOrigin Access ControlIcons: AWS Architecture Icons (official)
Frontend delivery: architecture details

CloudFront Cache Behaviour: /risk-engine/*. A path-pattern behaviour with priority over the default takes requests matching this prefix and forwards cache misses to the S3 origin prefix risk-engine/. Hashed Vite asset filenames get 1-year TTLs. The index.html gets a 60-second TTL. AWS DocsCloudFront cache behaviours

S3 Origin + OAC. The bucket has Block Public Access enabled on all four settings. Origin Access Control signs every CloudFront-to-S3 request with SigV4. The bucket policy allows GetObject only from this distribution's OAC principal ARN. AWS DocsRestricting S3 access with OAC

WAF + Security Headers. The shared Web ACL covers the dashboard path: rate limiting, IP reputation checks, and managed rule groups. A Response Headers Policy applies HSTS, X-Content-Type-Options, X-Frame-Options, and a Content-Security-Policy to every response. AWS DocsCloudFront response headers policies

Monitoring and Alerting

Lambda: Duration, Errors, Throttles

CloudWatch publishes Lambda metrics per function: Duration (P50/P95/P99), Errors (count), Throttles, ConcurrentExecutions. Alarms fire on Errors > 0 sustained over 5 minutes and P99 Duration > 5,000 ms. SNS delivers alerts to the operator email.

AWS DocsLambda CloudWatch metrics

API Gateway: 4xx / 5xx / Latency

API Gateway publishes 4XXError, 5XXError, Count, Latency, and IntegrationLatency per stage. An alarm on 5XXError > 1 per minute indicates Lambda invocation failures. This separates client errors (4xx) from backend failures (5xx).

AWS DocsAPI Gateway CloudWatch metrics

CloudWatch Logs: Structured JSON

Both Lambda functions emit structured JSON log entries using the CloudWatch Embedded Metric Format (EMF). EMF embeds custom metrics (riskScore, classification, scoringDurationMs) directly in log events, queryable in CloudWatch Logs Insights without a separate metric filter.

AWS DocsCloudWatch Embedded Metric Format

DynamoDB: Consumed Capacity + Throttles

DynamoDB publishes ConsumedReadCapacityUnits, ConsumedWriteCapacityUnits, ThrottledRequests, and SystemErrors per table. An alarm on ThrottledRequests > 0 in On-Demand mode indicates an unexpected burst beyond the table's burst capacity.

AWS DocsDynamoDB CloudWatch metrics

Security Considerations

IAM Least-Privilege: Separate Execution Roles

Each Lambda function has a dedicated IAM execution role with only the permissions its task requires. The Ingest role has events:PutEvents scoped to the specific event bus ARN. The Scorer role has dynamodb:PutItem and dynamodb:GetItem scoped to the specific table ARN. Neither role has * resource permissions or AdministratorAccess.

AWS DocsIAM security best practices
API Gateway Request Validation

A JSON Schema request model on the POST /score route rejects malformed payloads with 400 before Lambda is invoked. This prevents garbage data from reaching the scoring engine and eliminates a class of injection attack on malformed input.

AWS DocsAPI Gateway request validation
EventBridge: Resource Policy Isolation

The custom event bus has a resource policy restricting PutEvents to the specific Ingest Lambda execution role ARN. External AWS accounts and other services cannot publish to the risk engine event bus. All events on the bus originate from the validated ingest path only.

AWS DocsEventBridge resource policies
DynamoDB: Conditional Writes + No IAM Wildcard

Conditional PutItem expressions prevent duplicate scoring and enforce data integrity at the storage layer. The Scorer Lambda role does not have dynamodb:DeleteItem, dynamodb:UpdateItem, or dynamodb:Scan. Writes are append-only and queries use targeted key conditions, not table scans.

AWS DocsDynamoDB condition expressions
Scoring Logic Not Exposed in Production

In the production target, scoring thresholds and factor weights are environment variables on the Lambda function, not present in any client-facing asset. The API returns a RiskScore result, not the model internals. Attackers cannot inspect the scoring rules to craft transactions that evade detection.

AWS DocsLambda environment variables

Scaling Strategy

Lambda: Automatic Concurrency Scaling

Lambda scales from 0 to the account concurrency limit (10,000) in response to incoming events. For fraud scoring, provisioned concurrency on the Scorer function eliminates cold starts. Scoring latency stays consistent regardless of whether the function has been idle.

AWS DocsLambda provisioned concurrency

API Gateway: Throttling and Burst

API Gateway has a default burst limit of 5,000 requests and a steady-state limit of 10,000 requests per second. Usage plans can throttle individual API keys, protecting the backend from a single misconfigured client saturating the scoring pipeline.

AWS DocsAPI Gateway throttling

EventBridge: Decoupled Throughput

EventBridge handles millions of events per second natively. Decoupling ingestion from scoring means a spike in transaction volume increases Ingest Lambda concurrency but does not directly compete with Scorer Lambda. Each scales independently based on its own event rate.

AWS DocsEventBridge service quotas

DynamoDB On-Demand: Zero Capacity Planning

On-Demand mode instantly accommodates up to double the previous peak throughput. There are no capacity units to provision, no throttling risk at normal burst, and no cost for idle capacity. Transaction-level writes are the dominant pattern: single-item PutItems with a TTL.

AWS DocsDynamoDB On-Demand mode

Cost Notes

Cost scales directly with usage. There are no reserved instances or minimum fees for the backend compute layer. At demo-level traffic, the backend cost is effectively zero.

ServiceFree TierProduction Cost Driver
Lambda1M requests / month free~$0.20 per 1M invocations + duration
API Gateway1M calls / month free (12 mo)$3.50 per million calls (REST)
EventBridge1M events / month free (custom bus)$1.00 per million events
DynamoDB25 GB + 25 WCU + 25 RCU freeOn-Demand: $1.25 / million writes
CloudWatch10 custom metrics + 5 GB logs free$0.30 per GB ingested above free
S3 (dashboard)5 GB freeNegligible: ~50 KB assets
CloudFront1 TB transfer / month freeShared distribution, no extra cost

At 100,000 scored transactions/month, total backend cost is under $2/month. At 10 million transactions/month, the cost is approximately $35–$50/month, far less than an equivalent always-on EC2 or container-based scoring service. AWS DocsLambda pricing · AWS DocsDynamoDB pricing

AWS Well-Architected Framework

AWS DocsAWS Well-Architected Framework · AWS DocsServerless Applications Lens

Operational Excellence

Full IaC via SAM. Deploy, rollback, and environment parity are git operations.

The entire backend is version-controlled in template.yaml. A sam deploy is the deployment procedure. Rolling back means re-deploying the previous git tag. There are no manual resource modifications. CloudWatch EMF provides metrics without separate metric filters.

AWS DocsWell-Architected: Operational Excellence
Security

Separate least-privilege IAM roles per function. No wildcard permissions anywhere.

Every service boundary is enforced by IAM. The Ingest Lambda cannot write to DynamoDB. The Scorer Lambda cannot publish to EventBridge. API Gateway validates request shape before Lambda is invoked. EventBridge resource policy restricts the event bus to the ingest role only. Scoring thresholds live in Lambda environment variables, not in any client-facing asset.

AWS DocsWell-Architected: Security
Reliability

EventBridge retry + DLQ. Conditional writes prevent duplicate scoring.

EventBridge retries failed Lambda invocations with exponential backoff and routes exhausted events to an SQS dead-letter queue. No transaction is silently dropped. Conditional PutItem expressions at DynamoDB make the Scorer Lambda idempotent: retried events do not produce duplicate scored records. DynamoDB replicates across a minimum of three AZs.

AWS DocsWell-Architected: Reliability
Performance Efficiency

Provisioned concurrency on Scorer Lambda. DynamoDB single-digit ms P99 reads.

Provisioned concurrency pre-warms Scorer Lambda execution environments, eliminating cold start latency on the scoring path. DynamoDB On-Demand delivers single-digit millisecond P99 read/write latency at any scale. The scoring module is pure compute with no network I/O in the critical path.

AWS DocsWell-Architected: Performance Efficiency
Cost Optimisation

Pay-per-invocation. No idle compute. DynamoDB TTL eliminates storage growth.

Lambda and API Gateway charge per request: zero cost when idle. DynamoDB On-Demand charges per read/write operation. The 90-day TTL bounds storage cost without a cleanup job. Sharing the CloudFront distribution with the main site eliminates the distribution, WAF ACL, and certificate costs for the dashboard.

AWS DocsWell-Architected: Cost Optimisation
Sustainability

Serverless maximises utilisation. No always-on compute for variable workloads.

Lambda functions run only during active invocations: no idle server polling. EventBridge and DynamoDB are fully managed, multi-tenant services where AWS optimises hardware utilisation across customers. Variable fraud scoring workloads are a poor fit for always-on instances. Serverless is the more sustainable compute model by design.

AWS DocsWell-Architected: Sustainability

Future Improvements

Amazon Cognito: Analyst Authentication

Gate the dashboard and the GET /transactions API behind Cognito User Pools. API Gateway authorises requests using a Cognito authoriser: only JWTs from the risk engine user pool are accepted. Analyst roles are mapped to Cognito groups with different IAM permissions for REVIEW vs BLOCK queues.

AWS DocsAPI Gateway Cognito authoriser

Kinesis Data Streams: High-Volume Ingest

For transaction volumes above ~1,000/second, replace API Gateway with Kinesis Data Streams as the ingest layer. The Ingest Lambda reads from the stream in batches, reducing per-transaction overhead. Kinesis maintains ordering within a shard, useful for velocity calculations over ordered card activity.

AWS DocsLambda with Kinesis

Amazon Bedrock: Analyst Narrative

For each REVIEW/BLOCK transaction, invoke a Bedrock foundation model to generate a plain-English investigation brief. The brief surfaces which factors contributed, what the pattern resembles, and what additional data an analyst should check. This transforms the dashboard from a metrics display into an investigation tool.

AWS DocsAmazon Bedrock

SageMaker: ML Scoring Model

Replace the rule-based scoring engine with a SageMaker-hosted XGBoost model trained on historical labelled transaction data. The Scorer Lambda invokes the SageMaker endpoint via the InvokeEndpoint API. Rule-based and ML scores can be blended in an ensemble during the transition period.

AWS DocsSageMaker model deployment