Skip to main content

What is Sensitive Social Policy?

Sensitive social policies detect racism, hate speech, discriminatory language, and other sensitive social issues to maintain respectful and inclusive communication.

Why its Important?

Sensitive social policies are crucial for maintaining an inclusive and respectful environment when using AI agents. These policies prevent hate speech and discriminatory content from being processed by LLMs, which helps protect users from harmful content and maintains ethical communication standards.
  • Prevents sending hate speech to LLM: Blocks racist, discriminatory, and hateful content from being processed by language models
  • Maintains inclusive environment: Ensures your AI agent interactions are respectful and inclusive of all individuals
  • Protects users from harmful content: Prevents exposure to discriminatory language, hate speech, and offensive material

Usage

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

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

task = Task("Inappropriate hate speech content")
result = agent.do(task)
# Blocked with educational message

Available Variants

  • SensitiveSocialBlockPolicy: Keyword and pattern detection with blocking
  • SensitiveSocialBlockPolicy_LLM: LLM-powered block messages
  • SensitiveSocialBlockPolicy_LLM_Finder: LLM detection for context awareness
  • SensitiveSocialRaiseExceptionPolicy: Raises DisallowedOperation exception
  • SensitiveSocialRaiseExceptionPolicy_LLM: LLM-generated exception messages