Prevent prompt injection attacks with a GPT-4O security defense system
Ready for 3.0What this workflow does
This AI workflow has 19 nodes and runs when an HTTP POST request hits its webhook URL. Along the way it connects OpenAI.
How it runs
Trigger: When an HTTP POST request hits its webhook URL.
- Extract Data (Edit Fields (Set)): sets 1 field: data
- Text violations (OpenAI): classify
- Merge: merges the data from its input branches
- Validate trueCategories (Code): runs custom JavaScript code
- Input Validation & Pattern Detection (OpenAI): uses OpenAI
- Check Success (If): checks a condition and branches into true / false
- Is REJECTED? (If): checks a condition and branches into true / false
- Respond to Webhook: sends the response back to the webhook caller
- Report Rejection (Edit Fields (Set)): sets 5 fields: message.input.threat.assessment, message.input.threat.classification, message.input.validation.flags…
- Content Sanitization & Neutralization (OpenAI): uses OpenAI
…plus 8 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (9)
- Webhook
n8n-nodes-base.webhook - Edit Fields (Set)
n8n-nodes-base.set - OpenAI
@n8n/n8n-nodes-langchain.openAi - Respond to Webhook
n8n-nodes-base.respondToWebhook - Merge
n8n-nodes-base.merge - If
n8n-nodes-base.if - Code
n8n-nodes-base.code - Switch
n8n-nodes-base.switch - Send Email
n8n-nodes-base.emailSend
From the author
AI Security Pipeline - Prompt Injection Defense System using GPT-4O Protect your AI workflows from prompt injection attacks, XSS attempts, and malicious content with this multi-layer security sanitization system. > Important: The n8n workflow template…