Skip to main content

What is Financial Info Policy?

Financial information policies detect and protect credit cards, bank accounts, SSN, routing numbers, IBAN, SWIFT codes, tax IDs, investment accounts, cryptocurrency wallets, and other sensitive financial data.

Why its Important?

Financial information policies are essential for protecting sensitive financial data and ensuring compliance with financial regulations like PCI DSS. These policies prevent credit card numbers, bank account details, Social Security Numbers, and other financial information from being sent to LLMs.
  • Prevents sending financial data to LLM: Blocks credit cards, bank accounts, SSN, and other financial information from being processed by language models
  • Protects against identity theft: Prevents Social Security Numbers and other identity information from being exposed or processed
  • Ensures PCI DSS compliance: Helps maintain compliance with Payment Card Industry Data Security Standard requirements

Usage

from upsonic import Agent, Task
from upsonic.safety_engine.policies import FinancialInfoAnonymizePolicy

agent = Agent(
    model="openai/gpt-4o",
    agent_policy=FinancialInfoAnonymizePolicy,
    debug=True
)

task = Task("My credit card is 4532-1234-5678-9010")
result = agent.do(task)
# Credit card number is anonymized

Available Variants

  • FinancialInfoBlockPolicy: Pattern detection with blocking
  • FinancialInfoBlockPolicy_LLM: LLM-powered block messages
  • FinancialInfoBlockPolicy_LLM_Finder: LLM detection for better accuracy
  • FinancialInfoAnonymizePolicy: Anonymizes financial data
  • FinancialInfoReplacePolicy: Replaces with [FINANCIAL_INFO_REDACTED]
  • FinancialInfoRaiseExceptionPolicy: Raises DisallowedOperation exception
  • FinancialInfoRaiseExceptionPolicy_LLM: LLM-generated exception messages