Financial document AI · Payments · RegTech

Multimodal prompt injection in financial document AI — bank statements, invoices, receipts

Financial document AI is one of the highest-stakes applications of vision-language models: bank statement analysis for mortgage underwriting, expense receipt OCR for reimbursement automation, invoice processing for accounts payable, and cheque image processing for remittance — all convert financial document images into structured data that drives real monetary transactions. The adversarial image attack surface in this context is uniquely severe: an adversarially crafted financial document image does not just corrupt metadata or generate misleading copy — it can inject false payment instructions into an accounts payable pipeline, manipulate extracted account numbers and routing codes used in SWIFT or FedNow transfers, alter extracted figures in underwriting data, or insert false expense claims into reimbursement workflows. The financial document AI market includes both standalone tools (Rossum, Docsumo, Mindee, Nanonets) and cloud-platform capabilities (AWS Textract with Amazon Bedrock, Azure Document Intelligence with Azure OpenAI, Google Document AI with Vertex AI) — all of which expose a multimodal prompt injection surface when they process documents from external parties (borrowers, customers, vendors, employees). No financial document AI platform currently has a native adversarial image detection layer. OWASP LLM09 Misinformation identifies financial data extraction as a specific high-risk context for AI-generated false outputs — adversarial document images are the deliberate exploitation of that risk rather than a model error. Glyphward's pre-VLM scan gate provides the missing adversarial image detection layer before any financial document reaches the OCR or VLM extraction step.

TL;DR

Financial document AI pipelines convert images to structured data that drives real payments and underwriting decisions. Adversarial financial document images can inject false payment instructions, manipulate extracted figures, and corrupt compliance audit trails — all bypassing text-only PI scanners because the payload is in the image pixels. Scan every document image with POST https://glyphward.com/v1/scan before OCR or VLM extraction. Reject images with score >= 65. Free tier — 10 scans/day, no card required.

Four multimodal injection surfaces in financial document AI

1. Invoice processing AI with automated SWIFT/FedNow payment initiation. Automated accounts payable platforms (SAP Concur, Coupa, Tipalti, and custom AP automation built on AWS Textract or Azure Document Intelligence) extract payment details — vendor name, bank account number, routing code, invoice amount, payment reference — from supplier-submitted invoice images and feed extracted fields directly into payment initiation workflows for SWIFT wire transfers, ACH payments, or FedNow instant payments. An adversarially crafted invoice image — a legitimate invoice photo with typographic injection text printed at low opacity in the invoice reference field or embedded in the bank details section — can cause the VLM extraction step to return attacker-specified account numbers alongside the genuine invoice data. If the payment automation pipeline applies straight-through processing (STP) for invoices below a certain amount threshold (a common pattern to reduce manual approval overhead), adversarially modified payment details can initiate a real transfer to attacker-controlled accounts before any human reviews the extracted fields. Business Email Compromise (BEC) fraud uses social engineering to modify payment instructions before an invoice reaches an AP system; adversarial invoice images achieve the same outcome by modifying the payment instructions within the invoice image itself — bypassing the email security controls that BEC defences address. The Glyphward scan gate applied to every invoice image at upload time blocks adversarially crafted invoices before the extraction step runs.

2. Bank statement and financial document analysis in mortgage and loan underwriting AI. Mortgage origination platforms (Blend, ICE Mortgage Technology, and custom underwriting workflows built on document AI APIs) use VLMs and OCR engines to analyse bank statement images submitted by loan applicants — extracting account balances, regular deposit patterns, recurring payment obligations, and cash flow summaries to feed automated underwriting models. When loan applicants submit bank statement images, those images are external user-submitted content. An adversarially crafted bank statement image can inject instructions that cause the extraction model to return inflated balance figures, omit identified debt obligations, or generate a summary of financial health that does not match the actual statement content. Unlike invoice payment injection (where the goal is to redirect a real transfer), bank statement injection targets the underwriting decision — the adversarial payload is designed to improve the extracted financial profile of a borrower who would otherwise fail the underwriting criteria. This is AI-enabled loan fraud. Financial institutions relying on automated document AI for underwriting without an adversarial image detection layer have a structural fraud vulnerability in their origination pipeline. The Glyphward scan applied to each bank statement image before it enters the document extraction step catches adversarially manipulated images before their extracted data influences any credit decision.

