The design brief#
“A digital bank operating in the EU and India is launching card and account-to-account payments, an open-banking API for partners, and a GenAI assistant that answers customer questions and can initiate small transfers. Design the security architecture so that it is PCI DSS, DORA, PSD2/PSD3, GDPR/DPDP and RBI compliant, and can withstand a determined attacker.”
1. Architecture overview#
2. Threat model highlights (STRIDE on the key flows)#
| Flow / element | Top threats | Key mitigations |
|---|---|---|
| Customer → edge | Account takeover (S), bots and DDoS (D) | Passkeys / FIDO2 + SCA, device binding, bot management, WAF, rate limits |
| Partner → open-banking API | Stolen tokens (S), BOLA (I) | FAPI 2.0 (PAR, sender-constrained tokens via mTLS or DPoP), consent checks per object |
| Payment service | Tampered amount or payee (T), double spend (T) | Signed requests, dynamic linking (SCA), idempotency keys, ledger invariants |
| Card data | PAN theft (I) | Tokenise at the edge with hosted fields; vault and HSM in a minimal CDE |
| Kafka events | Eavesdropping or injection (I, T), rogue producer (S) | mTLS, ACLs per principal, schema validation, no PAN or PII in events |
| AI assistant | Prompt injection leading to unauthorised transfer (E), data leakage (I) | Least agency, user-scoped tools, step-up SCA for any payment, permission-aware RAG |
| Admin and ops access | Insider misuse (E, R) | JIT privileged access, session recording, four-eyes approval, PAM |
| Supply chain | Malicious dependency or image (T) | SBOM, SLSA provenance, cosign signatures, admission policies |
3. Shrinking PCI scope#
flowchart LR
APP["Mobile / web<br/>hosted card fields (iframe/SDK)"] -->|"PAN over TLS"| TOK["Tokenisation service<br/>+ HSM (CDE)"]
TOK -->|"token"| APP
APP -->|"token only"| PAY["Payment service<br/>(out of CDE scope)"]
PAY -->|"token"| TOK
TOK -->|"PAN (detokenised)"| NET["Card network / acquirer"]
- The CDE contains only the tokenisation service, the HSM and the network connector, in a separate account or VPC with its own keys, its own admins and strict egress.
- Everything else (payment service, Kafka, lakehouse, analytics, AI) sees tokens. That moves them out of scope or reduces their scope, and limits breach impact.
- Payment page scripts are inventoried and integrity-monitored (PCI 6.4.3 and 11.6.1). MFA covers all CDE access (8.4.2).
4. Identity and zero trust#
- Customers: passkeys with risk-based step-up. SCA with dynamic linking for payments (PSD2). Device binding for UPI-style flows (NPCI/RBI).
- Staff: SSO with phishing-resistant MFA, ZTNA instead of VPN, and JIT privileged access with approval and recording.
- Workloads: SPIFFE/SPIRE or cloud workload identity, mesh mTLS, and authorisation policies per service. No static secrets; Vault issues dynamic database credentials.
- Partners: FAPI 2.0 and an mTLS certificate per partner, with consent records checked on every call.
5. Data protection#
- Envelope encryption with customer-managed keys in an HSM, separate per region and zone, and key-usage logs sent to the SIEM.
- Kafka: TLS, OAUTHBEARER, ACLs, field-level encryption for sensitive fields, and a 30-day retention cap on events containing personal data.
- Residency: Indian payment data stays in the India region (RBI). EU personal data stays in the EU, with only aggregates crossing. See the regulated data platform.
- Erasure: crypto-shredding for immutable logs and events. Retention schedules apply per data class.
6. The AI assistant, safely#
| Control | Implementation |
|---|---|
| Least agency | Tools: getBalance, listTransactions, initiateTransfer(max ₹10,000 / €100). No admin tools. |
| User-scoped access | Tools call APIs with the customer’s delegated token, never a service account |
| Step-up for actions | initiateTransfer creates a pending payment that the customer must approve with SCA in the app. The model cannot complete it. |
| Permission-aware RAG | Only public help content and the customer’s own documents are retrievable |
| Guardrails | AI gateway: injection and PII classifiers, output schema validation, token and cost limits |
| Transparency | Discloses AI interaction (EU AI Act Article 50); a human handover path |
| Evaluation | Red-teamed before launch (injection, social engineering, data leakage), regression evaluations on each change |
See AI security.
7. Detection, response and reporting#
- Centralised, tamper-evident logs (retained for at least 1 year, with 180 days in India for CERT-In) feed the SIEM, SOAR playbooks and a 24×7 SOC. Detections are mapped to MITRE ATT&CK.
- Automated incident classification against DORA criteria (clients affected, duration, geographic spread, data loss, critical services, economic impact). The SOC has pre-approved notification templates.
- Reporting clocks are wired into the runbooks:
| Regulator | Clock |
|---|---|
| DORA (EU) | Initial notification within 4 h of classification (and 24 h of awareness); intermediate within 72 h; final within 1 month |
| RBI | Within 6 h, through RBI’s reporting platform |
| CERT-In | Within 6 h |
| GDPR / DPDP | 72 h to the supervisory authority (GDPR); to the Data Protection Board and individuals (DPDP) |
8. Resilience and third parties#
- Multi-AZ by default; tested regional failover for tier-0 services. Restore tests of the ledger and token vault each quarter.
- An annual DORA testing programme (vulnerability scans, scenario tests, chaos experiments) and TLPT every three years if designated.
- Register of information for all ICT providers (cloud, HSM-as-a-service, KYC, model API). Contractual clauses for audit and exit, and documented exit plans. The model provider is treated as a critical dependency, with a fallback model.
9. Compliance map (excerpt)#
| Requirement | Satisfied by |
|---|---|
| PCI DSS 3 & 4 (protect PAN) | Tokenisation, HSM, TLS 1.3, minimal CDE |
| PCI DSS 8.4.2 (MFA into CDE) | Phishing-resistant MFA + JIT PAM |
| PSD2 SCA + dynamic linking | Passkeys + in-app approval bound to amount and payee |
| DORA ICT risk + testing | Asset inventory, threat models, resilience testing programme, restore tests |
| DORA incident reporting | Automated classification + runbooks + templates |
| DORA third-party risk | Register of information + exit plans |
| GDPR / DPDP security and rights | Encryption, minimisation, consent records, erasure via crypto-shredding |
| RBI localisation and cyber directions | India data plane; SOC; 6 h reporting; log retention |
| EU AI Act transparency | AI disclosure, logging, human handover |
Common mistakes#
Quick check#
How does the design minimise PCI DSS scope? Hosted card fields send PAN directly to a tokenisation service with an HSM in a minimal, isolated CDE. Every other system handles only tokens.
Why does the AI assistant create pending transfers instead of executing them? Prompt injection cannot be fully prevented. Requiring customer SCA approval outside the model keeps a manipulated model from moving money.
Which API security profile protects partner open-banking calls? FAPI 2.0, with PAR and sender-constrained tokens (mTLS or DPoP), plus per-object consent checks.
What makes 4- and 6-hour reporting achievable? Centralised logging, SIEM detections, automated incident classification against DORA criteria, and pre-approved runbooks and templates.
Summary#
- Threat-model the critical flows; tokenise PAN at the edge to shrink the CDE.
- Zero trust for customers, staff, workloads and partners (passkeys, JIT, SPIFFE, FAPI 2.0).
- Give the AI assistant least agency, user-scoped tools and SCA-gated actions.
- Automate detection and regulatory reporting, test resilience, govern third parties, and map controls to regulations.
References#
- PCI SSC, PCI DSS v4.0.1.
- OpenID Foundation, FAPI 2.0 Security Profile.
- EU, DORA.
- OWASP, Top 10 for Agentic Applications 2026.