> ## Documentation Index
> Fetch the complete documentation index at: https://docs.upsonic.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Cryptocurrency Policies

> Detect and handle crypto-related content

```bash theme={null}
# pip install "upsonic[safety-engine]"
uv pip install "upsonic[safety-engine]"
```

## 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

```python theme={null}
from upsonic import Agent, Task
from upsonic.safety_engine.policies import CryptoBlockPolicy_LLM_Finder

CryptoBlockPolicy_LLM_Finder.rule.text_finder_llm = "anthropic/claude-sonnet-4-6"

agent = Agent(
    "anthropic/claude-sonnet-4-6",
    user_policy=CryptoBlockPolicy_LLM_Finder,
    debug=True
)

task = Task("Tell me about Bitcoin investments")
result = agent.print_do(task)
print(result)
```

## 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