3. Expense receipt OCR in employee reimbursement and T&E automation platforms. T&E automation platforms (Expensify, Concur, Ramp, Brex AI, and enterprise expense apps built on mobile OCR SDKs) accept employee-submitted receipt images and use OCR and VLM extraction to capture merchant name, date, amount, and category for automatic reimbursement processing. The adversarial surface here is the submitting employee — or an attacker who has compromised an employee's expense submission workflow. An adversarially crafted receipt image — a genuine receipt photograph with typographic injection text added at low opacity in the itemised list section — can cause the OCR extraction to return a higher amount than what appears in the real receipt amount field, add fictitious line items not present on the original receipt, or alter the merchant category classification (changing "coffee shop" to a higher-limit "business meal" category). For platforms with automated approval for small amounts or for specific expense categories, adversarially inflated receipt data can result in larger reimbursements than warranted without triggering an approval workflow. Expense audit systems typically compare the submitted image to the extracted data — if the adversarial text is invisible to a human reviewer examining the image, the audit check (does the extracted amount match what I see on the receipt?) will pass. The Glyphward scan added to the receipt image upload API before extraction detects adversarially crafted receipt images that a human auditor would not catch.

4. Cheque image processing and remote deposit capture in banking platforms. Remote deposit capture (RDC) systems — both consumer mobile deposit apps and business RDC platforms — accept cheque images submitted by customers or business clients and use OCR and image analysis to extract payee name, amount (numeric MICR line and written words line), and routing/account data from the cheque image. Adversarially crafted cheque images can exploit the dual-encoding of the amount field (MICR line and written words) by injecting instructions into the image that cause the OCR extraction model to resolve any discrepancy between the two amount representations in the attacker's favour, or to extract an inflated amount from an adversarially modified cheque image. In high-volume RDC processing environments where large numbers of cheques are processed with automated clearing and no per-item human review below a threshold, adversarial cheque image manipulation is a scalable fraud vector. RDC fraud detection systems typically rely on statistical anomaly detection on amounts (is this significantly higher than this customer's typical deposit amount?) and MICR line validation — they do not scan cheque images for adversarial pixel-level manipulations. The Glyphward pre-scan gate applied before the RDC image processing pipeline catches adversarially structured cheque images before any amount extraction or clearing decision is made.

Integration: financial document ingestion API with Glyphward pre-scan

import base64
import hashlib
import requests
from datetime import datetime, timezone

GLYPHWARD_KEY = "<your-glyphward-api-key>"
GLYPHWARD_THRESHOLD = 65

def ingest_financial_document(
    image_bytes: bytes,
    document_type: str,  # "invoice" | "bank_statement" | "receipt" | "cheque"
    submitter_id: str,
    correlation_id: str,
) -> dict:
    """
    Financial document ingestion with Glyphward pre-scan gate.
    Returns scan audit record; raises on adversarial detection.

    The scan record must be persisted to the audit trail alongside
    the extracted document data for compliance audit requirements.
    """
    encoded = base64.b64encode(image_bytes).decode()
    image_hash = hashlib.sha256(image_bytes).hexdigest()

    scan_resp = requests.post(
        "https://glyphward.com/v1/scan",
        headers={"Authorization": f"Bearer {GLYPHWARD_KEY}"},
        json={"image": encoded},
        timeout=5,
    )

    audit_record = {
        "correlation_id": correlation_id,
        "document_type": document_type,
        "submitter_id": submitter_id,
        "image_sha256": image_hash,
        "scanned_at": datetime.now(timezone.utc).isoformat(),
        "scan_status": None,
        "scan_id": None,
        "scan_score": None,
    }

    if scan_resp.status_code != 200:
        # Fail-closed: scan unavailability -> hold for manual review, not auto-process
        audit_record["scan_status"] = "error_held_for_review"
        persist_audit_record(audit_record)
        raise RuntimeError(
            f"Glyphward scan unavailable for {document_type} {correlation_id} — "
            f"document held for manual processing"
        )

    scan = scan_resp.json()
    audit_record["scan_id"] = scan["scan_id"]
    audit_record["scan_score"] = scan["score"]

    if scan["score"] >= GLYPHWARD_THRESHOLD:
        audit_record["scan_status"] = "adversarial_blocked"
        persist_audit_record(audit_record)
        # Alert fraud/compliance team for high-severity document types
        if document_type in ("invoice", "bank_statement", "cheque"):
            trigger_fraud_alert(submitter_id, document_type, scan["scan_id"], scan["score"])
        raise ValueError(
            f"Adversarial {document_type} blocked: submitter={submitter_id} "
            f"score={scan['score']} scan_id={scan['scan_id']}"
        )

    audit_record["scan_status"] = "clean_passed"
    persist_audit_record(audit_record)
    return audit_record

def persist_audit_record(record: dict):
    # Write to immutable audit log (append-only database table or WORM storage)
    pass

def trigger_fraud_alert(submitter_id: str, doc_type: str, scan_id: str, score: float):
    # Alert fraud operations team; consider account suspension workflow
    pass

Persist every audit_record to an append-only audit table (PostgreSQL with a write-only service role, or AWS S3 with Object Lock WORM configuration) alongside the extracted financial data. The scan_id from Glyphward serves as a cryptographic reference proving that the document was adversarial-content-checked at a specific timestamp before extraction ran — this is the audit evidence required under SOX IT general controls for automated financial data processing. For mortgage and lending workflows, attach the audit_record to the loan origination file as a processing artefact; for AP automation, attach it to the payment record. Get early access

