Skip to main content

Complete AI safety suite: test 9 guardrail layers with Groq LLM

Workflow preview

Workflow preview
100%
Complete AI safety suite: test 9 guardrail layers with Groq LLM preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Who's It For AI developers, automation engineers, and teams building chatbots, AI agents, or workflows that process user input. Perfect for those concerned about security, compliance, and content s...

Best for

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

Tools used

n8n-nodes-base.manualtrigger, n8n-nodes-base.set, n8n-nodes-base.splitout, @n8n/n8n-nodes-langchain.guardrails, @n8n/n8n-nodes-langchain.lmchatgroq, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Muhammad Shaheer Awan.

Original n8n.io source

1.1 Workflow description

Title
Complete AI safety suite: test 9 guardrail layers with Groq LLM
Workflow name
Complete AI safety suite: test 9 guardrail layers with Groq LLM

Who's It For

AI developers, automation engineers, and teams building chatbots, AI agents, or workflows that process user input. Perfect for those concerned about security, compliance, and content safety.

What It Does

This workflow demonstrates all 9 guardrail types available in n8n's Guardrails node through real-world test cases. It provides a comprehensive safety testing suite that validates:

  • Keyword blocking for profanity and banned terms
  • Jailbreak detection to prevent prompt injection attacks
  • NSFW content filtering for inappropriate material
  • PII detection and sanitization for emails, phone numbers, and credit cards
  • Secret key detection to catch leaked API keys and tokens
  • Topical alignment to keep conversations on-topic
  • URL whitelisting to block malicious domains
  • Credential URL blocking to prevent URLs with embedded passwords
  • Custom regex patterns for organization-specific rules (employee IDs, order numbers)
  • Each test case flows through its corresponding guardrail node, with results formatted into clear pass/fail reports showing violations and sanitized text.

How to Set Up

  • Add your Groq API credentials (free tier works fine)
  • Import the workflow
  • Click "Test workflow" to run all 9 cases
  • Review the formatted results to understand each guardrail's behavior

Requirements

  • n8n version 1.119.1 or later (for Guardrails node)
  • Groq API account (free tier sufficient)
  • Self-hosted instance (some guardrails use LLM-based detection)

How to Customize

  • Modify test cases in the "Test Cases Data" node to match your specific scenarios
  • Adjust threshold values (0.0-1.0) for AI-based guardrails to fine-tune sensitivity
  • Add or remove guardrails based on your security requirements
  • Integrate individual guardrail nodes into your production workflows
  • Use the sticky notes as reference documentation for implementation

This is a plug-and-play educational template that serves as both a testing suite and implementation reference for building production-ready AI safety layers.

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 - Start - Manual Trigger

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

Block 2 - Test Cases Data

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

Block 3 - Split Test Cases

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

Block 4 - Format Data

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

Block 5 - Case 1 - Keyword Blocking

Type / Role
@n8n/n8n-nodes-langchain.guardrails - guardrails
Config choices
Version 1

Block 6 - Case 2 - Jailbreak Detection

Type / Role
@n8n/n8n-nodes-langchain.guardrails - guardrails
Config choices
Version 1

Block 7 - Case 3 - NSFW Content

Type / Role
@n8n/n8n-nodes-langchain.guardrails - guardrails
Config choices
Version 1

Block 8 - Case 4 - PII Detection (Sanitize)

Type / Role
@n8n/n8n-nodes-langchain.guardrails - guardrails
Config choices
Version 1

Block 9 - Case 5 - Secret Key Detection

Type / Role
@n8n/n8n-nodes-langchain.guardrails - guardrails
Config choices
Version 1

Block 10 - Case 6 - Topical Alignment

Type / Role
@n8n/n8n-nodes-langchain.guardrails - guardrails
Config choices
Version 1

Block 11 - Case 7 - URL Whitelisting

Type / Role
@n8n/n8n-nodes-langchain.guardrails - guardrails
Config choices
Version 1

Block 12 - Case 8 - Block URLs with Credentials

Type / Role
@n8n/n8n-nodes-langchain.guardrails - guardrails
Config choices
Version 1

Block 13 - Case 9 - Custom Regex

Type / Role
@n8n/n8n-nodes-langchain.guardrails - guardrails
Config choices
Version 1

Block 14 - Format Results

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

Block 15 - Groq Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatGroq - lmChatGroq
Config choices
Version 1

Block 16 - Sticky Note

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

Block 17 - Sticky Note1

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

Block 18 - Sticky Note2

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

Block 19 - Sticky Note6

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

3. Summary Table

Workflow Complete AI safety suite: test 9 guardrail layers with Groq LLM
Complexity advanced
Nodes 19
Categories Engineering, AI Summarization
Author Muhammad Shaheer Awan
Published 22 Nov 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/11141/11141.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 Complete AI safety suite: test 9 guardrail layers with Groq LLM do?

Who's It For AI developers, automation engineers, and teams building chatbots, AI agents, or workflows that process user input. Perfect for those concerned about security, compliance, and content s...

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 Engineering, AI Summarization use case.