Language Filter

Detect message language and filter based on allowed languages.

The Language Filter detector identifies the language of messages and can filter based on a list of allowed languages. It supports 30+ languages including English, French, Spanish, German, Chinese, Japanese, Korean, Arabic, and more.

Recommended for Input & Output

Use cases

  • Restrict chatbot to specific languages your team can support
  • Ensure responses stay in the user's language
  • Detect language switching that might indicate prompt injection

Labels

LANGUAGE_NOT_ALLOWED

Detected language is not in the allowed list.

LOW_CONFIDENCE

Language detection confidence is below the threshold.

Configuration

Allowed languages default: English

Languages to allow (e.g., English, French, Spanish, German, Chinese, Japanese).

Confidence threshold default: 0.4

Minimum confidence for language detection.

Roles default: user, assistant

Which message roles to analyze.