Templates / Benchmark content safety guardrails with automated test suite & reports

Benchmark content safety guardrails with automated test suite & reports

Ready for 3.0

by Patrick Siewert ✓ · 769 views · created 2025-11-11 · Engineering, AI Summarization

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

Nodes used (8)

OpenAI Chat ModelGuardrailsGmail

What it does

🛡️ Evaluate Guardrails Node Accuracy with Automated Test Suite This workflow benchmarks the n8n Guardrails node across multiple safety categories -including PII, NSFW, jailbreak attempts, secret keys, and unsafe URLs. It runs 36 structured test cases, classifies each as PASS or VIOLATION, calculates accuracy metrics, and emails a detailed HTML report. 🔄 How it works 1. The workflow loops through 36 predefined test prompts. 2. Each prompt is checked by the Guardrails node for violations. 3. Results are recorded as PASS or VIOLATION. 4. The system calculates metrics (accuracy, precision, recall, F1). 5. A formatted Markdown → HTML report is generated and sent via Gmail. ⚙️ Set up steps 1. Add your OpenAI and Gmail credentials in n8n. 2. Replace YOURMAILHERE in the Gmail node with your own address. 3. (Optional) Change the model in the OpenAI Chat Model node. - Default: gpt-4o-mini - You can switch to gpt-5 or another available model if needed. 4. Click Execute Workflow: test cases will run automatically. 5. Check your inbox for the results. 🧠 Who it’s for - AI safety testers and workflow developers - n8n users experimenting with the Guardrails node - Teams validating LLM moderation, filtering, or compliance setups 🧩 Requirements - n8n v1.119+ - Guardrails node enabled - OpenAI credentials (optional but recommended) - Email integration (Gmail or SendGrid) 💡 Why it’s useful Use this test suite to understand how accurately the Guardrails node identifies unsafe content across different categories. The generated metrics help you fine-tune thresholds, compare models, and strengthen AI moderation workflows. Example result !image.png(fileId:3279) !image.png(fileId:3280) > Browse similar workflows: > AI Enrichment & safety templates > Monitoring & benchmarking templates

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.