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.
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:
- Indian-Specific PII Native Support: PAN, Aadhaar, and Demat account detection directly in the inference pipeline.
- Numerical Hallucination Control: Cross-checks numbers against context to prevent confidently hallucinated percentages.
- Compliance Phrase Detection: Instantly flags SEBI/RBI violations (e.g.
"risk-free","guaranteed returns"). - 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
adad888dc59dea8932599932261e2d95f0fb473bcb78efa1a15cdc98d0bbf003
|
|
| MD5 |
cf21afcbfde24c098e8e3e2cb62ed872
|
|
| BLAKE2b-256 |
8dc3a2d8fe772c493f2482b1e431d7a3d064848eacda253010601195e1febeac
|
Provenance
The following attestation bundles were made for finguard-0.2.0.tar.gz:
Publisher:
python-publish.yml on suryanshgupta9933/FinGuard
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
finguard-0.2.0.tar.gz -
Subject digest:
adad888dc59dea8932599932261e2d95f0fb473bcb78efa1a15cdc98d0bbf003 - Sigstore transparency entry: 1188753426
- Sigstore integration time:
-
Permalink:
suryanshgupta9933/FinGuard@5a3f2d60cc7c77c8719b79049ae9870c4f35832c -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/suryanshgupta9933
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@5a3f2d60cc7c77c8719b79049ae9870c4f35832c -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49d868d83b2d94611f37806e76840a478996bc62521016e443d464ff1b3e3da4
|
|
| MD5 |
3875ec18810ebd14461067159aee2bc2
|
|
| BLAKE2b-256 |
1724ac31c4cfd63df7b4e13e2b47b79a60581b4e2002e1295974d02ee3cd7fc3
|
Provenance
The following attestation bundles were made for finguard-0.2.0-py3-none-any.whl:
Publisher:
python-publish.yml on suryanshgupta9933/FinGuard
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
finguard-0.2.0-py3-none-any.whl -
Subject digest:
49d868d83b2d94611f37806e76840a478996bc62521016e443d464ff1b3e3da4 - Sigstore transparency entry: 1188753431
- Sigstore integration time:
-
Permalink:
suryanshgupta9933/FinGuard@5a3f2d60cc7c77c8719b79049ae9870c4f35832c -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/suryanshgupta9933
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@5a3f2d60cc7c77c8719b79049ae9870c4f35832c -
Trigger Event:
release
-
Statement type: