TextSafetyConfig
Options & Configuration ยท AiDotNet.Safety
Configuration for text safety modules.
For Beginners
These settings control how text content is checked for safety issues. Enable the checks you need โ toxicity catches offensive language, PII detection finds personal information, jailbreak detection catches prompt manipulation attempts.
How It Works
Controls which text safety checks are enabled and their sensitivity thresholds.
Constructors
| Constructor | Summary |
|---|---|
TextSafetyConfig() |
Properties
| Property | Summary |
|---|---|
PiiType[] PIITypes { get; set; } |
Gets or sets the kinds of PII the PII detector looks for. |
bool? BlockJailbreaks { get; set; } |
Gets or sets whether a detected jailbreak or prompt injection blocks the input. |
bool? CopyrightDetection { get; set; } |
Gets or sets whether copyright/memorization detection is enabled. |
bool? HallucinationDetection { get; set; } |
Gets or sets whether hallucination detection is enabled. |
bool? JailbreakDetection { get; set; } |
Gets or sets whether jailbreak/prompt injection detection is enabled. |
bool? PIIDetection { get; set; } |
Gets or sets whether PII (personally identifiable information) detection is enabled. |
bool? ToxicityDetection { get; set; } |
Gets or sets whether toxicity detection is enabled. |
double? HallucinationThreshold { get; set; } |
Gets or sets the contradiction score (0-1) at or above which a pair of sentences is reported as a self-contradiction (a hallucination signal). |
double? JailbreakSensitivity { get; set; } |
Gets or sets the jailbreak detection sensitivity (0-1). |
double? ToxicityThreshold { get; set; } |
Gets or sets the toxicity score threshold (0-1). |
int? MaxInputLength { get; set; } |
Gets or sets the maximum input text length. |
string[] Languages { get; set; } |
Gets or sets the languages to support for text safety checks. |