> ## Documentation Index
> Fetch the complete documentation index at: https://finance.qwedai.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# QWED Finance: verification for financial AI

> QWED Finance checks what financial AI produces, from NPV and option prices to AML flags, payment messages and SQL, with deterministic code before it is used.

<Note>
  **QWED Finance v3.0.1** is the current release. It fixes three security advisories: ISO 20022 business rules now read the parsed XML, sanctions screening resists in-word perturbations, and `QueryGuard` rejects MySQL executable comments. See the [overview](/finance/overview) for details.
</Note>

## Overview

**QWED Finance** is a verification library for AI financial agents, banking pipelines, and financial LLM applications. An LLM proposes a number, a decision, a payment message, or a query; QWED Finance recomputes or checks it deterministically before your system acts on it.

It combines formal and high-precision tools: **SymPy** for cash-flow maths, **Z3** for the AML rule, **mpmath** and `Decimal` for pricing and risk, XML parsing with required-element rules for ISO 20022, field checks on the framed text of SWIFT MT messages, and the **SQLGlot** parser for SQL safety.

> **The principle:** LLM text generation is probabilistic; financial accounting is exact. QWED Finance checks LLM outputs against deterministic computations and fails closed when an input is ambiguous or malformed.

***

## Get started

<CodeGroup>
  ```bash Python theme={null}
  pip install qwed-finance==3.0.1
  ```

  ```bash Node.js theme={null}
  npm install @qwed-ai/finance@3.0.1
  pip install qwed-finance==3.0.1
  ```
</CodeGroup>

<Steps>
  <Step title="Take the model's claim">
    A figure, a decision, a payment message or a query your model produced.
  </Step>

  <Step title="Call the guard for it">
    For example `verify_npv` for an NPV, `verify_aml_flag` for an AML decision, or `verify_readonly_safety` for a query. The guard recomputes or checks it.
  </Step>

  <Step title="Act only on a verified result">
    A rejected or unparseable result goes back to the model or to a person, never into your systems.
  </Step>
</Steps>

The [Quickstart](/quickstart) runs a full example in Python and Node.js.

***

## Key capabilities

<CardGroup cols={2}>
  <Card title="11 verification guards" icon="shield-check" href="/finance/guards">
    Compliance, Calendar, Derivatives, Message, ISO, Query, Cross, Bond, FX, Risk, and Trading.
  </Card>

  <Card title="Exact arithmetic" icon="calculator" href="/finance/design">
    `Decimal` and `mpmath` precision for bond pricing, option Greeks, IRR, NPV, FX, and risk metrics.
  </Card>

  <Card title="Receipts and audit logs" icon="file-contract" href="/finance/compliance">
    Verification receipts with keyed HMAC-SHA256 signatures, an audit log, and AML/KYC/sanctions checks.
  </Card>

  <Card title="Integrations" icon="plug" href="/finance/integrations/open-responses">
    OpenAI-compatible tool calls through Open Responses, the Universal Commerce Protocol (UCP), and a GitHub Action for CI.
  </Card>
</CardGroup>

***

## What's new in v3.0.x

<AccordionGroup>
  <Accordion title="v3.0.1: security fixes" icon="lock" defaultOpen>
    * ISO 20022 business rules read amounts and currencies from the parsed XML tree ([GHSA-mrrj-6m2q-jch9](https://github.com/QWED-AI/qwed-finance/security/advisories/GHSA-mrrj-6m2q-jch9)).
    * Sanctions screening folds diacritics and look-alike letters and compares separator-free names ([GHSA-mv2c-jwm9-pfrq](https://github.com/QWED-AI/qwed-finance/security/advisories/GHSA-mv2c-jwm9-pfrq)).
    * `QueryGuard` rejects MySQL `/*! ... */` and MariaDB `/*M! ... */` executable comments ([GHSA-q8r4-6gpp-5fx2](https://github.com/QWED-AI/qwed-finance/security/advisories/GHSA-q8r4-6gpp-5fx2)).
  </Accordion>

  <Accordion title="v3.0.0: keyed receipts and fail-closed inputs" icon="shield-check">
    * `VerificationReceipt.get_signature(key)`: HMAC-SHA256 over all receipt fields, with no default key.
    * ISO amount and currency limits in receipts and UCP; `verify_iso20022_payment` takes `kyc_verified`.
    * Fail-closed AML, sanctions, amount, and message validation.
    * **Breaking (npm):** the `@qwed-ai/finance` bridge sends JSON over stdin with runtime validation; malformed inputs are rejected.
  </Accordion>
</AccordionGroup>

See the full [changelog](https://github.com/QWED-AI/qwed-finance/blob/main/CHANGELOG.md).

***

## Quick navigation

<CardGroup cols={3}>
  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Install `qwed-finance` or `@qwed-ai/finance` and run your first check.
  </Card>

  <Card title="Verification guards" icon="shield" href="/finance/guards">
    Explore the 11 verification guards with working examples.
  </Card>

  <Card title="CI/CD Action" icon="github" href="/finance/action">
    Verify financial calculations in GitHub Actions.
  </Card>
</CardGroup>

<Info>
  QWED Finance is part of the QWED verification ecosystem. For the core protocol and other modules, see [docs.qwedai.com](https://docs.qwedai.com).
</Info>


## Related topics

- [Overview: verification for financial AI](/finance/overview.md)
- [The 11 guards for financial AI verification](/finance/guards.md)
- [Compliance and auditing](/finance/compliance.md)
- [QWED Finance GitHub Action for CI/CD](/finance/action.md)
- [Design and architecture](/finance/design.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.