Overview
This node integrates with OpenGuardrails to perform AI safety and content moderation checks on text content. It is useful for workflows that require ensuring content safety, compliance, and data security by detecting prompt attacks, security threats, compliance issues, and privacy violations. Practical examples include moderating user input before processing, checking AI-generated output before sending, and verifying multi-turn conversation safety.
Use Case Examples
- Moderate user-generated comments on a website to prevent harmful or non-compliant content.
- Check AI assistant responses for safety before sending them to users.
- Analyze conversation history in chatbots to detect and mitigate risky content.
Properties
| Name | Meaning |
|---|---|
| Content | The text content to check for safety issues. |
| 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, with options to continue with a warning, stop the workflow, or replace the content with a safe response. |
Output
JSON
action- The action determined by OpenGuardrails for the content (e.g., reject, replace, continue).risk_level- The risk level of the content (e.g., high, medium, low).categories- Categories of detected issues related to the content.suggest_answer- Suggested safe response if content is replaced.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.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
- 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 is enabled. To resolve, either change the action to continue or replace, or modify the content to be safer.
- Ensure the OpenGuardrails API key credential is correctly configured and has access to the API endpoint.
- If the node returns unexpected results, verify that the content and detection options are correctly set and that the API URL is reachable.
Links
- OpenGuardrails Official Website - Official site for OpenGuardrails, providing documentation and API details.