OpenGuardrails icon

OpenGuardrails

AI safety and content moderation with OpenGuardrails

Overview

This node integrates with the OpenGuardrails API to perform AI safety and content moderation checks on multi-turn conversations. It is useful for workflows that need to ensure conversation content is safe, compliant, and free from security threats or data leaks. For example, it can be used in chatbots or virtual assistants to monitor and moderate user and system messages in real-time, preventing harmful or sensitive content from being processed or displayed.

Use Case Examples

  1. A chatbot workflow that checks the entire conversation history for security and compliance issues before responding.
  2. A customer support automation that stops processing if high-risk content is detected in the conversation.
  3. A content moderation system that replaces risky conversation content with a safe response automatically.

Properties

Name Meaning
Messages The conversation history to check, consisting of multiple messages with roles (user, assistant, system) and their content.
Detection Options Settings to enable or disable specific checks such as security, compliance, and data security, plus an optional user ID for ban policy enforcement.
Action on High Risk Defines how to handle detected high-risk content: continue with a warning, stop the workflow, or replace the content with a safe response.

Output

JSON

  • action - The action recommended by OpenGuardrails based on the risk level (e.g., reject, replace, continue).
  • risk_level - The risk level detected in the conversation (e.g., high, medium, low).
  • categories - Categories of detected issues related to the content.
  • suggest_answer - Suggested safe response content if replacement is used.
  • hit_keywords - Keywords that triggered the detection.
  • original_content - The original conversation content that was checked.
  • processed_content - The content after processing, which may be the original or a safe replacement.
  • was_replaced - Boolean indicating if the content was replaced with a safe response.
  • has_warning - Boolean indicating if the content has a high or medium risk warning.

Dependencies

  • Requires an API key credential for OpenGuardrails API access.

Troubleshooting

  • If the node throws an error about content being blocked, it means high-risk content was detected and the 'Stop Workflow' action is enabled. To resolve, either change the action to continue or replace, or ensure the content is safe.
  • If the API request fails, check that the OpenGuardrails API key and URL are correctly configured in the node credentials.
  • Ensure the conversation messages are properly formatted with roles and content to avoid request errors.

Links

Discussion