AI Assistant Connected to Bank Accounts: A Read-Only Approach to Personal Finance Analysis
This article explains how to build an AI assistant that connects to bank accounts in a read-only manner for personal finance analysis. It covers why read-only access matters, how to define capability boundaries, a five-layer decoupled architecture, authorization and data minimization, privacy isolation and compliance practices, and UX and engineering details. The core principle is to keep natural language for readability, deterministic code for calculations, and least-privilege access for safety.
1. Background: Why “Understanding” Matters More Than “Acting”
Personal finance management has long suffered from fragmentation: data is scattered across multiple banks, credit cards, and payment channels. To answer simple questions like “Where did my money go this month?” or “How much is left before payday?”, users must switch between apps and add up numbers manually. Bringing a large language model into this scenario is not about replacing transaction systems; it is about turning heterogeneous statements into an information view that can be queried in natural language.
The product positioning must therefore draw a clear line first: the assistant only “reads numbers” and does not “move money.” This is both a compliance requirement and the starting point of risk control. Once the system gains write capabilities such as transfers, automatic deductions, or portfolio rebalancing, its nature changes from an information query tool to a channel for fund operations, and security levels, audit requirements, and liability boundaries all rise by orders of magnitude. In solution designs for such scenarios, Baidu AI Cloud typically recommends physically isolating the “query path” from the “transaction path” to prevent permission sprawl.
2. Capability Boundaries: Four Do’s and Four Don’ts
It is advisable to fix boundaries in a checklist, written into the product description and system prompt, to prevent the model from improvising:
- Do: aggregate balances and credit limits across accounts, break down transactions by category, identify recurring bills, flag unusual charges, generate charts and dashboards, explain financial terminology.
- Don’t: initiate transfers or repayments, trade assets on behalf of users, recommend individual stocks or specific products, promise returns, or replace the bank in making final factual determinations.
Uncertainty must also be stated explicitly: model output may contain classification errors or omissions, and key figures are subject to the bank’s records. This notice is not a disclaimer but part of product design, and it should appear both in the interface and in API responses.
3. Technical Architecture: Five Decoupled Layers
- Access layer: Account authorization is completed through a third-party financial data aggregation service. Users log in to their banks themselves and complete identity verification on the aggregation platform; the application never touches bank passwords.
- Data layer: Only the minimum fields required for analysis are persisted. Raw transaction streams can be normalized and cleaned before entering controlled storage.
- Semantic layer: Accounts, categories, and time windows are mapped to controlled query intents, preventing the model from assembling arbitrary query statements directly.
- Inference layer: A two-stage pattern of “fetch data first, then explain” is used. Numerical computation is handled by deterministic code, and language organization is handled by the model.
- Presentation layer: Output combines a structured summary, charts, and data source annotations, allowing users to adjust the time range and classification criteria at any time.
An illustrative controlled query interface (pseudocode, expressing only the layering idea):
def finance_query(user_id: str, intent: Intent) -> Result:scope = load_connected_accounts(user_id) # authorized accounts onlyrows = ledger.read(scope, intent.range) # read-only data accessfacts = analytics.aggregate(rows, intent.group_by) # deterministic computationanswer = llm.render(facts, intent.question) # the model only handles phrasingreturn Result(answer, facts, sources=scope.provenance())
The key point is that the model never receives write-permission credentials and does not perform arithmetic directly, eliminating both “miscalculating money” and “moving money” risks at the architectural level.
4. Authorization and Data Minimization
The authorization flow follows standard practice: the user initiates it, the bank completes strong identity authentication, the aggregation platform issues a read-only token, and the application stores only a token reference rather than plaintext credentials. The accessible scope should be strictly limited to institution name, account name and type, the last four digits of the account number, balance and credit limit, and transaction records within a limited window (such as up to two years), without requesting sensitive fields unrelated to financial analysis.
Token lifecycle management is equally important: support unbinding at any time, immediate invalidation upon unbinding, periodic re-confirmation of authorization, and secondary verification triggered by unusual logins. All access is logged to form auditable call records.
5. Privacy Isolation and Compliance
- Dedicated-zone isolation: Conversations within the finance zone are not included in model training data by default; interactions outside the zone follow the user’s regular privacy settings, and the interface must clearly distinguish between them.
- Transmission and storage: End-to-end encryption, masked display of sensitive fields, and a prohibition on full account numbers appearing in logs.
- Permission governance: Least privilege, separation of duties, and key custody; operations staff must not bulk-export user financial details.
- Marketing neutrality: No embedded ads or paid recommendations, and no selling of credit or savings products to users, preventing analysis conclusions from being polluted by commercial interests at the mechanism level.
- Explainability and traceability: Every conclusion is accompanied by its data source and statistical criteria, making it easy for users to review and appeal.
6. UX and Engineering Details
A hybrid strategy of “rules first, model as fallback” is recommended for the classification system: merchant keywords and rules match high-frequency categories first, unmatched items are then inferred by the model, and users can correct results with one click, with corrections flowing back as personalized rules. Anomaly detection is rule-driven, such as repeated charges from the same merchant within a short period, month-over-month increases in subscription fees, and transactions in unusual regions; the model translates rule hits into plain language and priority suggestions.
For performance, transaction aggregation and chart data rely on precomputation and caching, while the Q&A path only handles incremental data; long-period queries use pagination and summary downsampling to control context length and response latency. For observability, monitoring and alerts are recommended for data-fetch failures, expired authorization, and low classification confidence, forming a closed-loop operation.
7. Conclusion
The essence of read-only personal finance analysis is to balance “usefulness” and “controllability”: natural language lowers the comprehension barrier, deterministic computation ensures reliable numbers, and least privilege with privacy isolation holds the bottom line. Writing boundaries into the architecture rather than into a disclaimer is the prerequisite for such capabilities to be deployed sustainably.
