> ## Documentation Index
> Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Rules Management

> Rules Management — CometChat documentation.

## Overview

Rules Management allows you to define and manage moderation rules that automatically detect and handle inappropriate content. Configure rules once in the Dashboard, and they're automatically applied to all messages sent through CometChat.

<Note>
  **Using UI Kit or SDK?** Once you configure rules in the Dashboard, they are automatically applied to all messages. No additional code is required - the UI Kit and SDK handle moderation seamlessly.
</Note>

***

## Quick Start

Enable moderation in under 2 minutes:

<Steps>
  <Step title="Open Rules Settings">
    Login to [CometChat Dashboard](https://app.cometchat.com) → Select your app → **Moderation** → **Settings** → **Rules**
  </Step>

  <Step title="Enable Default Rules">
    Toggle on the rules you need (e.g., Profanity Filter, AI Image Moderation)
  </Step>

  <Step title="Test It">
    Send a test message that violates the rule - it should be blocked automatically
  </Step>
</Steps>

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b/-YC7tOebleeoFejE/images/e78212be-moderation_rule_management_overview-2ca6cfb4d9470fac593de30c03a65328.png?fit=max&auto=format&n=-YC7tOebleeoFejE&q=85&s=a65be3b8977dcba238c5e2894b9ef807" width="1839" height="900" data-path="images/e78212be-moderation_rule_management_overview-2ca6cfb4d9470fac593de30c03a65328.png" />
</Frame>

***

## Available Rules Summary

<Tabs>
  <Tab title="Text Rules">
    | Rule                          | Description                                      | Use Case                     |
    | ----------------------------- | ------------------------------------------------ | ---------------------------- |
    | **Profanity Filter**          | Blocks offensive language using keyword matching | General chat apps            |
    | **Contact Details Filter**    | Blocks phone numbers                             | Marketplaces, dating apps    |
    | **Email Filter**              | Blocks email addresses                           | Prevent off-platform contact |
    | **AI Toxicity Detection**     | AI-powered detection of toxic language           | Community platforms          |
    | **AI Spam Detection**         | Detects spam messages                            | High-traffic apps            |
    | **AI Scam Detection**         | Identifies fraudulent messages                   | Marketplaces, finance apps   |
    | **AI Platform Circumvention** | Detects attempts to bypass rules                 | All apps                     |
  </Tab>

  <Tab title="Image Rules">
    | Rule                        | Description                               | Use Case                                |
    | --------------------------- | ----------------------------------------- | --------------------------------------- |
    | **AI Image Moderation**     | Blocks explicit/unsafe images             | All apps with image sharing             |
    | **OpenAI Explicit Content** | Detects nudity and sexual content         | Social apps, dating                     |
    | **OpenAI Violence/Gore**    | Blocks graphic violence                   | Family-friendly apps                    |
    | **OpenAI Hate Symbols**     | Detects hate imagery                      | Community platforms                     |
    | **OpenAI Privacy Data**     | Blocks images with personal data          | Finance, healthcare                     |
    | **Malware & Virus Scanner** | Scans image files for malware and viruses | Enterprise, healthcare, compliance apps |
  </Tab>

  <Tab title="Video Rules">
    | Rule                        | Description                               | Use Case                                |
    | --------------------------- | ----------------------------------------- | --------------------------------------- |
    | **AI Video Moderation**     | Blocks explicit/unsafe video content      | Apps with video sharing                 |
    | **Malware & Virus Scanner** | Scans video files for malware and viruses | Enterprise, healthcare, compliance apps |
  </Tab>

  <Tab title="Audio Rules">
    | Rule                        | Description                               | Use Case                                |
    | --------------------------- | ----------------------------------------- | --------------------------------------- |
    | **Malware & Virus Scanner** | Scans audio files for malware and viruses | Enterprise, healthcare, compliance apps |
  </Tab>

  <Tab title="File Rules">
    | Rule                        | Description                                                                    | Use Case                                |
    | --------------------------- | ------------------------------------------------------------------------------ | --------------------------------------- |
    | **Malware & Virus Scanner** | Scans all file attachments (documents, archives, etc.) for malware and viruses | Enterprise, healthcare, compliance apps |
  </Tab>

  <Tab title="OpenAI Rules">
    | Rule                         | Type       | Description                          |
    | ---------------------------- | ---------- | ------------------------------------ |
    | **Hate & Harassment**        | Text/Image | Detects hateful or harassing content |
    | **Explicit Content**         | Text/Image | Blocks sexual or graphic content     |
    | **Privacy & Sensitive Info** | Text/Image | Protects personal data               |
    | **Spam & Scam**              | Text       | Identifies fraudulent schemes        |
    | **Violence & Terrorism**     | Text/Image | Blocks violent extremism             |
    | **Self-Harm Content**        | Text/Image | Detects self-harm references         |
    | **Impersonation & Fraud**    | Text       | Prevents identity fraud              |
    | **Minor Safety**             | Image      | Protects minors from exploitation    |
  </Tab>
</Tabs>

***

## Recommended Rules by Use Case

<AccordionGroup>
  <Accordion title="Social/Community App">
    **Essential:**

    * Profanity Filter
    * AI Toxicity Detection
    * AI Image Moderation
    * OpenAI Hate & Harassment

    **Recommended:**

    * AI Spam Detection
    * OpenAI Explicit Content
  </Accordion>

  <Accordion title="Marketplace/Classifieds">
    **Essential:**

    * Contact Details Filter
    * Email Filter
    * AI Scam Detection
    * AI Platform Circumvention

    **Recommended:**

    * Profanity Filter
    * AI Image Moderation
  </Accordion>

  <Accordion title="Dating App">
    **Essential:**

    * Contact Details Filter
    * Email Filter
    * AI Image Moderation
    * OpenAI Explicit Content

    **Recommended:**

    * AI Scam Detection
    * OpenAI Privacy Data (Image)
  </Accordion>

  <Accordion title="Gaming/Entertainment">
    **Essential:**

    * Profanity Filter
    * AI Toxicity Detection
    * AI Spam Detection

    **Recommended:**

    * OpenAI Hate & Harassment
    * AI Image Moderation
  </Accordion>

  <Accordion title="Healthcare/Finance">
    **Essential:**

    * OpenAI Privacy & Sensitive Info
    * OpenAI Privacy Data (Image)
    * AI Scam Detection
    * Malware & Virus Scanner

    **Recommended:**

    * Profanity Filter
    * Contact Details Filter
  </Accordion>

  <Accordion title="Enterprise/Compliance">
    **Essential:**

    * Malware & Virus Scanner
    * OpenAI Privacy & Sensitive Info
    * AI Scam Detection

    **Recommended:**

    * Profanity Filter
    * AI Image Moderation
  </Accordion>
</AccordionGroup>

***

## Best Practices

| Practice                | Description                                                                                                |
| ----------------------- | ---------------------------------------------------------------------------------------------------------- |
| **Start with Defaults** | Enable default rules first, then customize based on your needs. Don't try to configure everything at once. |
| **Test Before Launch**  | Test rules in a staging environment. Send test messages to verify rules work as expected.                  |
| **Monitor Regularly**   | Check the [Blocked Messages](/moderation/blocked-messages) dashboard regularly to catch false positives.   |
| **Iterate & Refine**    | Review [Rule Revisions](#rule-revisions) to track changes and refine rules over time.                      |

### Tips for Effective Moderation

1. **Layer your rules** - Use multiple rules together (e.g., Profanity Filter + AI Toxicity) for better coverage
2. **Adjust confidence levels** - Lower confidence = more aggressive blocking, higher = fewer false positives
3. **Use Flag action for borderline content** - Instead of blocking, flag messages for manual review
4. **Create custom keyword lists** - Add industry-specific terms to the [Lists Management](/moderation/lists-management)

***

## Default Rules

Default rules are pre-configured and ready to use. Simply toggle them on in the Dashboard.

<Tabs>
  <Tab title="Text Moderation">
    <AccordionGroup>
      <Accordion title="Profanity Filter">
        Automatically detects and blocks messages containing offensive language, profanity, or derogatory remarks using a predefined list of offensive keywords.

        **Example:** Before enabling, profane messages are delivered (double ticks). After enabling, they're blocked (single tick).

        <Frame>
          <img src="https://mintcdn.com/cometchat-22654f5b/Xbd1mrZiWe1Pd3HE/images/8f130ec3-modderation_rule_profanity_fiter_mobile_cometchat_screens-c4ecaf1d8cebe3af0b620468942cb3da.png?fit=max&auto=format&n=Xbd1mrZiWe1Pd3HE&q=85&s=ab5c655bcb78951444d390b0d7496f50" width="4408" height="3120" data-path="images/8f130ec3-modderation_rule_profanity_fiter_mobile_cometchat_screens-c4ecaf1d8cebe3af0b620468942cb3da.png" />
        </Frame>
      </Accordion>

      <Accordion title="Contact Details Filter">
        Detects and blocks messages containing phone numbers to prevent sharing of private contact information.

        <Frame>
          <img src="https://mintcdn.com/cometchat-22654f5b/T-kVUXtubs0NtFU5/images/cf288bde-modderation_rule_contact_detail_filter_mobile_cometchat_screens-3297b59519160f2af91e54c0c2d8f6a9.png?fit=max&auto=format&n=T-kVUXtubs0NtFU5&q=85&s=f252ce61e037b06cd15bb28cebf43ca9" width="4408" height="3120" data-path="images/cf288bde-modderation_rule_contact_detail_filter_mobile_cometchat_screens-3297b59519160f2af91e54c0c2d8f6a9.png" />
        </Frame>
      </Accordion>

      <Accordion title="Email Filter">
        Detects and blocks messages containing email addresses to prevent off-platform communication.

        <Frame>
          <img src="https://mintcdn.com/cometchat-22654f5b/F0pRX00dbgkztAbW/images/12311178-modderation_rule_email_filter_mobile_cometchat_screens-d82286fc881ea93a34666d955ee4fee7.png?fit=max&auto=format&n=F0pRX00dbgkztAbW&q=85&s=68dcaaf5b771bf04f50d3e052ffa3be0" width="4408" height="3120" data-path="images/12311178-modderation_rule_email_filter_mobile_cometchat_screens-d82286fc881ea93a34666d955ee4fee7.png" />
        </Frame>
      </Accordion>

      <Accordion title="AI Message Toxicity">
        AI-powered detection of toxic, harmful, or inappropriate language including threats, harassment, and hate speech. Supports multiple languages.

        <Frame>
          <img src="https://mintcdn.com/cometchat-22654f5b/HFXOvmhiLRb5ClID/images/9194f903-modderation_rule_ai_toxicity_mobile_cometchat_screens-e945b0cd8be91f8b8d44e4cd4ad975ef.png?fit=max&auto=format&n=HFXOvmhiLRb5ClID&q=85&s=65d2ad5df0b1bf13a8c3537f65da3f58" width="3972" height="3200" data-path="images/9194f903-modderation_rule_ai_toxicity_mobile_cometchat_screens-e945b0cd8be91f8b8d44e4cd4ad975ef.png" />
        </Frame>
      </Accordion>

      <Accordion title="AI Platform Circumvention">
        Detects attempts by users to bypass platform rules using sentence similarity analysis.

        <Frame>
          <img src="https://mintcdn.com/cometchat-22654f5b/RxKy5RgybeX-8GbH/images/1ba7f0bb-modderation_rule_ai_platform_circumvention_mobile_cometchat_screens-945665fd61df0fc54924b6e7597d042b.png?fit=max&auto=format&n=RxKy5RgybeX-8GbH&q=85&s=cfc30dc3e6ae0e0b6df3c03d586a7b06" width="3795" height="3200" data-path="images/1ba7f0bb-modderation_rule_ai_platform_circumvention_mobile_cometchat_screens-945665fd61df0fc54924b6e7597d042b.png" />
        </Frame>
      </Accordion>

      <Accordion title="AI Scam Detection">
        Identifies scam-related messages including phishing attempts, fake offers, and fraudulent schemes.

        <Frame>
          <img src="https://mintcdn.com/cometchat-22654f5b/60KLvpM3Vx0byZeU/images/b65711a2-modderation_rule_scam_detection_mobile_cometchat_screens-bfaa95d1fb11b22e2eb10a12f12182ad.png?fit=max&auto=format&n=60KLvpM3Vx0byZeU&q=85&s=b230744e64e712602a6633126e6f2217" width="4070" height="3200" data-path="images/b65711a2-modderation_rule_scam_detection_mobile_cometchat_screens-bfaa95d1fb11b22e2eb10a12f12182ad.png" />
        </Frame>
      </Accordion>

      <Accordion title="AI Spam Detection">
        Detects and filters spam messages by analyzing content patterns and identifying unwanted communications.

        <Frame>
          <img src="https://mintcdn.com/cometchat-22654f5b/2U5tVIzH12dbbFtr/images/af0fdcad-modderation_rule_spam_detection_mobile_cometchat_screens-e6b8b15f2a8c3b8de4ef3cf235814bfd.png?fit=max&auto=format&n=2U5tVIzH12dbbFtr&q=85&s=3e6d6b820ce3e19dbec2054e3dc53330" width="4158" height="3200" data-path="images/af0fdcad-modderation_rule_spam_detection_mobile_cometchat_screens-e6b8b15f2a8c3b8de4ef3cf235814bfd.png" />
        </Frame>
      </Accordion>
    </AccordionGroup>
  </Tab>

  <Tab title="Image Moderation">
    <AccordionGroup>
      <Accordion title="AI Image Moderation">
        Uses AI to identify and block images containing sensitive, explicit, or prohibited content.

        <Frame>
          <img src="https://mintcdn.com/cometchat-22654f5b/bUk-WwSNpBXF92Yc/images/da89c733-modderation_rule_ai_image_mobile_cometchat_screens-fdb4cf49eaabb7d5d13babcb1c0669ec.png?fit=max&auto=format&n=bUk-WwSNpBXF92Yc&q=85&s=8cb54f2aa19c72119539f87f90830963" width="4408" height="3120" data-path="images/da89c733-modderation_rule_ai_image_mobile_cometchat_screens-fdb4cf49eaabb7d5d13babcb1c0669ec.png" />
        </Frame>
      </Accordion>

      <Accordion title="OpenAI: Hate or Harassment">
        Detects hate symbols, extremist insignia, and harassing imagery.

        <Frame>
          <img src="https://mintcdn.com/cometchat-22654f5b/-YC7tOebleeoFejE/images/e5e7396c-moderation_rule_openAI_hate_image_mobile_cometchat_screen-a7c75337201bf3446d6cac6002f34b01.png?fit=max&auto=format&n=-YC7tOebleeoFejE&q=85&s=3d4f2041e1aa89e04581a5726659091d" width="879" height="753" data-path="images/e5e7396c-moderation_rule_openAI_hate_image_mobile_cometchat_screen-a7c75337201bf3446d6cac6002f34b01.png" />
        </Frame>
      </Accordion>

      <Accordion title="OpenAI: Explicit or Sexual Content">
        Identifies nudity, explicit sexual content, or suggestive imagery.

        <Frame>
          <img src="https://mintcdn.com/cometchat-22654f5b/udim9ku6wPsRNXGs/images/e06f998e-moderation_rule_openAI_sexual_image_mobile_cometchat_screen-bf263a790e241d6cf88c9dbb8657f2f2.png?fit=max&auto=format&n=udim9ku6wPsRNXGs&q=85&s=f6be84aad9e8746490e87397165dc8aa" width="879" height="753" data-path="images/e06f998e-moderation_rule_openAI_sexual_image_mobile_cometchat_screen-bf263a790e241d6cf88c9dbb8657f2f2.png" />
        </Frame>
      </Accordion>

      <Accordion title="OpenAI: Graphic Violence or Gore">
        Detects images of extreme violence, gore, or disturbing content.

        <Frame>
          <img src="https://mintcdn.com/cometchat-22654f5b/8ODUflBxloB1jkgP/images/0428695a-moderation_rule_openAI_graphic_violence_image_mobile_cometchat_screen-17092e9710171dbc1b0933d49e6a9cd2.png?fit=max&auto=format&n=8ODUflBxloB1jkgP&q=85&s=8fbbfa8f2faa22a193266ec0401fac45" width="879" height="753" data-path="images/0428695a-moderation_rule_openAI_graphic_violence_image_mobile_cometchat_screen-17092e9710171dbc1b0933d49e6a9cd2.png" />
        </Frame>
      </Accordion>

      <Accordion title="OpenAI: Privacy or Personal Data">
        Identifies images containing personal data like IDs, addresses, or financial documents.

        <Frame>
          <img src="https://mintcdn.com/cometchat-22654f5b/DVg4aTljRFe0drLF/images/23d48c00-moderation_rule_openAI_privacy_image_mobile_cometchat_screen-81488fb57205f1e4ed2b3fff7bc5ba3f.png?fit=max&auto=format&n=DVg4aTljRFe0drLF&q=85&s=06ae785604ed9337ca189f294e6de5ae" width="879" height="753" data-path="images/23d48c00-moderation_rule_openAI_privacy_image_mobile_cometchat_screen-81488fb57205f1e4ed2b3fff7bc5ba3f.png" />
        </Frame>
      </Accordion>

      <Accordion title="OpenAI: Self-Harm Content">
        Detects imagery suggesting self-harm or suicidal ideation.

        <Frame>
          <img src="https://mintcdn.com/cometchat-22654f5b/CrArf1QwUPg5EvCC/images/2d185f07-moderation_rule_openAI_self_harm_image_mobile_cometchat_screen-2b506eb2ef69e7641ca47d6fc582c94a.png?fit=max&auto=format&n=CrArf1QwUPg5EvCC&q=85&s=5e14d8231940194196d444b55f82c2a4" width="879" height="720" data-path="images/2d185f07-moderation_rule_openAI_self_harm_image_mobile_cometchat_screen-2b506eb2ef69e7641ca47d6fc582c94a.png" />
        </Frame>
      </Accordion>

      <Accordion title="OpenAI: Minor Safety">
        Detects exploitative imagery of minors or unsafe depictions of children.

        <Frame>
          <img src="https://mintcdn.com/cometchat-22654f5b/FdElFhttTImVJEz7/images/e3db0e20-moderation_rule_openAI_minor_safety_image_mobile_cometchat_screen-e87ef23e3956d0017037dd955b8870c1.png?fit=max&auto=format&n=FdElFhttTImVJEz7&q=85&s=809f69ed9ea1027b817094cf27f6604e" width="879" height="753" data-path="images/e3db0e20-moderation_rule_openAI_minor_safety_image_mobile_cometchat_screen-e87ef23e3956d0017037dd955b8870c1.png" />
        </Frame>
      </Accordion>

      <Accordion title="OpenAI: Fraud or Scam Indicators">
        Flags manipulated or fraudulent images like fake IDs or doctored screenshots.

        <Frame>
          <img src="https://mintcdn.com/cometchat-22654f5b/Relz_yItqW5RHUsU/images/503a54fd-moderation_rule_openAI_fraud_scam_image_mobile_cometchat_screen-adc0ab4dead524029c442477640c75b5.png?fit=max&auto=format&n=Relz_yItqW5RHUsU&q=85&s=ac6127d81c09cb2961660b12340e8ebe" width="879" height="720" data-path="images/503a54fd-moderation_rule_openAI_fraud_scam_image_mobile_cometchat_screen-adc0ab4dead524029c442477640c75b5.png" />
        </Frame>
      </Accordion>

      <Accordion title="OpenAI: Terrorism or Extremism">
        Detects extremist propaganda, terrorist symbols, or violent ideologies.

        <Frame>
          <img src="https://mintcdn.com/cometchat-22654f5b/LKT8U_07JOWQgTZK/images/0dec8099-moderation_rule_openAI_terror_image_mobile_cometchat_screen-d548c7535a9cc0d6e04ba1ceeeca42a2.png?fit=max&auto=format&n=LKT8U_07JOWQgTZK&q=85&s=b20a12f2f2a0d9a7e97327f06fe79ebe" width="879" height="753" data-path="images/0dec8099-moderation_rule_openAI_terror_image_mobile_cometchat_screen-d548c7535a9cc0d6e04ba1ceeeca42a2.png" />
        </Frame>
      </Accordion>

      <Accordion title="Malware & Virus Scanner">
        Scans image files for viruses, malware, trojans, worms, and ransomware before delivery.
      </Accordion>
    </AccordionGroup>
  </Tab>

  <Tab title="Video Moderation">
    <AccordionGroup>
      <Accordion title="AI Video Moderation">
        Uses AI to identify and block videos containing sensitive, explicit, or prohibited content.

        <Frame>
          <img src="https://mintcdn.com/cometchat-22654f5b/aledzZZMtw_sXx4U/images/fa0e36f1-modderation_rule_ai_video_mobile_cometchat_screens-05892a0f7e20a33f837b9cc84ef300b5.png?fit=max&auto=format&n=aledzZZMtw_sXx4U&q=85&s=5e00630345f5f2d8a6dd3abb62131fc9" width="4408" height="3120" data-path="images/fa0e36f1-modderation_rule_ai_video_mobile_cometchat_screens-05892a0f7e20a33f837b9cc84ef300b5.png" />
        </Frame>
      </Accordion>

      <Accordion title="Malware & Virus Scanner">
        Scans video files for viruses, malware, trojans, worms, and ransomware before delivery.
      </Accordion>
    </AccordionGroup>
  </Tab>

  <Tab title="Audio Moderation">
    <AccordionGroup>
      <Accordion title="Malware & Virus Scanner">
        Scans audio files for viruses, malware, trojans, worms, and ransomware before delivery.
      </Accordion>
    </AccordionGroup>
  </Tab>

  <Tab title="File Moderation">
    <AccordionGroup>
      <Accordion title="Malware & Virus Scanner">
        Automatically scans all file attachments for malware and viruses before delivery, blocking infected files to protect users from malicious content. Detects viruses, malware, trojans, worms, and ransomware.

        Supports documents (PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX, TXT, CSV), archives (ZIP, RAR, 7Z, TAR, GZ), and all other file attachments.
      </Accordion>
    </AccordionGroup>
  </Tab>
</Tabs>

<Tabs>
  <Tab title="OpenAI Text Rules">
    <AccordionGroup>
      <Accordion title="OpenAI: Hate and Harassment (All Languages)">
        Detects hateful or harassing language toward individuals or groups using OpenAI moderation.

        <Frame>
          <img src="https://mintcdn.com/cometchat-22654f5b/-ESEkh1kVWNrvtT0/images/658a6d89-moderation_rule_openAI_hate_text_mobile_cometchat_screen-198ea3ee8a6fec616bc78611dc12876a.png?fit=max&auto=format&n=-ESEkh1kVWNrvtT0&q=85&s=65213f7393f1adde29aa2b5699302c1c" width="879" height="720" data-path="images/658a6d89-moderation_rule_openAI_hate_text_mobile_cometchat_screen-198ea3ee8a6fec616bc78611dc12876a.png" />
        </Frame>
      </Accordion>

      <Accordion title="OpenAI: Privacy and Sensitive Info (All Languages)">
        Detects messages sharing personal or sensitive information without consent.

        <Frame>
          <img src="https://mintcdn.com/cometchat-22654f5b/GrDbzzq1LLfv-sgw/images/83f0672f-moderation_rule_openAI_privacy_text_mobile_cometchat_screen-8ab5b05d32cfae5b47891b56c0c6def9.png?fit=max&auto=format&n=GrDbzzq1LLfv-sgw&q=85&s=11f17e12446f0bc9f76365c9284c1f23" width="879" height="753" data-path="images/83f0672f-moderation_rule_openAI_privacy_text_mobile_cometchat_screen-8ab5b05d32cfae5b47891b56c0c6def9.png" />
        </Frame>
      </Accordion>

      <Accordion title="OpenAI: Explicit or Inappropriate Content (All Languages)">
        Identifies explicit sexual descriptions, graphic violence, or unsuitable text.

        <Frame>
          <img src="https://mintcdn.com/cometchat-22654f5b/t35Dbaum6Rkuz_d5/images/14d4d35c-moderation_rule_openAI_explicit_text_mobile_cometchat_screen-7563f50b52763a1717f6e82fcd60f8fd.png?fit=max&auto=format&n=t35Dbaum6Rkuz_d5&q=85&s=4f666701e33d2b6c2b7f54d7dbecf6fc" width="879" height="753" data-path="images/14d4d35c-moderation_rule_openAI_explicit_text_mobile_cometchat_screen-7563f50b52763a1717f6e82fcd60f8fd.png" />
        </Frame>
      </Accordion>

      <Accordion title="OpenAI: Spam and Scam (All Languages)">
        Detects spam messages, phishing attempts, and fraudulent schemes.

        <Frame>
          <img src="https://mintcdn.com/cometchat-22654f5b/y8uIEcRYKgfQIY6z/images/9d4d0dad-moderation_rule_openAI_spam_detection_text_mobile_cometchat_screen-ee6dd2b3e8f45e480df302e01f98deff.png?fit=max&auto=format&n=y8uIEcRYKgfQIY6z&q=85&s=373b595fd618ced00f41ec62d3bb17ca" width="879" height="753" data-path="images/9d4d0dad-moderation_rule_openAI_spam_detection_text_mobile_cometchat_screen-ee6dd2b3e8f45e480df302e01f98deff.png" />
        </Frame>
      </Accordion>

      <Accordion title="OpenAI: Violent or Terroristic Threats (All Languages)">
        Identifies content promoting violence or extremism.

        <Frame>
          <img src="https://mintcdn.com/cometchat-22654f5b/y8uIEcRYKgfQIY6z/images/9bfc6db6-moderation_rule_openAI_violent_terroristic_Threats_text_mobile_cometchat_screen-a610067f380933bacb17678633b88e7c.png?fit=max&auto=format&n=y8uIEcRYKgfQIY6z&q=85&s=d23fff8ed32bbd661358c9662fb8603f" width="879" height="720" data-path="images/9bfc6db6-moderation_rule_openAI_violent_terroristic_Threats_text_mobile_cometchat_screen-a610067f380933bacb17678633b88e7c.png" />
        </Frame>
      </Accordion>

      <Accordion title="OpenAI: Non-Consensual Sexual Content (All Languages)">
        Detects sexual exploitation, grooming, or non-consensual content.

        <Frame>
          <img src="https://mintcdn.com/cometchat-22654f5b/6twnUcGNOB9c0CI0/images/ebd4a85d-moderation_rule_openAI_sexual_text_mobile_cometchat_screen-bbc3bf2e817fd4f70eac9c9136c47e4f.png?fit=max&auto=format&n=6twnUcGNOB9c0CI0&q=85&s=062f90d8999499e13818815963ff3d02" width="879" height="753" data-path="images/ebd4a85d-moderation_rule_openAI_sexual_text_mobile_cometchat_screen-bbc3bf2e817fd4f70eac9c9136c47e4f.png" />
        </Frame>
      </Accordion>

      <Accordion title="OpenAI: Impersonation or Fraud (All Languages)">
        Identifies deceptive attempts to impersonate individuals or organizations.

        <Frame>
          <img src="https://mintcdn.com/cometchat-22654f5b/CrArf1QwUPg5EvCC/images/29c3e85d-moderation_rule_openAI_impersonation_text_dashboard_mobile_cometchat_screen-a1f1c6a9719961314b15aae69c8e9ceb.png?fit=max&auto=format&n=CrArf1QwUPg5EvCC&q=85&s=3adc799492fb7e9b92c0b07776c8dbf0" width="879" height="753" data-path="images/29c3e85d-moderation_rule_openAI_impersonation_text_dashboard_mobile_cometchat_screen-a1f1c6a9719961314b15aae69c8e9ceb.png" />
        </Frame>
      </Accordion>

      <Accordion title="OpenAI: Self-Harm or Suicidal Content (All Languages)">
        Detects messages suggesting self-harm or suicidal thoughts.

        <Frame>
          <img src="https://mintcdn.com/cometchat-22654f5b/Relz_yItqW5RHUsU/images/50877dfd-moderation_rule_openAI_self_harm_text_mobile_cometchat_screen-7536d043e2963a62663ad956a60562b5.png?fit=max&auto=format&n=Relz_yItqW5RHUsU&q=85&s=41d979d8a4807396fe77a7c715df9dff" width="879" height="753" data-path="images/50877dfd-moderation_rule_openAI_self_harm_text_mobile_cometchat_screen-7536d043e2963a62663ad956a60562b5.png" />
        </Frame>
      </Accordion>
    </AccordionGroup>
  </Tab>
</Tabs>

***

## Rule Configuration

### Filters

Filters narrow down which messages are checked by a rule based on sender or receiver attributes:

| Filter Type  | Properties                                                    |
| ------------ | ------------------------------------------------------------- |
| **Sender**   | UID, Role, Name, Tags, Created date                           |
| **Receiver** | Name, GUID, Tags, Group type, Created date, Type (user/group) |

### Conditions

Conditions define what content triggers the rule:

| Content Type    | Available Conditions                                                     |
| --------------- | ------------------------------------------------------------------------ |
| **Text/Custom** | Keyword list, Word patterns, Toxicity, Sentiment, Sentence similarity    |
| **Image/Video** | Violence, Gambling, Alcohol, Drugs, Nudity, Hate symbols, Unsafe content |

You can set a **confidence percentage** for AI-based conditions to control sensitivity.

### Actions

Actions determine what happens when content matches the conditions:

| Action         | Description                                 |
| -------------- | ------------------------------------------- |
| **Block**      | Message is not delivered (default)          |
| **Flag**       | Message is delivered but flagged for review |
| **Ban User**   | User is banned from the group               |
| **Kick User**  | User is removed from the group              |
| **Block User** | User is blocked platform-wide               |

***

## Managing Rules

### Create Rule

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b/veBAxaR1km9EBnSg/images/3bcf4965-moderation_rule_create_rule-46c88792ae47637250f6484502aebdf2.png?fit=max&auto=format&n=veBAxaR1km9EBnSg&q=85&s=6361c0efbb227909e04a6b506f92d9be" width="1202" height="607" data-path="images/3bcf4965-moderation_rule_create_rule-46c88792ae47637250f6484502aebdf2.png" />
</Frame>

1. Click **Add** in the Rules tab
2. Configure:
   * **Name**: Descriptive name for the rule
   * **Rule ID**: Unique identifier
   * **Description**: Purpose of the rule
   * **Filter**: Who the rule applies to
   * **Condition**: What triggers the rule
   * **Action**: What happens when triggered
3. Click **Save**
4. **Enable** the rule to start moderating

<Note>
  **Regex Pattern Restrictions:** When using Word patterns (regex) in conditions, avoid greedy patterns like `.*`, `.+`, or unbounded quantifiers (`\d+`, `\w+`). Use bounded patterns instead (e.g., `\d{3,10}` instead of `\d+`) to prevent performance issues. See [Lists Management](/moderation/lists-management) for more details.
</Note>

### List Rules

All configured rules are displayed in the Rules tab with their name, status, and actions.

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b/aledzZZMtw_sXx4U/images/fa448c46-moderation_rule_list-2ca6cfb4d9470fac593de30c03a65328.png?fit=max&auto=format&n=aledzZZMtw_sXx4U&q=85&s=fc30630c091ff4eefa3e414da0d0cf30" width="1839" height="900" data-path="images/fa448c46-moderation_rule_list-2ca6cfb4d9470fac593de30c03a65328.png" />
</Frame>

### Update Rule

1. Click **Edit** in the action menu
2. Modify the rule settings
3. Click **Save**

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b/nUllIo1r4Bhce7kY/images/34028487-moderation_rule_update_rule-02223729f15221bf30e6f11c82dca9a3.png?fit=max&auto=format&n=nUllIo1r4Bhce7kY&q=85&s=11935c14d316055b5d109ca805968188" width="1202" height="607" data-path="images/34028487-moderation_rule_update_rule-02223729f15221bf30e6f11c82dca9a3.png" />
</Frame>

### Delete Rule

Click **Delete** in the action menu and confirm.

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b/KQU96uDrdF-ESW1d/images/2e4a1416-moderation_rule_delete_rule-a4841dd09738f0e16f88ef36f836d7a4.png?fit=max&auto=format&n=KQU96uDrdF-ESW1d&q=85&s=eda19e6acd0591086042670279fb9057" width="1839" height="900" data-path="images/2e4a1416-moderation_rule_delete_rule-a4841dd09738f0e16f88ef36f836d7a4.png" />
</Frame>

### Rule Revisions

Track the history of changes made to a rule:

1. Click **View** in the action menu
2. Navigate to **Rule History**

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b/sVDw7GNAn28WGWte/images/4ced4287-moderation_rule_revisions-dfb1993a8ea4df388574daea830d3fb4.png?fit=max&auto=format&n=sVDw7GNAn28WGWte&q=85&s=784f60efb3ad1417f1d2c56a3653d77b" width="1202" height="607" data-path="images/4ced4287-moderation_rule_revisions-dfb1993a8ea4df388574daea830d3fb4.png" />
</Frame>

***

## Related Resources

<CardGroup cols={2}>
  <Card title="Lists Management" icon="list" href="/moderation/lists-management">
    Create custom keyword lists for your rules
  </Card>

  <Card title="Blocked Messages" icon="ban" href="/moderation/blocked-messages">
    View and manage blocked content
  </Card>

  <Card title="Flagged Messages" icon="flag" href="/moderation/flagged-messages">
    Review flagged content
  </Card>

  <Card title="SDK Integration" icon="code" href="/moderation/overview#sdk-integration">
    Handle moderation in custom UI
  </Card>
</CardGroup>
