Skip to main content
In Clavata.ai, Conditions are the specific criteria you set to detect certain types of content. These Conditions allow you to specify how content should be flagged or evaluated based on patterns, context, and sentiment. They are the foundation of every Rule you create. There are several types of Conditions you’ll use when creating Rules. For more details on the types of Conditions, check out this article.

When and Where to Use Conditions

AND and ALL

Use these Conditions when you need to narrow down your search by combining multiple criteria that must be met. For instance, if you’re looking for content that’s both offensive and related to a particular topic, the AND Condition ensures all logic is met. The ALL Condition is similar but requires every Condition in the list to be true. AND and ALL Conditions are used in the following format. ANY and ALL are entered, followed by parentheses containing a Signal or Signal List. Signals are enclosed in quotation marks and separated by commas. The Signals in this format are to be replaced with the content you are targeting. Example format:
ALL (
    “signal”,”signal”
    ) AND (
        “signal”
        )
Example in a Rule:
ALL (
    "gender identity",
    ”sexual orientation”
    ) AND (
        "offensive stereotypes"
        )
This Rule flags content where gender identity and sexual orientation are mentioned together in the context of offensive stereotypes.

OR and ANY

These Conditions are best used when you want to cast a wide net and capture content that meets at least one of several conditions. They are especially helpful for Rules with broad categories, such as identifying various types of offensive language or slurs. OR and ANY Conditions are used in the following format. OR and ANY are entered, followed by parentheses containing a Signal or Signal List. Signals are enclosed in quotation marks and separated by commas. The Signals in the format example below are to be replaced with the content you are targeting. Example format:
(“signal” [OPERATOR] “signal”)
OR (“signal” [OPERATOR] “signal”)
Example in a Rule:
("weapon" [IN CONTEXT] "threatening") 
OR ("weapon" [IN CONTEXT] "intimidating")
This Rule flags when there is a weapon being used in a threatening or intimidating context, unless it’s a toy gun.

NOT and NONE

Use NOT when you need to exclude certain Conditions from your search. NONE ensures that none of the listed Signals are present, making it an ideal Condition when you want to avoid certain content or language. NOT and NONE Conditions are used in the following format. NOT and NONE are entered, followed by parentheses containing a Signal or Signal List. Signals are enclosed in quotation marks and separated by commas. The Signals in the format example below are to be replaced with the content you are targeting. Example format:
ANY (
    “signal1”
    ”signal2”
    ”signal3"
    ) AND NOT (
        “signal”
        )
Example in a Rule:
ANY (
    “positive feedback”
    ”positive adjectives”
    ) AND NOT (
        “vulgarity”
        ”sarcasm”
        )

Context Conditions

Context Conditions should be used when the relationship between objects is important. For example, if you need to flag threats related to violence but not other forms of threats, using a context operator like [CONCERNING] ensures that only relevant content is flagged. Context Conditions are used in the following format. Enter a Signal enclosed in quotation marks, an Operator enclosed in hard brackets, and then another Signal enclosed in parentheses. The entire Rule should also be enclosed in parentheses. The Signals and Operator in the format example below are to be replaced with the content you are targeting. Example format:
(“signal” [OPERATOR] “signal”)
Example in a Rule:
("discrimination" [WITH REGARD TO] "gender")
This example will flag content that is detected to be any kind of discrimination in regard to any gender.

Exact and Fuzzy Matches

Use Exact Match Conditions for clear, specific terms that must be flagged exactly as they appear. Fuzzy Match is useful when content may include variations or misspellings, helping to catch similar but not identical terms. Exact and Fuzzy Match Conditions follow the following formats. For an Exact Match, enter the symbol =, followed by a parentheses, followed by a Signal enclosed in quotation marks, then another closing parenthesis. For a Fuzzy Match, enter the symbol ~, followed by a parentheses, followed by a Signal enclosed in quotation marks, then another closing parenthesis. Example format:
Exact match: 
=(“signal”)

Fuzzy Match:
~(“signal”)
Example in a Rule:
Exact Match:
=(“crap”)

Fuzzy Match:
~(“crap”)
In these examples, the Exact Match will flag the word “crap” with any variations of capitalization or letter repetition. The Fuzzy Match will flag the word “crap” written with any leet speak or more complex variations than simple capitalization.

Sentiment Matches

Sentiment analysis is useful for detecting emotional undertones in content, such as hostility or threats. Use Sentiment Match Conditions when you’re less concerned with specific words and more focused on the tone or mood of the content. Sentiment Match Conditions follow the following format. Enter SENTIMENT, followed by a parentheses. Within the parentheses, enter a Signal enclosed in quotation marks, then a closing parenthesis. Example format:
SENTIMENT(“signal”)
Example in a Rule:
SENTIMENT("historical hate symbols")
This example will look for sentiments related to historical hate symbols.

EXCEPT WHEN

Use EXCEPT WHEN when you need to allow for certain exceptions within a Policy Section or Policy Label. This is particularly useful when content may technically match a Rule’s Conditions, but shouldn’t be flagged due to context or lighter intent. EXCEPT WHEN Conditions are used in the following format. Input EXCEPT WHEN, followed by curly brackets containing one or more Rules in the curly brackets. Example format:
EXCEPT WHEN {
            "signal"
        }
Example in a Rule:
 SECTION "Positive": "MEDIUM" {
        ANY (
            "encouraging",
            "celebrating",
            "friendship"
        )
        EXCEPT WHEN {
            "performance nitpicking"
        } 
     }
This example shows the EXCEPT WHEN in relation to the Section or Label it is creating the exception for. The example is analyzing for any encouraging, celebrating, or friendship contexts except when it is used in the context of performance nitpicking.

Considerations

  • Keep it simple: Start with basic operators like AND and ALL, and build complexity as needed. Overly complicated Rules can be difficult to manage.
  • Test Fuzzy Matches: Make sure to test your Rules with different variations of the content to ensure Fuzzy Matches flag your expected variations.
  • Use context wisely: Context Conditions are powerful but should be used carefully to avoid missing relevant content that may be better suited to be found using a Rule built with Connecting Conditions.
  • Test and refine: Regularly review your Policies to ensure they are flagging the right content and adjust them as needed.
  • Use EXCEPT WHEN thoughtfully: Ensure that the exceptions you create truly reflect the intent behind your Policy Section to avoid letting harmful content slip through.

We’d Love to Hear From You

Whether you have a suggestion, feedback, or a bug to report, here are the best ways to get in touch:
  • In the App: Use the Feedback button for direct suggestions.
  • On Slack: Reach out to the team in your shared channel.
  • With your AM: Talk to your dedicated account manager.
  • Via Email: Send a message to [email protected].