Skip to main content

FinGuard — Open-source LLM safety layer for financial AI

Project description

FinGuard

An open-source, production-ready LLM safety orchestration layer built specifically for financial AI.

PyPI version Python 3.10+ License: MIT

Why FinGuard?

Generic guardrail tools fail in finance because of domain-specific risks: missing disclaimers, hallucinating returns, and non-compliant advice.

FinGuard provides the critical "orchestration glue"—wrapping enterprise-grade scanners (llm-guard, presidio) with financial-specific validators out-of-the-box.

The FinGuard Difference:

  1. Indian-Specific PII Native Support: PAN, Aadhaar, and Demat account detection directly in the inference pipeline.
  2. Numerical Hallucination Control: Cross-checks numbers against context to prevent confidently hallucinated percentages.
  3. Compliance Phrase Detection: Instantly flags SEBI/RBI violations (e.g. "risk-free", "guaranteed returns").
  4. Optimized CPU Performance: Native ONNX integration provides sub-150ms latency without a GPU.

Quick Start (Plug-and-Play)

FinGuard is "Optimized by Default". No complex hardware configuration required.

1. Installation

pip install finguard

2. Wrap your LLM

import asyncio
from finguard import FinGuard

# 1. Initialize guard with a built-in policy (Wealth Mgmt, Banking, or Fraud)
guard = FinGuard(policy="wealth_mgmt_assistant_v1")

# 2. Wrap your async LLM call
@guard.wrap
async def chatbot_reply(prompt: str) -> str:
    return await my_llm_client.chat(prompt)

# 3. Use it! Everything is scanned asynchronously with ONNX acceleration.
async def main():
    try:
        response = await chatbot_reply("What mutual fund guarantees 20% returns?")
        print(response)
    except Exception as e:
        print(f"FinGuard Intercepted: {e}")

asyncio.run(main())

🚀 Performance

FinGuard v0.2.0 uses ONNX Runtime by default, providing sub-150ms latency for full-stack financial safety checks on standard CPU hardware.

Runtime Device Latency (p50) Status
Standard (v0.1) CPU ~400 ms Deprecated
Optimized (v0.2) CPU (ONNX) 117 ms Active

Documentation


Built openly for the financial AI community.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

finguard-0.2.0.tar.gz (104.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

finguard-0.2.0-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file finguard-0.2.0.tar.gz.

File metadata

  • Download URL: finguard-0.2.0.tar.gz
  • Upload date:
  • Size: 104.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for finguard-0.2.0.tar.gz
Algorithm Hash digest
SHA256 adad888dc59dea8932599932261e2d95f0fb473bcb78efa1a15cdc98d0bbf003
MD5 cf21afcbfde24c098e8e3e2cb62ed872
BLAKE2b-256 8dc3a2d8fe772c493f2482b1e431d7a3d064848eacda253010601195e1febeac

See more details on using hashes here.

Provenance

The following attestation bundles were made for finguard-0.2.0.tar.gz:

Publisher: python-publish.yml on suryanshgupta9933/FinGuard

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file finguard-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: finguard-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for finguard-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 49d868d83b2d94611f37806e76840a478996bc62521016e443d464ff1b3e3da4
MD5 3875ec18810ebd14461067159aee2bc2
BLAKE2b-256 1724ac31c4cfd63df7b4e13e2b47b79a60581b4e2002e1295974d02ee3cd7fc3

See more details on using hashes here.

Provenance

The following attestation bundles were made for finguard-0.2.0-py3-none-any.whl:

Publisher: python-publish.yml on suryanshgupta9933/FinGuard

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page