Skip to main content

What is Crypto Policy?

Cryptocurrency policies detect and handle crypto-related content. Designed for financial institutions that need to block or control cryptocurrency discussions, trading advice, or wallet addresses.

Why its Important?

Cryptocurrency policies are critical for financial institutions and organizations that need to control or restrict cryptocurrency-related discussions. These policies prevent investment advice from being generated, protect against regulatory violations, and ensure compliance with financial regulations.
  • Prevents sending financial data to LLM: Blocks cryptocurrency-related information from being processed, protecting sensitive financial data
  • Prevents unauthorized investment advice: Stops AI agents from providing cryptocurrency trading or investment recommendations that could lead to legal issues
  • Ensures regulatory compliance: Helps financial institutions comply with regulations that restrict cryptocurrency discussions or advice

Usage

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

# Block any crypto-related questions
agent = Agent(
    model="openai/gpt-4o",
    user_policy=CryptoBlockPolicy,
    debug=True
)

task = Task("Tell me about Bitcoin investments")
result = agent.do(task)
print(result)
# Blocked before processing

Available Variants

  • CryptoBlockPolicy: Static keyword detection with blocking
  • CryptoBlockPolicy_LLM_Block: Static detection with LLM-generated block messages
  • CryptoBlockPolicy_LLM_Finder: LLM-powered detection for better accuracy
  • CryptoReplace: Replaces crypto keywords with placeholder text
  • CryptoRaiseExceptionPolicy: Raises DisallowedOperation exception
  • CryptoRaiseExceptionPolicy_LLM_Raise: LLM-generated exception messages