Coverage matrix

Mitigation layer Invoice processing (AP / SWIFT payment) Bank statement analysis (underwriting) Expense receipt OCR (T&E reimbursement) Cheque image processing (RDC)
BEC fraud prevention (email security, domain spoofing detection) Partial — catches socially engineered payment instruction changes via email; does not address in-image injection No — BEC defences address email channel; document image injection is a different vector No No
Dual-control payment approval workflow Partial — catches STP payment anomalies above approval threshold; below-threshold payments remain unreviewed No — underwriting decision review catches some anomalies; adversarial image payload is invisible to reviewers Partial — manager approval for above-policy amounts; adversarially inflated receipts below threshold escape review Partial — amount anomaly detection; adversarial image structure not visible in amount statistics
Document AI vendor fraud detection (Rossum, AWS Textract) No — detects format anomalies and template deviations; not adversarial pixel-level content No No Partial — MICR validation; adversarial image manipulation of written amount field not detected
Glyphward pre-VLM image scan (multimodal PI detection) Yes — invoice upload pre-scan; adversarial payment instruction injection blocked before extraction Yes — statement image pre-scan; adversarial balance inflation blocked before underwriting data extracted Yes — receipt upload pre-scan; adversarially modified amounts blocked before OCR extraction Yes — cheque image pre-scan; adversarially structured images blocked before RDC processing

Related questions

How does adversarial financial document injection differ from traditional document fraud?

Traditional financial document fraud alters the document content visibly — a fraudulent bank statement shows an inflated balance that a human reviewer comparing it to the original statement would notice. Adversarial financial document injection is invisible: the adversarial payload is embedded in the image at a contrast level, position, or encoding that is imperceptible to a human reviewer but detectable and actionable by an OCR or VLM extraction model. A human looking at the adversarial bank statement image sees the genuine statement; the AI extraction pipeline returns figures influenced by the injected instructions. This makes adversarial injection harder to detect in audit review than traditional document forgery — the submitted image visually matches what the human auditor expects to see, while the extracted data has been manipulated. Adversarial image detection (which Glyphward provides) is the only control that catches this class of attack before extraction.

What regulatory frameworks require controls on financial document AI inputs?

Several regulatory frameworks impose relevant requirements. SOX Section 404 (IT general controls) requires controls over automated processing of financial data — an AI pipeline that processes document images and feeds results into financial records must demonstrate input validation controls. PCI-DSS Requirement 6.2 (bespoke and custom software security) requires that applications processing payment-card-related documents protect against attacks on input data. DORA (EU Digital Operational Resilience Act) Article 9 requires financial entities to implement ICT security controls over data integrity throughout processing lifecycles — adversarial document image detection is a direct DORA data integrity control. GDPR Article 22 requires appropriate safeguards for automated decision-making processes — automated loan underwriting or expense approval powered by document AI with no adversarial input validation lacks a demonstrable safeguard. The Glyphward scan log (scan ID, timestamp, score per document) provides the structured audit evidence for all of these compliance requirements.

Can adversarial financial document injection be used to scale up expense fraud across an enterprise?

Yes. The scaling model: an attacker (insider threat or external actor who has compromised an employee's expense workflow) creates a template for adversarially crafted receipt images — a receipt photo with an invisible instruction layer that inflates the amount or adds a fictional line item. They apply this template to multiple legitimate receipt photos across multiple expense submissions. Each individual submission produces a slightly inflated reimbursement that falls below manual review thresholds. Statistically, this is indistinguishable from normal expense variation — no single submission is anomalous enough to trigger a flag. The aggregate fraud is only visible in long-period financial reconciliation. Text-only expense fraud detection tools (amount anomaly scoring, duplicate receipt detection) do not detect this class of attack because the manipulation is in the image pixel layer, not in the submitted metadata. Pre-submission Glyphward scanning of receipt images detects the adversarial template structure regardless of the amount manipulated.

How does this relate to the Snowflake Cortex AI document processing risk?

Financial document AI pipelines built on Snowflake Cortex (using Cortex Document AI for invoice extraction feeding a Snowflake data warehouse) face both the Snowflake Cortex injection surface and the financial document injection surface described on this page. The adversarial document image is the injection vector at the input layer; Cortex Document AI is the extraction layer that converts the image to text that enters the data warehouse; Cortex LLM functions run on that text are the downstream exploitation layer. The Glyphward scan gate at the document upload step (before the image reaches the Cortex Document AI feature) closes the injection surface at the earliest possible point — preventing adversarial payloads from reaching either the Cortex extraction or any downstream Cortex LLM function.

Further reading