Read-Only Financial Analysis: Connecting LLMs to Bank Accounts

    This article explains how to build a conversational personal finance assistant that reads bank account data under read-only authorization. It covers the authorization flow, data scope, query and anomaly detection design, and the privacy and engineering risks to manage.

    Conversational personal finance analysis is becoming a typical sensitive use case for large language model applications. Users want to ask everyday questions such as “Where did my money go this month?” or “How much will be left before payday?” The system needs to look up account information, summarize spending, and flag unusual charges, without transferring funds, managing assets, or offering investment operations. The core of this capability is not letting the model operate bank accounts directly. It is a technical chain built on read-only authorization, minimal data, explainable analysis, and revocable access. This article covers system architecture, the authorization flow, data scope, query implementation, anomaly detection, privacy boundaries, and engineering risks.

    1. Capability Positioning: Query and Analysis, Not Fund Operations

    This feature should be positioned strictly as a tool for querying and analyzing financial information. The system can read account data that the user actively connects, and answer questions about balances, spending categories, and changes in recurring bills. It should not have transfer, payment, asset management, or investment capabilities. The model side only gets read permission. Write operations and fund movements must be fully isolated from the assistant.

    This positioning leads to two engineering requirements:

    1. Clear permission boundary: Authorization tokens carry read-only scope, and the server must not hold credentials that can initiate transactions.
    2. Clear answer boundary: When users ask for investment advice, asset allocation, or transfers, the system should explain the relevant information or direct the user to complete the action with their bank. It should not generate executable fund instructions.

    In this type of design, the feature is typically rolled out gradually to a subset of paying subscribers in specific regional markets, with read-only permissions. After connecting an account, users ask questions in natural language. The system returns spending summaries, balance changes, and unusual charges, and notes that key figures should be verified against the bank’s own records.

    2. Authorization Flow: User-Led, Read-Only Tokens, No Password Access

    Account connection is usually handled by a financial data aggregation service. The user logs in to their bank and completes identity verification with the aggregation service, then authorizes the assistant for read-only access. The assistant never obtains the user’s bank password and should not store any credential that could be used to log in. After authorization, the server receives a restricted read-only token or an equivalent credential.

    A typical flow can be summarized as follows:

    1. User -> Assistant: Request to connect a bank account
    2. Assistant -> User: Redirect to the financial data aggregation authorization page
    3. User -> Bank/Aggregation service: Log in and complete identity verification
    4. User -> Aggregation service: Select accounts and grant read-only access
    5. Aggregation service -> Assistant: Return read-only authorization result and account identifiers
    6. Assistant -> User: Display connected accounts and data scope

    The engineering principles are:

    • User-selected accounts: Connect only the accounts the user explicitly chooses. Never connect all accounts by default.
    • Least privilege: Request only the necessary fields, such as account metadata, balances, credit limits, and transaction records.
    • Token isolation: Keep read-only tokens separate from any write-capable credentials. The server never handles bank passwords.
    • Revocable access: Users can disconnect an account at any time. After disconnection, the assistant immediately loses access to related data.
    • Auditability: Log key events such as authorization, disconnection, and data access. Keep plaintext sensitive fields out of logs.

    3. Data Scope and Field Classification

    For accounts a user chooses to connect, the system can typically access the bank name, account name and type, the last four digits of the account number, the balance and credit limit, and up to two years of transaction history. The goal is not to read as much data as possible. The goal is to classify data by purpose:

    • Account metadata: Used to identify the account type and provide context, such as the account name, type, and last four digits.
    • Balances and credit limits: Used to answer questions about available funds, including the situation before or after a repayment date.
    • Transaction records: Used for spending category summaries, recurring bill detection, and unusual charge detection.
    • Time range: Transaction records may cover a long period, but each query should be limited to the time window in the user’s question. This avoids unnecessary full reads.

    Sensitive fields require masking and access control. Account numbers keep only the last four digits. Merchant names and notes in transaction descriptions may contain personal information, so they should be minimized in logs and in the model context. Data retention should match the purpose. After disconnection, access stops, and cached and derived data should be handled according to the privacy policy.

    4. Conversational Queries: From Natural Language to Explainable Computation

    User questions are often vague, such as “Where did my money go this month?” The system should not pass raw transaction records to the model. Instead, it should first parse the intent and plan the query, then use deterministic computation to produce the summary, and finally let the model write the natural language answer.

    The following pseudocode illustrates the flow:

    1. function answer_finance_question(user_question, connected_accounts):
    2. intent = parse_intent(user_question)
    3. # For example: spending summary, balance check, recurring bills, anomaly detection
    4. time_range = resolve_time_range(intent, user_question)
    5. accounts = select_accounts(intent, connected_accounts)
    6. if not accounts:
    7. return "Please connect an account or specify an account scope first"
    8. transactions = fetch_transactions(accounts, time_range)
    9. normalized = normalize_transactions(transactions)
    10. if intent.type == "spending_summary":
    11. result = aggregate_by_category(normalized)
    12. explanation = build_category_explanation(result)
    13. elif intent.type == "balance_check":
    14. result = fetch_balances(accounts)
    15. explanation = build_balance_explanation(result)
    16. elif intent.type == "anomaly_check":
    17. result = detect_anomalies(normalized)
    18. explanation = build_anomaly_explanation(result)
    19. else:
    20. return "Only financial information queries and analysis are currently supported"
    21. return compose_answer(
    22. summary=result,
    23. explanation=explanation,
    24. disclaimer="Key figures should be verified against your bank's records"
    25. )

    This flow reflects a simple principle: the model handles understanding and expression, while computation ensures accuracy. Amount totals, category statistics, and period detection should come from deterministic logic. The model receives only aggregated, structured results and the necessary context. This reduces the exposure of sensitive data and lowers the risk of errors in arithmetic and fact checking.

    5. Anomaly Detection: Combining Rules, Baselines, and Confidence

    Beyond spending summaries, the feature can flag potential anomalies, including duplicate charges, unexpected fees, and recurring bills that keep rising. Relying only on the model’s judgment is not sufficient. A better approach combines rules, statistical baselines, and confidence hints:

    • Duplicate charges: Detect multiple charges with the same amount, the same merchant, or similar descriptions within a short time window.
    • Unexpected fees: Compare each charge with the historical spending distribution and identify single charges that clearly deviate from the baseline.
    • Rising recurring bills: Run trend analysis on fixed-cycle transactions and flag subscriptions or bills that keep increasing.
    • Confidence and explanation: When the system outputs anomaly candidates, include the time, amount, possible cause, and confidence level. Avoid absolute conclusions.

    Anomaly results should be presented as alerts, not final judgments. The system should suggest that users check their bank statements and contact the bank if needed. It should not automatically start refunds, payment stops, or transfers.

    6. Privacy Isolation and Security Boundaries

    Personal financial data is highly sensitive, so privacy protections must be part of the design from the start. One workable principle is that conversations within a dedicated personal finance area are not used for model training. Interactions outside that area follow the user’s general privacy settings. Isolation means that data use, context retention, and training policies are set per scenario. They should not be reused by default just because both scenarios belong to the same assistant product.

    The security boundaries also include:

    • Encryption in transit and at rest: Authorization tokens, transaction records, and cached data must be encrypted.
    • Access control: Check permissions by user, account, and session to prevent unauthorized reads.
    • Log masking: Audit logs must not record full account numbers, plaintext transaction descriptions, or tokens.
    • Immediate effect of disconnection: After a user disconnects an account, the assistant cannot access the related data.
    • Accuracy notice: Answers may contain errors, so key figures should be verified against the bank’s information.
    • No investment operations: The system does not perform transfers, asset management, or investment actions. This keeps its capabilities within scope.

    7. Risks and Recommendations for Engineering Practice

    Deployment also requires handling data consistency, time zones, refund reversals, ambiguous categories, and delayed posting of transactions. Users should be able to correct spending categories. Balance queries should show the time the data was last updated. Anomaly alerts should link to a traceable list of transactions. For questions such as “How much will be left before payday?”, the system should separate the current balance, expected incoming income, and known recurring expenses. This avoids misleading forecasts.

    In short, connecting an LLM to bank accounts is valuable because it makes financial information easier to understand. It does not replace bank systems or handle fund operations. Conversational personal finance analysis can balance usability, explainability, and security only when read-only authorization, minimal data, deterministic computation, privacy isolation, and revocable access work together.