Building practical AI
Deepak Kumar Tiwari

Deepak Kumar Tiwari

Technology & AI Leader · Building practical systems

Production workflows / Guide 26

A Home Loan Application Agent That Organizes Evidence, Not Credit Decisions

Design a home loan application agent for document intake, income provenance, missing-evidence checks, and fair human review without autonomous credit decisions.

Illustrative engineering guide. Examples are not client deployments, production-ready integrations, or evidence of measured results. Validate the design with your domain and security owners.

Reference workflow: Authenticated applicant and consent; Document extraction with provenance; Versioned completeness checks; Human underwriting review; Approved applicant communication.
Reference workflow. Steps identify responsibilities, not necessarily separate agents. Branches and recovery paths are explained below. Open full-size diagram.

A home loan application agent should reduce missing-document loops without deciding who deserves a mortgage. Imagine a hypothetical applicant with salary income, quarterly bonuses, and a bank transfer from a family member. A model could mistake the transfer for recurring earnings or interpret a missing statement as evidence of poor creditworthiness. This reference design confines AI to organizing evidence, explaining requirements, and preparing a review packet for authorized staff.

Separate Intake From Underwriting

Define distinct states for received, parsed, verified, clarification required, ready for staff review, and lender decision recorded. “Ready for review” is not approved, pre-approved, eligible, or guaranteed. Customer-facing language must preserve that distinction even when the applicant asks for reassurance.

The FDIC mortgage guide explains that mortgage evaluation involves financial records and that lending protections extend through the process. It also distinguishes interest rates, fees, APR, and other costs. Use those concepts to organize explanations, not to manufacture an offer or legal conclusion. Product-specific requirements, disclosure timing, and applicable jurisdiction must be configured and reviewed by qualified lending and compliance staff.

An LLM can extract a likely employer name and point to the source page. Deterministic software must validate amounts, currency, date ranges, document identity, required evidence, and workflow permissions. Credit decisions, policy exceptions, and adverse-action communications remain with authorized humans and approved lender systems. The assistant must not infer protected attributes from names, photos, language, neighborhood, or family circumstances.

Preserve the Meaning of Every Amount

Represent each extracted financial fact with amount, currency, period, gross-or-net classification, source document, page reference, extraction confidence, and verification state. A salary amount without its pay period is not useful income evidence. A monthly bank deposit may combine wages and reimbursements. A year-to-date total should not be treated as a single month’s earnings.

Keep original documents immutable within the approved retention policy. Store corrections as new extraction versions so reviewers can see what changed. When two documents disagree, show both rather than averaging them. A low-confidence digit can change a ratio materially; the interface should open the relevant crop or page for a human to verify.

The following executable Python illustrates period normalization for a verified amount. It is not an underwriting rule and deliberately does not determine qualifying income.

from decimal import Decimal

def annualized_amount(amount, periods_per_year, verified):
    if not verified:
        return None
    value = Decimal(amount)
    if not value.is_finite() or value < 0:
        raise ValueError("Invalid amount")
    if periods_per_year not in {12, 24, 26, 52}:
        raise ValueError("Unsupported pay frequency")
    return value * periods_per_year

assert annualized_amount("2500.00", 24, True) == Decimal("60000.00")
assert annualized_amount("2500.00", 26, True) == Decimal("65000.00")
assert annualized_amount("2500.00", 24, False) is None

Semimonthly and biweekly payments have different annual counts; conflating them creates a systematic error rather than random model noise. The example omits currency handling, irregular income rules, employment continuity, deductions, and independent document verification. A normalized arithmetic value must never be labeled lender-accepted income without the lender’s reviewed calculation policy.

Build the Minimum Evidence Workflow

Start with secure upload, malware scanning, document classification, extraction, a versioned checklist, and an underwriter review queue. Bind every file to an authenticated applicant and application server-side. Resolve joint applicants explicitly; do not assume that a document uploaded to a household case may be shared with every participant.

Checklist requirements depend on product, application stage, and approved policy. Do not require every possible document at the start or let missing optional material block access to an application process. Staff must validate whether evidence requests are appropriate for that stage. The system should explain exactly which item is missing and offer an accessible alternative submission route.

One coordinator plus extraction tools is usually enough. A separate specialist may help classify self-employment documents when it has its own evaluated contract, but it still cannot accept income or decide credit. Avoid a collection of “underwriter agents” voting on applicants. Agreement among models is not accountable lending judgment.

Handle Stale and Conflicting Evidence Safely

A document’s upload date does not make its contents current. Track the statement period and policy-specific validity window. If a new payslip arrives after a review packet is prepared, mark the affected facts superseded and require revalidation before a staff decision uses them. Do not silently update numbers underneath an approval screen.

Use a stable application ID, document content hash, and upload request key to handle repeated submissions. A timeout after file persistence should reconcile the existing upload rather than create multiple checklist items. Approved outbound requests need their own idempotency keys. If a notification fails after the case update succeeds, retry delivery only; do not reopen already satisfied requirements.

Use server-side roles and tenant isolation for lenders, brokers, applicants, and reviewers. PostgreSQL row security can reinforce application-level scoping, but privileged roles can bypass it and must not be used casually. Minimize financial details in prompts and logs, restrict provider retention, and protect raw documents separately from operational metrics.

Application documents are untrusted. A PDF instruction claiming that the applicant is pre-approved must not change status. OWASP’s LLM security project explains prompt-injection and sensitive-disclosure risks. Keep extraction output behind schema validation and prohibit arbitrary email recipients, external upload URLs, or direct database statements selected by the model.

Test Fairness as Well as Arithmetic

Before pilot use, exercise these acceptance cases:

  • A semimonthly payslip and a biweekly payslip show the same amount. Annualized arithmetic differs correctly, while neither becomes automatic qualifying income.
  • A one-time family transfer appears in a bank statement. The assistant flags an evidence question and does not classify it as recurring salary.
  • An unreadable page contains a key amount. The field stays unverified and the packet cannot claim complete verified evidence.
  • A duplicate upload arrives after a lost response. One document record and one checklist update remain.
  • Equivalent application fixtures vary only in names or inferred demographic cues. Evidence requests and routing remain equivalent, with deviations investigated by a fairness reviewer.

Baseline staff handling time, repeat evidence requests, and extraction correction rates for representative application types. Measure first-pass packet completeness as packets accepted for review without avoidable evidence rework divided by submitted review packets. Measure field accuracy on verified labeled documents, broken down by document type and scan quality.

Guardrails include unsupported approval language, inappropriate evidence requests, privacy incidents, and disparities in error or escalation rates across lawfully evaluated groups. Fairness audits require approved data collection and restricted access; do not infer sensitive attributes to populate a dashboard. Roll out to one document class in shadow mode, then staff-assisted intake. Proposed efficiency targets must not substitute for measured applicant outcomes.

The credit limit increase guide explores another human-controlled credit workflow, while bank customer support covers authenticated status explanations. AI Systems, RAG & Agents supports document intelligence and evaluation. Begin by agreeing on the distinction between extracted, verified, and lender-accepted facts; that vocabulary prevents more harm than a more persuasive prompt.

Sources