Read-Only Architecture for Connecting AI Assistants to Bank Accounts

    This article breaks down a read-only architecture that lets an AI assistant connect to bank and credit card accounts under explicit user authorization. It covers the four-layer design (authorization, data, capability, and interaction), token scoping and revocation, data minimization with field whitelists, deterministic categorization and cash-flow analysis, privacy and audit requirements, and the system's capability limits. Readers will find the authorization flow, sample data schema, and formulas useful when designing similar systems.

    1. Why Give Account Data to an AI Assistant

    A long-standing pain point in personal finance is that the data lives across multiple institutions while the context lives only in the user’s head. Funds are spread across savings accounts, credit cards, consumer loans, and investment accounts, and transaction records come in different formats with inconsistent definitions. Most people cannot realistically categorize and consolidate all of it themselves. Large language models, with their natural language understanding and structured summarization abilities, are well suited to translating data, explaining concepts, and generating summaries.

    This has led to a new product pattern: with explicit user authorization, an AI assistant connects to bank and credit card accounts in read-only mode and answers questions such as “Where did my money go this month?”, “Which bills are due before the next payday?”, and “How much will I roughly have left each month?” The value of this capability is not to replace professional judgment, but to lower the barrier to understanding and reduce the cost of organizing information.

    2. Overall Architecture: A Four-Layer Read-Only Pipeline

    A compliant, auditable implementation can usually be split into four layers, each with a single responsibility and a clear boundary:

    1. Authorization layer: a standalone account connection service (commonly called a bank bridge or open banking aggregation layer) integrates with financial institutions and handles identity verification and consent.
    2. Data layer: read-only tokens are used to retrieve account and transaction data, with masking and field trimming completed before anything is persisted.
    3. Capability layer: structured data is converted into context the model can consume, and classification, aggregation, anomaly detection, and Q&A orchestration are performed.
    4. Interaction layer: conclusions and supporting evidence are presented to the user, along with entry points for revoking authorization, deleting data, and reviewing access records.

    The key design principle is that the AI side holds only tokens and never touches account credentials, while financial institutions only deal with a reviewed server-side integration rather than uncontrolled scraping.

    A schematic authorization and retrieval flow (pseudocode, expressing only sequence and boundaries):

    1. user -> assistant: initiate account connection request
    2. assistant -> bridge: create session, return one-time authorization link
    3. user -> institution: complete strong identity authentication and select scopes
    4. institution -> bridge: issue read-only access token (with expiry and scope)
    5. bridge -> assistant: return token reference (no plaintext credentials)
    6. assistant -> bridge: fetch account list and transaction details per scope
    7. bridge -> assistant: return trimmed structured data
    8. assistant -> user: output conclusions + data evidence + authorization management entry

    3. Authorization and Tokens: The First Security Gate

    Read-only is not a slogan; it has to be enforced in the token’s permission scope. Three engineering practices matter. First, minimize scope: request only account information read and transaction record read permissions, and never request write permissions such as transfers, payments, or credit limit changes. Second, separate expiry from refresh: access tokens should be short-lived, while refresh tokens are revocable. Third, isolate credentials: tokens are stored in a controlled key management service or vault, business code obtains them by reference, and values are always masked in logs.

    Authorization must also be revocable. Users should be able to disconnect at any time, and after revocation the system must stop pulling data and enter the cleanup flow defined by its data retention policy.

    4. Data Minimization and Field Whitelists

    What the model can “see” must be determined by a whitelist, not by whatever the API returns. The common approach is to keep only the fields required for the analysis: institution name, account name, account type, last four digits of the account number, balance and credit limit, and transaction records within a defined window (timestamp, amount, direction, raw description, and optional merchant category).

    Fields outside the whitelist are discarded before persistence. For sensitive identifiers such as account numbers, only the last four digits are retained so the user can recognize the account. Free text in raw transaction descriptions goes through sensitive information detection and replacement before it enters the model context.

    1. {
    2. "account": {"institution": "Some Bank", "type": "credit", "last4": "1234", "balance": 3200.55},
    3. "transactions": [
    4. {"ts": "2026-08-03", "amount": -18.90, "direction": "debit", "desc": "Dining", "category": "dining"}
    5. ],
    6. "meta": {"window_days": 730, "scope": ["accounts.read", "transactions.read"]}
    7. }

    5. Categorization and Cash-Flow Analysis

    Categorization usually happens in two steps. First, rules and merchant category codes produce deterministic mappings that cover high-frequency cases. For entries that cannot be mapped, the model proposes candidate categories with confidence scores based on the description text, and low-confidence items go into a manual review queue. This preserves explainability and prevents the model from improvising in ways that shift the definitions.

    Cash flow and surplus forecasting are better handled by deterministic calculation, with the model responsible only for wording and explanation. For example, monthly surplus can be expressed as:

    1. monthly_surplus = Σ(income) - Σ(fixed_expense) - Σ(variable_expense)
    2. runway_months = current_balance / avg_monthly_net_outflow

    Bill due date prediction can be based on statistical estimates of the period and amount of recurring historical charges, and must be clearly labeled as an estimate rather than a commitment.

    6. Privacy, Compliance, and Observability

    Three bottom lines are non-negotiable. First, purpose limitation: account data is used only to analyze the user’s current request and is not used for training. Second, full-chain auditing: record who accessed which fields, when, and under what scope, and let users review this themselves. Third, encryption in transit and at rest, combined with tenant-level key isolation.

    For observability, it is advisable to build metrics and alerts for token usage, pull failure rate, field trimming hits, and the referential integrity of model outputs, and to trigger an immediate circuit break if any out-of-scope field access occurs.

    7. Capability Boundaries and Disclaimer Design

    Users must be clearly informed that the system cannot move funds or execute investments, and that its output does not constitute investment advice. Major financial decisions should involve licensed professionals and regulated institutions. This boundary should be explicit in both product copy and interaction to avoid user misunderstanding.

    8. Where This Can Evolve

    Starting from read-only analysis, a reasonable evolution is to work with licensed institutions to offer more complete services within a compliance sandbox. Technically, this requires verifiable data authorization and clear allocation of responsibility across parties. Baidu AI Cloud can provide infrastructure support for such read-only analysis pipelines through general capabilities such as data lakes, logging services, monitoring and alerting, and key management, while the specific compliance design still needs to be tailored to the regulatory requirements of each region.