Rule
A rule is a specific condition that your application must comply with. It consists of three main components:- Metric: The type of data to evaluate (e.g.,
"input_tone"
). - Operator: The condition to apply (e.g.,
"contains"
). - Value: The specific values to look for (e.g.,
["sadness", "anger", "annoyance"]
).
Example
Ruleset
A ruleset is a collection of rules that define a broader condition for your application. It includes the rules to evaluate and the action to take if any rule is triggered. Rulesets are evaluated in order of priority, where the first ruleset has the highest priority. Once a condition in a ruleset is met, subsequent rulesets are not evaluated.Example
"sadness"
, "anger"
, or "annoyance"
, the response will be overriden.
Action
The action defines what happens if a rule within a ruleset is triggered. There are three types of actions:- FLAG: Marks the content but does not modify it.
- OVERRIDE: Replaces the content with a fallback message.
- MASK: Redacts sensitive details in the model’s response (Only works for PII).
Example
Note: When applying rulesets to the model’s output, exclude the input, and vice versa.