Supported Metrics and Operators
We provide an enum of all of the supported metrics and operators that can be used in defining rulesets.
These enums are available as gp.RuleMetrics
and gp.RuleOperator
in the Galileo Protect Python client.
Metric | Payload field | Description | Operators Supported | Target Value Options |
---|---|---|---|---|
PII (gp.RuleMetrics.pii) | output | List of Personal Identifiable Information (PII) classes detected. | any (gp.RuleOperator.any), all (gp.RuleOperator.all), contains (gp.RuleOperator.contains), equal (gp.RuleOperator.eq), not equal (gp.RuleOperator.neq), empty (gp.RuleOperator.empty), Not Empty (gp.RuleOperator.not_empty) | "address", "date", "email", "financial_info", "name", "phone_number", "ssn", "username_password" |
PII (gp.RuleMetrics.input_pii) | input | List of Personal Identifiable Information (PII) classes detected. | any (gp.RuleOperator.any), all (gp.RuleOperator.all), contains (gp.RuleOperator.contains), equal (gp.RuleOperator.eq), not equal (gp.RuleOperator.neq), empty (gp.RuleOperator.empty), Not Empty (gp.RuleOperator.not_empty) | "address", "date", "email", "financial_info", "name", "phone_number", "ssn", "username_password" |
Toxicity (gp.RuleMetrics.toxicity) | output | Probabiliy of toxic or foul language. | greater than (gp.RuleOperator.gt), less than (gp.RuleOperator.lt), greater than or equal (gp.RuleOperator.gte), less than or equal (gp.RuleOperator.lte) |
|
Toxicity (gp.RuleMetrics.input_toxicity) | input | Probabiliy of toxic or foul language. | greater than (gp.RuleOperator.gt), less than (gp.RuleOperator.lt), greater than or equal (gp.RuleOperator.gte), less than or equal (gp.RuleOperator.lte) |
|
Sexist (gp.RuleMetric.sexist) | output | Probability of sexist and biased content. | greater than (gp.RuleOperator.gt), less than (gp.RuleOperator.lt), greater than or equal (gp.RuleOperator.gte), less than or equal (gp.RuleOperator.lte) |
|
Sexist (gp.RuleMetric.input_sexist) | input | Probability of sexist and biased content. | greater than (gp.RuleOperator.gt), less than (gp.RuleOperator.lt), greater than or equal (gp.RuleOperator.gte), less than or equal (gp.RuleOperator.lte) |
|
Tone (gp.RuleMetric.tone) | output | Primary tone detected from the text. | equal (gp.RuleOperator.eq), not equal (gp.RuleOperator.neq) | "anger", "annoyance", "confusion", "fear", "joy", "love", "sadness", "surprise", "neutral" |
Tone (gp.RuleMetric.input_tone) | input | Primary tone detected from the text. | equal (gp.RuleOperator.eq), not equal (gp.RuleOperator.neq) | "anger", "annoyance", "confusion", "fear", "joy", "love", "sadness", "surprise", "neutral" |
Prompt Injection | input | Type of prompt injection detected. | any (gp.RuleOperator.any), all (gp.RuleOperator.all), contains (gp.RuleOperator.contains), equal (gp.RuleOperator.eq), not equal (gp.RuleOperator.neq), empty (gp.RuleOperator.empty), Not Empty (gp.RuleOperator.not_empty) | "impersonation", "obfuscation", "simple_instruction", "few_shot", "new_context" |
Last updated