Skip to main content

Block prompt injection before AI agents with GPT-5.5, Slack, and Google Sheets

Workflow preview

Workflow preview
100%
Block prompt injection before AI agents with GPT-5.5, Slack, and Google Sheets preview
Open on n8n.io

1. Workflow Overview

This template is for AI builders, SecOps teams, and automation teams that expose agents, chatbots, or webhook workflows to untrusted user input. It helps reduce the risk of prompt injection, system...

Best for

  • SecOps automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.webhook, n8n-nodes-base.code, n8n-nodes-base.switch, n8n-nodes-base.googlesheets, n8n-nodes-base.slack, n8n-nodes-base.respondtowebhook, n8n-nodes-base.stickynote, @n8n/n8n-nodes-langchain.openai

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Țugui Dragoș.

Original n8n.io source

1.1 Workflow description

Title
Block prompt injection before AI agents with GPT-5.5, Slack, and Google Sheets
Workflow name
Block prompt injection before AI agents with GPT-5.5, Slack, and Google Sheets

This template is for AI builders, SecOps teams, and automation teams that expose agents, chatbots, or webhook workflows to untrusted user input. It helps reduce the risk of prompt injection, system prompt extraction, social engineering, and malicious content reaching downstream AI workflows.

How it works

The workflow receives text through a webhook and runs a zero-trust screening process before the input reaches a business agent. A Code node checks for deterministic attack patterns such as instruction overrides, role hijacking, prompt leakage attempts, hidden Unicode, SQL-style payloads, and XSS-style content. A second layer extracts URLs and applies local suspicious-domain heuristics. An isolated GPT-5.5 evaluator then classifies semantic risk, including prompt injection, data exfiltration intent, and social engineering. A scoring node combines the signals and routes low-risk input to a safe response while suspicious input is blocked, logged, and sent to Slack.

How to set up

Connect OpenAI, Slack, and Google Sheets credentials. Send untrusted input to the /firewall-check webhook before your main AI agent workflow.

Requirements

OpenAI access to GPT-5.5, Slack credentials, Google Sheets, and a webhook caller.

How to customize the workflow

Add your own attack patterns, tune risk thresholds, connect URLScan, VirusTotal, or Safe Browsing, and forward safe traffic to your production agent.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Receive External Input

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2.1

Block 2 - Heuristic Pattern Filter

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 3 - Extract URLs for Scanning

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 4 - Scan URLs via API

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 5 - Calculate Risk Score

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 6 - Risk Level Router

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.4

Block 7 - Log Attack Attempt

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 8 - Slack SOC Alert

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.4

Block 9 - Respond Blocked

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.5

Block 10 - Respond Safe

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.5

Block 11 - Level 1 Heuristic

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Level 2 and 3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - Risk Routing

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - LLM Defensive Evaluator

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 2.3

Block 15 - Note - response

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Firewall Overview

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Block prompt injection before AI agents with GPT-5.5, Slack, and Google Sheets
Complexity advanced
Nodes 16
Categories SecOps, AI Summarization
Author Țugui Dragoș
Published 17 May 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15774/15774.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Block prompt injection before AI agents with GPT-5.5, Slack, and Google Sheets do?

This template is for AI builders, SecOps teams, and automation teams that expose agents, chatbots, or webhook workflows to untrusted user input. It helps reduce the risk of prompt injection, system...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your SecOps, AI Summarization use case.