Skip to main content

Components

In Clavata.ai, a Policy defines the guidelines the system follows to analyze and classify content. Policies are fully customizable, written in clear, readable terms, and are used to classify text and image content. Because of this, it’s crucial to understand how to write, read, and manage your Clavata.ai Policies effectively.

Label

Labels organize your Policy by grouping related Rules, which helps organize your logic structure. They define where the evaluation process starts and ends to determine if the content meets or violates your guidelines:
  • If any Rule matches, then the entire Label is considered a match.
  • A Label can contain unlimited Rules.
  • The outcome of each Rule evaluation is recorded for detailed review in the API response. When running a Test, the results are visible on the Policy editor screen.

Rule

Rules are the core logical statements in your Policy that guide how the system evaluates content, determining if it violates any of your Policies. Essentially, each Rule sets a condition that content must either pass or fail. Rules are written inside a Label, and if any single Rule within a Label matches, the entire Label is considered a match, meaning that piece of content is flagged based on that Label’s logic. The exact structure of a Rule depends on the Conditions you choose, which define what kind of Signals are needed. The Rule should be grammatically correct based on the chosen Condition and precise enough to target what you’re looking for.

Conditions

Clavata.ai provides predefined Conditions that are used to create Rules, depending on the specific content you want to detect. There are 4 different types of Conditions within Clavata.ai:

Connecting Condition

  • Connecting Conditions allow you to link various Signals and Signal Lists within your Policy using logical terms—such as NOT, AND, OR, ALL, ANY, and NONE.
  • They help define how different Rules interact with each other. For example, you can combine statements like:  ANY ("gender") AND ANY (“degrading remarks”,”offensive stereotypes”,”slurs”)

Context Condition

  • Context Conditions define relationships between objects or concepts in specific contexts to create Rules such as "threats" [CONCERNING] "real world violence"

Match Condition

  • Match Conditions are where you can specify one or more words or phrases to look for within text. The matches can be exact, fuzzy, or sentiment matches.
    • Exact Match Conditions identify specific words or phrases in content, ignoring case differences, like =(“cat”) would identify cAt, CAT, and CAt.
    • Fuzzy Match Conditions detect words or phrases that are similar in meaning or form, including variations like leetspeak, like ~(“hate”) will detect “h4t3”.
    • Exact and Fuzzy Match Conditions are only applicable to text or text-on-image.
  • The Sentiment Match Condition analyzes the overall sentiment of content, such as identifying threatening or negative language. ie, Sentiment("threatening") will detect “I am going to kill you.”

EXCEPT WHEN Condition

  • The EXCEPT WHEN Condition specifies exceptions to the Rules within a Label of your Policy. These exceptions apply only to that Label, without affecting the overall Policy or other Labelss.
    • The example below indicates that this Label is analyzing the content for attacks about personal circumstances, except when it is deemed to be light trash talk. If detected as light trash talk, this Label will not be flagged.
LABEL "Harassment": "MED" {
    "attacks" [ABOUT] "personal circumstances"
     EXCEPT WHEN {
        "light trash talk"
    }
}

Signal(s)

A Signal or Signal List contains the words, phrases, or sentiments to search for within content, represented in “quotation marks.” Every Rule must include at least one Signal, and often Rules will contain multiple Signals grouped together, to form a Signal List. For example, this Signal list will find any mention of the words “dog,” “cat,” or “pony.” This is an example of a Rule with an Exact Match Condition, and works like saying, “Find the words dog OR cat OR pony.”
 =("cat",
   "dog",
   "pony")
For Rules where you want to detect multiple contexts, use a Signal List with the ANY Condition. This example will tell the system to flag all mentions of any content related to a the Signals “racial group”, “gender”, or “race”:
        ANY(
            "racial group",
            "gender",
            "races"
        )
Whereas, a simple example of a Signal in a Context Condition is as follows. The Signals here are “misinformation” and “elections”, and the Rule is looking for contexts relating to misinformation about elections: "misinformation" [ABOUT] "elections"

Key Features / Benefits

  • Pre-built are available to help you get started, especially if you’re new to Policy syntax.
  • Each Policy must include at least one Label and one Rule, and each Rule must include at least one Signal, ensuring a clear structure for managing content.
  • Custom names can be assigned to Policies, making them easy to differentiate and organize.
  • Policies support flexible matching, allowing you to detect exact matches, fuzzy matches, or even analyze sentiment in content.
  • You can set up conditional logic to handle multiple contexts or exclude specific content using “EXCEPT WHEN” blocks within a Label.

Example


file-i40RTdtRPV (1).png

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].