How QWED Finance checks what financial AI produces: the 11 guards, the engines behind them, receipts, and what fails closed before your system acts.
Deterministic verification for financial AI (v3.0.1).QWED Finance is a verification library for financial AI. A language model proposes a figure, a decision, a payment message or a query; QWED Finance recomputes or checks it with deterministic code before your system acts on it. It does not make the model more accurate. It decides whether a given output may be used.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.New in v3.0.1: security fixes.
ISO 20022 business rules read amounts and currencies from the parsed XML tree, not from raw text (GHSA-mrrj-6m2q-jch9)
Sanctions screening folds diacritics and look-alike letters and compares separator-free names, so E.V.I.L. CORP or ÉVIL CORP no longer clears an EVIL CORP entry (GHSA-mv2c-jwm9-pfrq)
QueryGuard rejects MySQL /*! ... */ and MariaDB /*M! ... */ executable comments (GHSA-q8r4-6gpp-5fx2)
v3.0.0 highlights: keyed HMAC receipt signatures (get_signature(key)), ISO amount and currency limits in receipts and UCP, a fail-closed batch for AML, sanctions, amounts and message validation, and a breaking change to the npm bridge (stdin JSON with runtime validation). See the changelog for details.
Language models get arithmetic and strict rules wrong, and in finance close enough is not good enough.
Problem: a model says “IRR is 12%” when it is 11.8%.
What QWED Finance does: it recomputes the IRR from the cash flows and rejects the claim when it differs by more than the tolerance. It reports the value it computed; it does not rewrite the model’s answer.
verify_irr solves NPV = 0 with SymPy and uses the first real root above -100%. Cash flows that change sign more than once can have several IRRs, and the first root is not always the one you mean: check those with verify_npv at each candidate rate. When SymPy finds no real root, the method falls back to a numeric solver and reports verification_mode="HEURISTIC" instead of "SYMBOLIC". A claim that is not a number, such as "not a rate", raises ValueError: treat that as a rejection.
11 guards: Compliance, Calendar, Derivatives, Message, ISO, Query, Cross, Bond, FX, Risk and Trading.
GitHub Action: checks financial calculations in CI, with optional SARIF output for security dashboards.
Receipts: verification receipts for cross-guard and integration flows. Receipts are unsigned by default: call get_signature(key) and store the HMAC-SHA256 signature separately to get a tamper-evident record.
Deterministic results: each check is computed by code, so the same input gives the same result.
from qwed_finance import ComplianceGuardguard = ComplianceGuard()# Check an AML flagging decisionresult = guard.verify_aml_flag( amount=15000, # at or above the 10,000 threshold country_code="US", llm_flagged=True # the model flagged it)print(result.compliant) # Trueprint(result.proof) # "Z3: LLM decision matches regulatory requirement"
UCPIntegration.verify_payment_token() runs four checks: amount limits, currency, AML threshold and KYC status. When an AML flag is needed the status is PENDING_REVIEW, even if another check also failed; BLOCKED means a check failed with no AML flag. Sanctions screening is part of verify_iso20022_payment(), which takes a sanctions list.
The checks implement parts of these rules and standards. Using QWED Finance does not make a system compliant with them: that is for your own compliance review.
BSA/FinCEN: verify_aml_flag requires a flag at or above the 10,000 currency transaction report threshold, and for a high-risk country whatever the amount (amounts are compared as given; see the Compliance guard)
OFAC and other sanctions lists: name screening against a list you supply
ISO 20022 and SWIFT MT: message structure and business-rule checks
RBI FREE-AI (India): receipts and audit logs as records of how an AI output was checked
FinanceVerifier rejects ambiguous or unknown inputs instead of silently falling back to a default. In finance, a wrong answer with no error signal is worse than a loud failure.
Since v2.1.0:verify_compound_interest() raises ValueError for unknown compounding frequencies. Earlier releases silently used annual compounding for unknown values (for example "weekly" or "continuous"), producing wrong results with no sign of failure.
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"QWED Finance","description":"QWED Finance documentation: deterministic verification for financial AI, banking agents, and payment pipelines, with 11 guards, receipts, and a GitHub Action.","colors":{"primary":"#B23E10","light":"#FF9A6B","dark":"#C8461A"},"logo":{"light":"https://mintcdn.com/qwed-finance/VpoShTrrD6Bo094s/images/brand/qwed-finance-lockup.svg?fit=max\u0026auto=format\u0026n=VpoShTrrD6Bo094s\u0026q=85\u0026s=1c066395c9041acf30d805c513607e13","dark":"https://mintcdn.com/qwed-finance/VpoShTrrD6Bo094s/images/brand/qwed-finance-lockup-white.svg?fit=max\u0026auto=format\u0026n=VpoShTrrD6Bo094s\u0026q=85\u0026s=20f355d848414a4d45542c432cbbcc92","href":"/introduction"},"favicon":"https://mintcdn.com/qwed-finance/VpoShTrrD6Bo094s/images/brand/favicon.svg?fit=max\u0026auto=format\u0026n=VpoShTrrD6Bo094s\u0026q=85\u0026s=45b48499b2e87048d15736fe4ff22acb","appearance":{"default":"system"},"background":{"color":{"light":"#F6F7F5","dark":"#0E1714"}},"navbar":{"links":[{"href":"https://qwedai.tech","label":"qwedai.tech"},{"href":"https://docs.qwedai.tech","label":"QWED Docs"},{"href":"mailto:support@qwedai.tech","label":"Support"}],"primary":{"type":"button","label":"Get Started","href":"/quickstart"}},"footer":{"socials":{"x":"https://x.com/Qwed_ai","github":"https://github.com/QWED-AI","linkedin":"https://www.linkedin.com/company/qwed","website":"https://qwedai.tech"},"links":[{"header":"QWED Finance","items":[{"label":"Quickstart","href":"/quickstart"},{"label":"The 11 guards","href":"/finance/guards"},{"label":"GitHub Action","href":"/finance/action"},{"label":"Changelog","href":"https://github.com/QWED-AI/qwed-finance/blob/main/CHANGELOG.md"}]},{"header":"Ecosystem","items":[{"label":"QWED Docs","href":"https://docs.qwedai.tech"},{"label":"QWED UCP","href":"https://docs.qwedai.tech/ucp/overview"},{"label":"QWED MCP","href":"https://docs.qwedai.tech/mcp/overview"},{"label":"Open Responses","href":"https://docs.qwedai.tech/open-responses/overview"},{"label":"QWED Legal","href":"https://docs.qwedai.tech/legal/overview"},{"label":"QWED A2A","href":"https://docs.qwedai.tech/a2a/overview"}]},{"header":"Resources","items":[{"label":"Releases","href":"https://docs.qwedai.tech/releases"},{"label":"Changelog","href":"https://docs.qwedai.tech/changelog"},{"label":"License","href":"https://qwedai.tech/license"},{"label":"Privacy Policy","href":"https://qwedai.tech/privacy"},{"label":"Terms","href":"https://qwedai.tech/terms"}]}]},"seo":{"metatags":{"canonical":"https://finance.qwedai.tech","og:image":"https://finance.qwedai.tech/images/brand/og-finance.png","og:site_name":"QWED Finance","og:type":"website","twitter:card":"summary_large_image","twitter:site":"@Qwed_ai"},"indexing":"all"},"fonts":{"heading":{"family":"Geist","weight":600},"body":{"family":"Geist"}},"banner":{"content":"**QWED Finance v3.0.1** fixes three security advisories in ISO 20022 rules, sanctions screening and SQL checks. [See what changed](/finance/overview)","dismissible":true},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"GitHub","icon":"github","href":"https://github.com/QWED-AI/qwed-finance"},{"anchor":"Marketplace","icon":"shop","href":"https://github.com/marketplace/actions/qwed-finance-guard"},{"anchor":"PyPI","icon":"python","href":"https://pypi.org/project/qwed-finance/"},{"anchor":"npm","icon":"npm","href":"https://www.npmjs.com/package/@qwed-ai/finance"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"qwed-finance","hasAudioNarration":false,"actualSubdomain":"qwed-finance","customDomains":["finance.qwedai.tech"],"gitSource":{"type":"github","owner":"qwed-ai","repo":"qwed-finance-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6aec02460ea8de918ba8a983","clientVersion":"0.0.4094","searchFilterCounts":[{"language":"default","tag":"QWED Finance","count":9},{"language":"default","tag":"Core Verification","count":5},{"language":"default","tag":"Integrations","count":2},{"language":"default","tag":"Get Started","count":2}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"email":"support@qwedai.tech"}},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"privacy":{"consentBanner":{"enabled":true}},"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":"/* cyrillic-ext */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrodmgPn.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrMdmgPn.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* symbols2 */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFg08vz7ehw.woff2) format('woff2');\n unicode-range: U+2000-2001, U+2004-2008, U+200A, U+23B8-23BD, U+2500-259F;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrgdmgPn.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrkdmgPn.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrcdmg.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\ncode,pre,kbd,samp{font-family:'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace}#page-title,.mdx-content>h2{letter-spacing:-0.035em}.mdx-content>h3{letter-spacing:-0.01em}"}],"page":{"pagePath":"finance/overview","slug":"/finance/overview","pageMetadata":{"sidebar_position":1,"title":"Overview: verification for financial AI","sidebarTitle":"Overview","description":"How QWED Finance checks what financial AI produces: the 11 guards, the engines behind them, receipts, and what fails closed before your system acts.","href":"/finance/overview"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"How QWED Finance checks what financial AI produces: the 11 guards, the engines behind them, receipts, and what fails closed before your system acts.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Mermaid,Note,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Mermaid)_missingMdxReference(`Mermaid`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`Deterministic verification for financial AI (v3.0.1).`})}),`\n`,_jsx(_components.p,{children:`QWED Finance is a verification library for financial AI. A language model proposes a figure, a decision, a payment message or a query; QWED Finance recomputes or checks it with deterministic code before your system acts on it. It does not make the model more accurate. It decides whether a given output may be used.`}),`\n`,_jsxs(_components.p,{children:[`It combines formal and high-precision tools: SymPy for cash-flow maths, Z3 for the AML rule, mpmath and `,_jsx(_components.code,{children:`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.`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`New in v3.0.1: security fixes.`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`ISO 20022 business rules read amounts and currencies from the parsed XML tree, not from raw text (`,_jsx(_components.a,{href:`https://github.com/QWED-AI/qwed-finance/security/advisories/GHSA-mrrj-6m2q-jch9`,children:`GHSA-mrrj-6m2q-jch9`}),`)`]}),`\n`,_jsxs(_components.li,{children:[`Sanctions screening folds diacritics and look-alike letters and compares separator-free names, so `,_jsx(_components.code,{children:`E.V.I.L. CORP`}),` or `,_jsx(_components.code,{children:`ÉVIL CORP`}),` no longer clears an `,_jsx(_components.code,{children:`EVIL CORP`}),` entry (`,_jsx(_components.a,{href:`https://github.com/QWED-AI/qwed-finance/security/advisories/GHSA-mv2c-jwm9-pfrq`,children:`GHSA-mv2c-jwm9-pfrq`}),`)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`QueryGuard`}),` rejects MySQL `,_jsx(_components.code,{children:`/*! ... */`}),` and MariaDB `,_jsx(_components.code,{children:`/*M! ... */`}),` executable comments (`,_jsx(_components.a,{href:`https://github.com/QWED-AI/qwed-finance/security/advisories/GHSA-q8r4-6gpp-5fx2`,children:`GHSA-q8r4-6gpp-5fx2`}),`)`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`v3.0.0 highlights:`}),` keyed HMAC receipt signatures (`,_jsx(_components.code,{children:`get_signature(key)`}),`), ISO amount and currency limits in receipts and UCP, a fail-closed batch for AML, sanctions, amounts and message validation, and a breaking change to the npm bridge (stdin JSON with runtime validation). See the `,_jsx(_components.a,{href:`https://github.com/QWED-AI/qwed-finance/blob/main/CHANGELOG.md`,children:`changelog`}),` for details.`]}),`\n`,_jsx(Heading,{level:`2`,id:`why-qwed-finance`,children:`Why QWED Finance?`}),`\n`,_jsx(_components.p,{children:`Language models get arithmetic and strict rules wrong, and in finance close enough is not good enough.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Problem:`}),` a model says “IRR is 12%” when it is 11.8%.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`What QWED Finance does:`}),` it recomputes the IRR from the cash flows and rejects the claim when it differs by more than the tolerance. It reports the value it computed; it does not rewrite the model’s answer.`]}),`\n`]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`verify_irr`}),` solves NPV = 0 with SymPy and uses the first real root above -100%. Cash flows that change sign more than once can have several IRRs, and the first root is not always the one you mean: check those with `,_jsx(_components.code,{children:`verify_npv`}),` at each candidate rate. When SymPy finds no real root, the method falls back to a numeric solver and reports `,_jsx(_components.code,{children:`verification_mode=\"HEURISTIC\"`}),` instead of `,_jsx(_components.code,{children:`\"SYMBOLIC\"`}),`. A claim that is not a number, such as `,_jsx(_components.code,{children:`\"not a rate\"`}),`, raises `,_jsx(_components.code,{children:`ValueError`}),`: treat that as a rejection.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`key-features`,children:`Key features`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`11 guards:`}),` Compliance, Calendar, Derivatives, Message, ISO, Query, Cross, Bond, FX, Risk and Trading.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`GitHub Action:`}),` checks financial calculations in CI, with optional SARIF output for security dashboards.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Receipts:`}),` verification receipts for cross-guard and integration flows. Receipts are unsigned by default: call `,_jsx(_components.code,{children:`get_signature(key)`}),` and store the HMAC-SHA256 signature separately to get a tamper-evident record.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Deterministic results:`}),` each check is computed by code, so the same input gives the same result.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`the-four-parts-of-banking-verification`,children:`The four parts of banking verification`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Part`}),_jsx(_components.th,{children:`Guards`}),_jsx(_components.th,{children:`Engine`}),_jsx(_components.th,{children:`Use case`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Calculation`})}),_jsx(_components.td,{children:`Finance, Calendar, Derivatives, Bond, FX, Risk`}),_jsxs(_components.td,{children:[`SymPy, `,_jsx(_components.code,{children:`Decimal`}),`, mpmath`]}),_jsx(_components.td,{children:`NPV, IRR, day counts, option prices, YTM, VaR`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Rules`})}),_jsx(_components.td,{children:`Compliance`}),_jsx(_components.td,{children:`Z3 for AML flags; rule checks for KYC, limits and sanctions decisions`}),_jsx(_components.td,{children:`AML flags, KYC completeness, transaction limits, sanctions decisions`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Messages`})}),_jsx(_components.td,{children:`Message, ISO`}),_jsx(_components.td,{children:`XML parsing and required-element rules (ISO 20022), field checks (SWIFT MT), JSON Schema (ISO JSON)`}),_jsx(_components.td,{children:`ISO 20022, SWIFT MT`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Data safety`})}),_jsx(_components.td,{children:`Query`}),_jsx(_components.td,{children:`SQLGlot`}),_jsx(_components.td,{children:`Read-only queries, table and column allow-lists, injection patterns`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`quick-example`,children:`Quick example`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`13`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`13`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` qwed_finance `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ComplianceGuard`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`guard `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ComplianceGuard()`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Check an AML flagging decision`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`result `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` guard.verify_aml_flag(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` amount`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`15000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# at or above the 10,000 threshold`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` country_code`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"US\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` llm_flagged`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # the model flagged it`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(result.compliant) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# True`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(result.proof) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# \"Z3: LLM decision matches regulatory requirement\"`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`architecture`,children:`Architecture`}),`\n`,_jsx(Heading,{level:`3`,id:`where-qwed-finance-sits`,children:`Where QWED Finance sits`}),`\n`,_jsx(_components.p,{children:`Your code chooses the guard for each output. QWED Finance returns a result; your system decides what to do with it.`}),`\n`,_jsx(Mermaid,{chart:`flowchart TB\n subgraph Agent[\"Your AI agent or pipeline\"]\n LLM[\"Language model\"]\n end\n\n subgraph QWED[\"QWED Finance v3.0.1\"]\n direction TB\n Guards[\"Guard chosen by your code\u003cbr/>(Compliance, Bond, Query, ...)\"]\n Receipt[\"Verification receipt\u003cbr/>(CrossGuard, UCP, Open Responses)\"]\n end\n\n subgraph Yours[\"Your system\"]\n Act[\"Act on the output\"]\n Hold[\"Hold, reject or ask a person\"]\n end\n\n LLM -->|\"figure, decision, message or query\"| Guards\n Guards -->|\"verified\"| Act\n Guards -->|\"rejected or unparseable\"| Hold\n Guards -.-> Receipt`}),`\n`,_jsx(Heading,{level:`3`,id:`guards-and-their-engines`,children:`Guards and their engines`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Guard`}),_jsx(_components.th,{children:`Engine`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`FinanceVerifier`}),` (NPV, IRR, loans, compound interest)`]}),_jsxs(_components.td,{children:[`SymPy, `,_jsx(_components.code,{children:`Decimal`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ComplianceGuard`})}),_jsx(_components.td,{children:`Z3 (AML flags) and rule checks (KYC, limits, sanctions decisions)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`CalendarGuard`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`Decimal`}),` day-count arithmetic`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`DerivativesGuard`})}),_jsx(_components.td,{children:`mpmath (30 decimal places)`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`BondGuard`}),`, `,_jsx(_components.code,{children:`FXGuard`}),`, `,_jsx(_components.code,{children:`RiskGuard`}),`, `,_jsx(_components.code,{children:`TradingGuard`})]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`Decimal`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`MessageGuard`})}),_jsx(_components.td,{children:`defusedxml parsing and required-element rules for ISO 20022; tagged-field checks for SWIFT MT`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ISOGuard`})}),_jsx(_components.td,{children:`JSON Schema`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`QueryGuard`})}),_jsx(_components.td,{children:`SQLGlot`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`CrossGuard`})}),_jsx(_components.td,{children:`combines Message, Compliance and Query, and issues receipts`})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`payment-check-with-ucp`,children:`Payment check with UCP`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`UCPIntegration.verify_payment_token()`}),` runs four checks: amount limits, currency, AML threshold and KYC status. When an AML flag is needed the status is `,_jsx(_components.code,{children:`PENDING_REVIEW`}),`, even if another check also failed; `,_jsx(_components.code,{children:`BLOCKED`}),` means a check failed with no AML flag. Sanctions screening is part of `,_jsx(_components.code,{children:`verify_iso20022_payment()`}),`, which takes a sanctions list.`]}),`\n`,_jsx(Mermaid,{chart:`sequenceDiagram\n participant User\n participant Agent as Banking agent\n participant QWED as QWED Finance (UCP)\n participant Bank as Bank API\n\n User->>Agent: \"Transfer $15,000 to John\"\n Agent->>QWED: verify_payment_token()\n\n Note over QWED: 1. Amount limits\n Note over QWED: 2. Allowed currency\n Note over QWED: 3. AML threshold (10,000)\n Note over QWED: 4. KYC status\n\n alt All checks pass\n QWED-->>Agent: APPROVED, with receipts\n Agent->>Bank: Execute transfer\n else Amount at or above the AML threshold\n QWED-->>Agent: PENDING_REVIEW\n Agent-->>User: \"Flagged for compliance review\"\n else A limit, currency or KYC check fails, and no AML flag\n QWED-->>Agent: BLOCKED, with violations\n Agent-->>User: \"Transfer not made\"\n end`}),`\n`,_jsx(Heading,{level:`2`,id:`why-not-just-trust-the-model`,children:`Why not just trust the model?`}),`\n`,_jsx(_components.p,{children:`Language models are probabilistic. They can:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`state a figure that is wrong`}),`\n`,_jsx(_components.li,{children:`miss a compliance threshold, such as the 10,000 currency transaction report limit`}),`\n`,_jsx(_components.li,{children:`produce a payment message that is missing required elements`}),`\n`,_jsx(_components.li,{children:`write SQL that changes or deletes data`}),`\n`]}),`\n`,_jsx(_components.p,{children:`QWED Finance checks each of these with deterministic code:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Model output`}),_jsx(_components.th,{children:`What QWED Finance does`}),_jsx(_components.th,{children:`Engine`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`”NPV is $180.42”`}),_jsx(_components.td,{children:`recomputes the NPV`}),_jsx(_components.td,{children:`SymPy`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`”Transaction is compliant”`}),_jsx(_components.td,{children:`checks the threshold rule`}),_jsx(_components.td,{children:`Z3`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`”Payment XML is valid”`}),_jsx(_components.td,{children:`parses it and checks required elements`}),_jsx(_components.td,{children:`XML rules`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`”SELECT * FROM users”`}),_jsx(_components.td,{children:`parses the query and checks tables and columns`}),_jsx(_components.td,{children:`SQLGlot`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`rules-and-standards-the-checks-are-built-around`,children:`Rules and standards the checks are built around`}),`\n`,_jsx(_components.p,{children:`The checks implement parts of these rules and standards. Using QWED Finance does not make a system compliant with them: that is for your own compliance review.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`BSA/FinCEN`}),`: `,_jsx(_components.code,{children:`verify_aml_flag`}),` requires a flag at or above the 10,000 currency transaction report threshold, and for a high-risk country whatever the amount (amounts are compared as given; see `,_jsx(_components.a,{href:`/finance/guards`,children:`the Compliance guard`}),`)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`OFAC and other sanctions lists`}),`: name screening against a list you supply`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`ISO 20022 and SWIFT MT`}),`: message structure and business-rule checks`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`RBI FREE-AI (India)`}),`: receipts and audit logs as records of how an AI output was checked`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`financeverifier-fail-closed-inputs`,children:`FinanceVerifier: fail-closed inputs`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`FinanceVerifier`}),` rejects ambiguous or unknown inputs instead of silently falling back to a default. In finance, a wrong answer with no error signal is worse than a loud failure.`]}),`\n`,_jsxs(Heading,{level:`3`,id:`verify_compound_interest-accepted-compounding-frequencies`,children:[_jsx(_components.code,{children:`verify_compound_interest`}),`: accepted compounding frequencies`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Since v2.1.0:`}),` `,_jsx(_components.code,{children:`verify_compound_interest()`}),` raises `,_jsx(_components.code,{children:`ValueError`}),` for unknown compounding frequencies. Earlier releases silently used `,_jsx(_components.strong,{children:`annual`}),` compounding for unknown values (for example `,_jsx(_components.code,{children:`\"weekly\"`}),` or `,_jsx(_components.code,{children:`\"continuous\"`}),`), producing wrong results with no sign of failure.`]})}),`\n`,_jsxs(_components.p,{children:[`Accepted values for the `,_jsx(_components.code,{children:`compounding`}),` argument:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Value`}),_jsx(_components.th,{children:`Periods per year`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`annual`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:`1`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`semi-annual`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:`2`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`quarterly`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:`4`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`monthly`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:`12`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`daily`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:`365`})]})]})]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`24`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`24`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` qwed_finance `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` FinanceVerifier`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`verifier `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` FinanceVerifier()`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Supported frequency`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`result `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` verifier.verify_compound_interest(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` principal`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`10000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` rate`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0.05`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` periods`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`10`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` compounding`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"monthly\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` llm_output`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"$16,470.09\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Unknown frequency: fails closed`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`verifier.verify_compound_interest(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` principal`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`10000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` rate`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0.05`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` periods`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`10`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` compounding`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"weekly\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# not supported`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` llm_output`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"$16,470.09\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# raises ValueError:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Unknown compounding frequency: 'weekly'.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Accepted values: annual, daily, monthly, quarterly, semi-annual`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`If you need a frequency outside this list, compute the equivalent rate yourself and pass one of the supported values.`}),`\n`,_jsx(Heading,{level:`2`,id:`next-steps`,children:`Next steps`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/finance/guards`,children:`The 11 guards`}),`: each guard with working examples`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/finance/compliance`,children:`Compliance and auditing`}),`: receipts and audit logs`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`https://docs.qwedai.tech/ucp/overview`,children:`QWED UCP: transaction verification for AI commerce`}),`: connect finance checks to commerce transactions`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`https://docs.qwedai.tech/open-responses/overview`,children:`QWED Open Responses: verified tool calls for AI agents`}),`: check finance-related agent actions before they run`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"sidebar_position":1,"title":"Overview: verification for financial AI","sidebarTitle":"Overview","description":"How QWED Finance checks what financial AI produces: the 11 guards, the engines behind them, receipts, and what fails closed before your system acts.","href":"/finance/overview"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Why QWED Finance?","slug":"why-qwed-finance","depth":2,"children":[]},{"title":"Key features","slug":"key-features","depth":2,"children":[]},{"title":"The four parts of banking verification","slug":"the-four-parts-of-banking-verification","depth":2,"children":[]},{"title":"Quick example","slug":"quick-example","depth":2,"children":[]},{"title":"Architecture","slug":"architecture","depth":2,"children":[{"title":"Where QWED Finance sits","slug":"where-qwed-finance-sits","depth":3,"children":[]},{"title":"Guards and their engines","slug":"guards-and-their-engines","depth":3,"children":[]},{"title":"Payment check with UCP","slug":"payment-check-with-ucp","depth":3,"children":[]}]},{"title":"Why not just trust the model?","slug":"why-not-just-trust-the-model","depth":2,"children":[]},{"title":"Rules and standards the checks are built around","slug":"rules-and-standards-the-checks-are-built-around","depth":2,"children":[]},{"title":"FinanceVerifier: fail-closed inputs","slug":"financeverifier-fail-closed-inputs","depth":2,"children":[{"title":"verify_compound_interest: accepted compounding frequencies","slug":"verify_compound_interest-accepted-compounding-frequencies","depth":3,"children":[]}]},{"title":"Next steps","slug":"next-steps","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"qwed-finance","siteName":"QWED Finance","title":"Overview: verification for financial AI - QWED Finance","relatedPagesConfig":{"enabled":true,"limit":5,"mode":"automatic"},"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-24T10:50:23.735Z","originalFileLocation":"finance/overview.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"How QWED Finance checks what financial AI produces: the 11 guards, the engines behind them, receipts, and what fails closed before your system acts.\">\u003cmeta data-mint-head name=\"application-name\" content=\"QWED Finance\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/qwed-finance/K77i3HVUeNrT_gSc/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/qwed-finance/K77i3HVUeNrT_gSc/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/qwed-finance/K77i3HVUeNrT_gSc/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/qwed-finance/K77i3HVUeNrT_gSc/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/qwed-finance/K77i3HVUeNrT_gSc/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/qwed-finance/K77i3HVUeNrT_gSc/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/qwed-finance/K77i3HVUeNrT_gSc/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/qwed-finance/K77i3HVUeNrT_gSc/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/qwed-finance/K77i3HVUeNrT_gSc/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Overview: verification for financial AI - QWED Finance\">\u003cmeta data-mint-head property=\"og:description\" content=\"How QWED Finance checks what financial AI produces: the 11 guards, the engines behind them, receipts, and what fails closed before your system acts.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"QWED Finance\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://finance.qwedai.tech/finance/overview\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://finance.qwedai.tech/images/brand/og-finance.png\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Overview: verification for financial AI - QWED Finance\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"How QWED Finance checks what financial AI produces: the 11 guards, the engines behind them, receipts, and what fails closed before your system acts.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://finance.qwedai.tech/images/brand/og-finance.png\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/qwed-finance/K77i3HVUeNrT_gSc/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"QWED Finance\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#B23E10\">\u003clink data-mint-head rel=\"canonical\" href=\"https://finance.qwedai.tech/finance/overview\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/finance/overview.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://finance.qwedai.tech/#organization\",\"name\":\"QWED Finance\",\"url\":\"https://finance.qwedai.tech\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/qwed-finance/VpoShTrrD6Bo094s/images/brand/qwed-finance-lockup.svg?fit=max\u0026auto=format\u0026n=VpoShTrrD6Bo094s\u0026q=85\u0026s=1c066395c9041acf30d805c513607e13\"}},{\"@type\":\"WebSite\",\"@id\":\"https://finance.qwedai.tech#website\",\"name\":\"QWED Finance\",\"url\":\"https://finance.qwedai.tech\",\"publisher\":{\"@id\":\"https://finance.qwedai.tech/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://finance.qwedai.tech/finance/overview#webpage\",\"url\":\"https://finance.qwedai.tech/finance/overview\",\"name\":\"Overview: verification for financial AI\",\"description\":\"How QWED Finance checks what financial AI produces: the 11 guards, the engines behind them, receipts, and what fails closed before your system acts.\",\"dateModified\":\"2026-10-24T10:50:23.735Z\",\"isPartOf\":{\"@id\":\"https://finance.qwedai.tech#website\"},\"breadcrumb\":{\"@id\":\"https://finance.qwedai.tech/finance/overview#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://finance.qwedai.tech/finance/overview#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"QWED Finance\",\"item\":\"https://finance.qwedai.tech\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Overview: verification for financial AI\",\"item\":\"https://finance.qwedai.tech/finance/overview\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://finance.qwedai.tech/finance/overview#article\",\"headline\":\"Overview: verification for financial AI\",\"name\":\"Overview: verification for financial AI\",\"description\":\"How QWED Finance checks what financial AI produces: the 11 guards, the engines behind them, receipts, and what fails closed before your system acts.\",\"url\":\"https://finance.qwedai.tech/finance/overview\",\"mainEntityOfPage\":{\"@id\":\"https://finance.qwedai.tech/finance/overview#webpage\"},\"image\":\"https://finance.qwedai.tech/images/brand/og-finance.png\",\"dateModified\":\"2026-10-24T10:50:23.735Z\",\"publisher\":{\"@id\":\"https://finance.qwedai.tech/#organization\"},\"isPartOf\":{\"@id\":\"https://finance.qwedai.tech#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"QWED Finance\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"QWED Finance","nav":{"global":{"anchors":[{"anchor":"GitHub","icon":"github","href":"https://github.com/QWED-AI/qwed-finance"},{"anchor":"Marketplace","icon":"shop","href":"https://github.com/marketplace/actions/qwed-finance-guard"},{"anchor":"PyPI","icon":"python","href":"https://pypi.org/project/qwed-finance/"},{"anchor":"npm","icon":"npm","href":"https://www.npmjs.com/package/@qwed-ai/finance"}]},"tabs":[{"tab":"QWED Finance","groups":[{"group":"Get Started","pages":[{"title":"QWED Finance: verification for financial AI","sidebarTitle":"Introduction","icon":"shield-check","href":"/introduction"},{"title":"Quickstart","sidebarTitle":"Quickstart","description":"Install QWED Finance 3.0.1 for Python or Node.js, then check a model's NPV claim and an AML decision in a few lines, with the output you should see.","href":"/quickstart"}]},{"group":"Core Verification","pages":[{"title":"Overview: verification for financial AI","sidebarTitle":"Overview","href":"/finance/overview"},{"title":"The 11 guards for financial AI verification","sidebarTitle":"The 11 guards","description":"The 11 QWED Finance guards: Compliance, Calendar, Derivatives, Message, ISO, Query, Cross, Bond, FX, Risk, and Trading, with verified examples for v3.0.1.","href":"/finance/guards"},{"title":"Design and architecture","href":"/finance/design"},{"title":"Compliance and auditing","href":"/finance/compliance"},{"title":"QWED Finance GitHub Action for CI/CD","sidebarTitle":"GitHub Action","href":"/finance/action"}]},{"group":"Integrations","pages":[{"title":"Open Responses","href":"/finance/integrations/open-responses"},{"title":"UCP integration","href":"/finance/integrations/ucp"}]}]}]},"basePath":"","title":"Overview: verification for financial AI - QWED Finance","buildId":"dpl_42LwxxU1kGN114H4XzwGYXa9ZDah","deploymentId":"dpl_42LwxxU1kGN114H4XzwGYXa9ZDah","dynamics":["10e4515597"],"chunks":["BannerMarkdown-DV-WToSZ.js","dist-CBUH0-zX.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","clsx-CR-RHrVC.js","html-void-elements-mCSPHezU.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js"]}