OpenGuardrails icon

OpenGuardrails

AI safety and content moderation with OpenGuardrails

Overview

This node integrates with OpenGuardrails to perform AI safety and content moderation. It checks content or conversation messages for safety issues such as prompt attacks, compliance violations, data leaks, and privacy concerns. The node is useful for workflows that require automated content safety checks before processing or sending outputs, ensuring compliance and security in AI-generated or user-provided content. For example, it can moderate user inputs, AI outputs, or multi-turn conversations to prevent harmful or risky content from proceeding in the workflow.

Use Case Examples

  1. Moderate user input text before processing it further in an AI workflow.
  2. Check AI-generated output for compliance and security risks before sending it to end users.
  3. Analyze multi-turn conversation history to detect and handle unsafe content.

Properties

Name Meaning
Content The text content to check for safety issues, used in operations like checkContent, inputModeration, and outputModeration.
Detection Options Settings to enable or disable specific safety checks and provide 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 from OpenGuardrails.

Output

JSON

  • action - The action decided by OpenGuardrails for the content (e.g., reject, replace, continue).
  • risk_level - The risk level detected in the content (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 content that was checked.
  • processed_content - The content after processing, which may be replaced if high risk and replacement is chosen.
  • was_replaced - Boolean indicating if the content was replaced with a safe response.
  • has_warning - Boolean indicating if the content has a warning based on risk level.

Dependencies

  • OpenGuardrails API key credential

Troubleshooting

  • If the node throws an error about content being blocked, it means high-risk content was detected and the 'Stop Workflow' action was selected. To resolve, either change the action to continue or replace, or ensure the content complies with safety policies.
  • If the node returns unexpected results, verify that the OpenGuardrails API key and URL are correctly configured in credentials.
  • Network or API errors may cause request failures; check internet connectivity and API service status.

Links

Discussion