n8n-nodes-railguard
v1.0.0
Published
n8n node for RailGuard AI Guardrails
Downloads
18
Maintainers
Readme
n8n-nodes-railguard
This is an n8n community node that lets you use RailGuard AI Guardrails in your n8n workflows.
RailGuard provides enterprise-grade AI safety and compliance guardrails for LLM applications. Validate user inputs, AI outputs, and prevent prompt injection, data leaks, and policy violations.
n8n is a fair-code licensed workflow automation platform.
Installation
Follow the installation guide in the n8n community nodes documentation.
Community Nodes (n8n Cloud & Self-Hosted)
- Go to Settings > Community Nodes
- Select Install
- Enter
n8n-nodes-railguardin the Enter npm package name field - Click Install
Manual Installation (Self-Hosted)
cd ~/.n8n/nodes
npm install n8n-nodes-railguardThen restart n8n.
Operations
Validate
Validate user input and/or AI output against your configured rules.
Parameters:
- Agent ID (required): Your RailGuard agent ID
- Input (required): The user input to validate
- Output (optional): The AI-generated output to validate
- Metadata (optional): Additional JSON metadata
Returns:
{
"decision": "allow|block|warn|rewrite",
"reason": "Explanation of the decision",
"rule": {
"id": "rule-id",
"name": "Rule Name"
},
"rewrite": "Rewritten text (if decision is rewrite)"
}Get Rules
Retrieve all rules configured for an agent.
Parameters:
- Agent ID (required): Your RailGuard agent ID
Returns: Array of rule objects
Get Validations
Get validation history for an agent.
Parameters:
- Agent ID (required): Your RailGuard agent ID
- Limit (optional): Number of validations to return (1-200, default: 50)
Returns: Array of validation records
Credentials
This node requires RailGuard API credentials:
- API Key: Your RailGuard API key (starts with
rg_) - Base URL: Your RailGuard API URL (default:
https://api.railguard.io)
Getting Your API Key
- Sign up at RailGuard
- Go to Dashboard > API Keys
- Create a new API key
- Copy the key (it will only be shown once)
Usage Examples
Example 1: Validate User Input Before Sending to AI
Webhook → RailGuard (Validate) → IF (decision = allow) → OpenAI → Respond
↓
(decision = block) → Return ErrorRailGuard Node Config:
- Operation:
Validate - Agent ID:
chatbot-prod - Input:
{{ $json.userMessage }}
Example 2: Validate AI Output Before Returning to User
Webhook → OpenAI → RailGuard (Validate) → IF (decision = allow) → Return Response
↓
(decision = block) → Return Safe MessageRailGuard Node Config:
- Operation:
Validate - Agent ID:
chatbot-prod - Input:
{{ $json.userInput }} - Output:
{{ $json.aiResponse }}
Example 3: Monitor and Log Warnings
Webhook → RailGuard (Validate) → IF (decision = warn) → Log to Database
↓
Continue Normal FlowUse Cases
- 🛡️ Prevent Prompt Injection: Block malicious attempts to manipulate AI behavior
- 🔒 Data Loss Prevention: Detect and prevent sensitive data leaks in AI outputs
- 📋 Compliance: Ensure AI responses comply with policies (PII, GDPR, HIPAA)
- ⚠️ Content Moderation: Filter toxic, offensive, or inappropriate content
- 🎯 Custom Rules: Define custom patterns and business logic rules
Resources
Support
For issues or questions:
- GitHub Issues: Report an issue
- RailGuard Support: [email protected]
- n8n Community: n8n Forum
