> For the complete documentation index, see [llms.txt](https://docs.thub.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.thub.tech/langchain/moderation.md).

# 🛡️Moderation

Moderation nodes are used to check whether the input or output consists of harmful or inappropriate content.

#### 1)OpenAI Moderation

The OpenAI Moderation node checks whether input content complies with OpenAI safety policies before sending it to the model.

#### Setup Requirements:

1. Go to [OpenAI Platform](https://platform.openai.com/)
2. Generate [API Key](https://platform.openai.com/api-keys)
3. Add OpenAI Moderation node to the canvas
4. Connect Credential > paste OpenAI API Key
5. Configure Error Message if required

#### Use Cases:

• Filtering unsafe or restricted content\
• Ensuring compliance with AI safety policies

<figure><img src="https://1720595571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxWXmt1Z68dgle5JORrEw%2Fuploads%2FaSguruslThowqD6k6HXd%2Fimage.png?alt=media&amp;token=4bd15249-f3cb-4cf4-aef8-02e6e49fd7f9" alt=""><figcaption></figcaption></figure>

#### 2)Simple Prompt Moderation

The Simple Prompt Moderation node checks input against a deny list and blocks restricted content before sending it to the model.

#### Setup Requirements:

1. Add Simple Prompt Moderation node to the canvas
2. Enter Deny List (restricted words or phrases)
3. Connect Chat Model if required
4. Configure Error Message

#### Use Cases:

• Blocking specific keywords or instructions\
• Preventing prompt injection or misuse

<figure><img src="https://1720595571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxWXmt1Z68dgle5JORrEw%2Fuploads%2FwDBppIQWKZRFoRQGD6aH%2Fimage.png?alt=media&amp;token=1c7544e8-fb60-492c-9912-b3e64abfd899" alt=""><figcaption></figcaption></figure>
