LLM Personal Finance Assistant: Architecting Read-Only Account Access with Privacy by Design
This article breaks down how to build an LLM-based personal finance assistant that connects to bank and card accounts in a strictly read-only mode. It explains why read-only access is the foundational security boundary, walks through the five-layer architecture, and covers token custody, data minimization, account unbinding, transaction normalization, pushing arithmetic down to a dedicated compute layer, traceable numbers, prompt-injection defenses, declarative charting, and numerical regression testing. The focus is on making every number traceable, every permission revocable, and every out-of-scope request blocked by architecture rather than by prompt instructions.
LLM Personal Finance Assistant: Architecting Read-Only Account Access with Privacy by Design
1. The Core Question: Why It Must Be “Read-Only, Never Write”
Consumer financial data is highly fragmented: a single user may hold debit cards across two or three banks, several credit cards, and an e-wallet. To answer questions like “Where did my money go this month?” or “How much disposable income do I have left before payday?” on a phone, users have to switch between multiple apps and do mental arithmetic — a cognitive burden far higher than the complexity of the underlying data.
LLM capabilities match this class of problems well: fuzzy intent, colloquial phrasing, cross-source aggregation, and natural-language explanation. But the moment an LLM enters the financial domain, the risk profile changes dramatically. So the first design decision is not “what can the model do?” but rather drawing a hard line on what the model must never do.
“Read-only” is not product squeamishness. It is a deliberate narrowing of the threat model:
- Eliminating the path to financial loss. With no transfer, payment, order-placement, or binding-modification tools, the worst outcome of prompt injection, unauthorized invocation, or model misjudgment is “read a balance it shouldn’t have seen” — not “money moved out of the account.” This downgrades a high-consequence, irreversible risk to a medium-consequence, auditable one.
- Avoiding the compliance high-wire. Not touching funds reclassifies the product from a “payment / wealth-management service” to “information aggregation and query analytics,” with materially different licensing and market-access requirements.
- Reducing audit complexity. On a read-only path, all external side effects occur in the data ingestion layer and can be fully replayed.
The engineering implication is clear: read-only must be guaranteed by architecture, not declared in a prompt. Telling the model in a system prompt “you cannot transfer money” is a weak constraint. Having no transfer interface in the tool registry at all is a strong one.
2. Overall Architecture: Five Layers and Two Iron Rules
┌─────────────────────────────────────────────┐│ Conversation: multi-turn chat / charts / ││ bill calendar / dashboards │├─────────────────────────────────────────────┤│ Orchestration: intent detection · domain ││ boundary checks · tool invocation │├─────────────────────────────────────────────┤│ Compute: aggregate queries · statistical ││ definitions · anomaly detection │├─────────────────────────────────────────────┤│ Ingestion: account aggregation gateway · ││ token vault · sync scheduler │├─────────────────────────────────────────────┤│ Security: redaction · audit · permissions · ││ lifecycle management │└─────────────────────────────────────────────┘
Two iron rules run across the entire stack:
- The model never holds credentials. Bank passwords and authorization tokens never enter the context window. They live only in a controlled token custody service, and the ingestion layer injects them into request headers at call time.
- The model does no arithmetic. All summation, differencing, currency conversion, and time-window filtering happen in the compute layer. The model is responsible for only three things: turning colloquial input into a structured query, turning results back into plain language, and deciding whether a question is out of scope.
Violating the second rule is the most common source of failures in this type of system. If you make the model “read the transaction stream and add things up,” you will inevitably get order-of-magnitude errors across dozens of transactions, multiple currencies, refunds, and reversals — errors that are non-reproducible and cannot be regression-tested.
3. Account Access: Authorization, Minimization, Unbinding
3.1 The Authorization Flow
Access is not implemented directly by the AI system. It is delegated to an independent account aggregation service (the open banking / data aggregation pattern common in the industry):
- The user initiates binding in the front end; the server issues a one-time, short-lived session identifier.
- The user is redirected to the aggregation service’s side, where they enter their bank credentials themselves and complete multi-factor authentication.
- The aggregation service returns tokens (access token + refresh token) and the account catalog to the AI platform. The platform never touches the user’s bank password.
- The platform writes the tokens to an independent token vault using envelope encryption: a data key encrypts the token ciphertext, the master key is held in a key management service, tokens are never stored in plaintext in the business database, and they never appear in logs.
3.2 Data Minimization Checklist
Authorize only the minimum set needed to answer financial questions. Recommended field scope:
- Institution and account metadata: institution name, account nickname, account type, last four digits of the account number, currency;
- Balance-related: balance, credit limit, available limit;
- Transaction-related: timestamp, amount, direction, merchant name, category code, memo, with a maximum retention period of about two years.
Explicitly not collected: full card number, expiration date, CVV, online banking password, biometric data. Only the last four digits of the account number are retained for identification; everything else is truncated at the ingestion boundary.
3.3 Synchronization and Freshness
Initial binding requires backfilling historical data (up to two years), so it must be asynchronous: enqueue a message → paginated cursor pull → rate-limited backoff retries → emit a “sync complete” event to notify the front end after ingestion. Daily operation uses incremental sync, and the data snapshot time should be displayed explicitly. Because balances are point-in-time quantities, any answer to “how much do I have right now” should include “as of X at Y, from the most recent sync with Institution A.”
3.4 Unbinding Semantics
Unbinding is not flipping a switch. It is a sequence of actions: revoke the aggregation service token → destroy the token ciphertext in the vault → invalidate caches and vector indexes → enqueue derived data for deletion → write an immutable audit record. The user should be able to do this self-service at any time and receive a clear receipt describing the scope of deletion.
4. A Unified Transaction Model: Turning Messy Streams into Queryable Facts
Cross-institution data varies enormously and must be normalized before analysis:
{"txn_id": "sha256(account_id|time|amount|merchant|seq)","account_id": "acc_****-4821","currency": "USD","posted_at": "2026-08-27T10:12:00+08:00","amount_minor": 1024,"direction": "DEBIT","merchant_raw": "XXX COFFEE #1123 1/3","merchant_norm": "Coffee & Tea","category_l1": "Dining","category_l2": "Coffee","is_recurring": false,"is_reversal": false}
Three commonly overlooked points:
- Store amounts as integer minor currency units and format only at the display layer, eliminating cent-level rounding errors caused by floating-point arithmetic.
- Normalize timestamps to absolute time with a timezone. Aggregation semantics (calendar month / billing cycle) should be declared explicitly in the query layer, avoiding “monthly” misalignment for cross-border users.
- Flag refunds and reversals separately. Otherwise, a single purchase and its refund will be double-counted in totals.
Merchant normalization can start with merchant category code (MCC) mapping for the top-level category, then apply rules plus a controlled vocabulary to refine the second-level category, producing a stable analytical taxonomy.
5. Pushing Computation Down: Tool Contracts and Invocation Orchestration
The orchestration layer first uses a lightweight intent classifier to determine whether a question is a query, analysis, terminology explanation, or out-of-scope request. Once classified, the model emits a schema-constrained structured query rather than guessing in natural language:
{"tool": "query_spending","args": {"range": {"from": "2026-08-01", "to": "2026-08-31"},"group_by": ["category_l1"],"accounts": ["acc_****-4821", "acc_****-7710"],"filters": {"direction": "DEBIT"}}}
When the compute layer returns results, it must include metadata: the statistical definition (calendar month), currency, conversion exchange rates and their date, participating accounts, data snapshot ID, and data update time. This metadata is the foundation for trust and auditability downstream, and it serves as the anchor that prevents the model from mixing up sources when composing an answer.
Compound questions like “how much will I have left before payday” should be decomposed into two queries: identify fixed monthly expenses from history → detect recurring charges (by clustering on amount and periodicity) → subtract scheduled charges over the next several days, presenting intermediate values and assumptions (e.g., “assuming no new spending”) alongside the result.
6. Trustworthiness: Traceable Numbers and Algorithmic Anomaly Detection
- Every number is traceable. Amounts in answers include the source account, statistical window, and snapshot time. The front end provides a “View details” drill-down that traces conclusions back to raw transactions.
- Tolerance and fallback. Proactively clarify when a rare statistical definition first appears; attach a standard note to key numbers: if they conflict with the institution’s records, the institution’s records take precedence.
- Terminology explanations follow a managed vocabulary. For questions like “How much extra did my annual percentage rate cost me this year,” first retrieve the definition from a controlled knowledge base (avoiding improvised financial definitions from the model), then use the compute layer to calculate actual interest paid, forming a fixed three-step flow: definition → calculation → conclusion.
- Anomaly detection is algorithmic, not intuitive:
- Duplicate charges: fuzzy matching on similar amounts (with cent-level tolerance) + temporal proximity + merchant similarity;
- Unexpected fees: charges that are new and absent from the historical frequency distribution;
- Recurring bill increases: trend testing on the time series for the same merchant, outputting the percentage change and the number of consecutive months of increases.
7. Security Boundaries: Prompt Injection, Privacy Compartments, and Compliance
7.1 Transaction Memos Are Untrusted Input
Merchant names and transfer memos are free-text fields written by external systems and are natural vectors for prompt injection. Defenses:
- Physically separate data from instructions. External text enters only as tool return values, tagged explicitly as “non-executable content.”
- Output allowlist. Answer templates are restricted to “conclusion sentence + number table + source annotations.” URLs, instruction-like text, and code are forbidden in responses.
- Minimize the toolset. Read-only tools, no outbound-call capability, no file-write capability — so even a successful injection has nowhere to act.
- Secondary verification. Numeric answers are recomputed and compared by the compute layer before being returned. Any mismatch triggers a block and degrades to “please check the details.”
7.2 Privacy Compartments and Lifecycle
Financial conversations are placed in a dedicated data domain, with a configuration flag explicitly stating “conversations in this domain are not used for model training.” Interactions outside the domain follow the user’s existing privacy settings. The product also provides: retention policies for conversations and data, one-click deletion of derived data, account-level authorization visualization (which accounts, which fields, which time range are authorized), and complete access auditing (who read which type of data from which account and when, and which session triggered it).
7.3 Recommended Boundaries
The product explicitly does not provide investment advice and does not recommend or sell any financial products. The implementation detects requests like “what should I buy,” “should I take out a loan,” or “recommend a product” at the intent layer and uniformly declines by explaining the capability boundary, optionally falling back to pure factual queries (e.g., “show my outstanding balance and interest rate”). No ad placements and no paid recommendation slots are built in. This is both an ethical choice and an engineering measure that drives the cost of the “is this answer tainted by commercial interest?” trust question to zero.
8. Presentation Layer: Declarative Charts and Dashboards
Charts are not implemented by generating executable code. The model emits a declarative spec, and a fixed server-side renderer parses it, avoiding arbitrary code execution risk:
{"type": "bar","title": "August Spending Breakdown","data": {"source": "spending_snapshot", "snapshot_id": "snap_20260827T1012"},"x": "category_l1", "y": "amount_total","meta": {"currency": "USD", "as_of": "2026-08-27T10:12:00+08:00"}}
The bill calendar arranges recurring charges and due dates along a date axis. A custom dashboard is composed of a set of registered cards (spending breakdown, disposable balance, subscription list, debt overview). Each card is bound one-to-one to an underlying query; dragging and dropping to rearrange them is a configuration change, with no logic regeneration required.
9. Evaluation and Observability
Before launch, a numerical regression baseline must be established: construct hundreds of gold-standard questions (covering cross-account, multi-currency, refunds, month boundaries, empty results, and very large result sets), compare answer numbers against authoritative computed results by relative deviation, and set a threshold that must not be exceeded. Simultaneously, track the “correct refusal rate” for out-of-scope questions. In production, monitor: tool-call error rate and timeout rate, number of numerical-deviation blocks, injection-pattern hits, answer latency distribution (initial sync duration tracked separately), and unbinding success rate. Use a unified trace ID across the full chain, and redact sensitive fields in logs before they are persisted.
10. Roadmap and Reusable Infrastructure
A pragmatic phased path: first ship single-user read-only queries and summaries to validate numerical trustworthiness and user retention; then expand to multi-account consolidation, subscription governance, and recurring-bill forecasting; finally, in compliance collaboration with licensed institutions and following open banking interface specifications, explore richer data sources and finer-grained authorization — any capability involving fund movement should remain outside the system, or be implemented by the licensed party within its own compliance framework.
Underlying engineering requirements can be met with general-purpose cloud services: object storage holds reconciliation snapshots and audit trails, message queues decouple initial sync from incremental sync, container platforms elastically scale compute and rendering services, key management services hold token master keys, logging and monitoring/alerting services ensure observability and incident response, and data classification/grading and access-control policies are enforced by a unified permissions center.
In the end, the real moat for this kind of product is not how smart the model is. It is whether “errors are reproducible, numbers are traceable, permissions are revocable, and out-of-scope requests are blocked by hard constraints” is achieved at engineering-grade reliability.
