> 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

#### 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="/files/rFhJxJDUQHjPOyFG9AIj" 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="/files/tgVReqzGfHU5lXxszIxR" alt=""><figcaption></figcaption></figure>
