# 🛡️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>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.thub.tech/langchain/moderation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
