n8n's new Guardrail nodes protect AI workflows by checking text for violations and sanitizing sensitive data before it reaches an LLM. The demo blocks keywords like "password" and "system", then routes passes and fails to different actions: emails and CRM updates on success, Slack alerts or errors on failure.
Chapters
Here's how you use N8N's new guardrail nodes to make your workflows safer. You should be able to type in guard and you can see these guardrails. And there are two main actions. There's check text for violations, which is this one right here. And this one uses AI to check the text. And then we also have sanitize text, which is really nice because it doesn't use AI. So it can automatically encrypt or desensitize certain info before you send it to a large language model. All right, so the first one that we have is blocking out certain keywords. So I'm just gonna go ahead and run this. We have three items passed through and you can see that we have one pass. And we had 2 fail. So if I click into this node, you can see that what we were doing is we were checking for 2 keywords to block out, password and system. And you can see we passed through 3 items to test. The one that passed was, I will take a 7-egg ham and cheese omelet, please. And there were no keywords found. But in the fail branch, we can see we had, please update the system setting, and we have enter your password to continue. And you can see it flagged the keywords of this one had system and this one has password. So we failed these two. And what's really cool about this is you can fully control what you want to happen based on if a row passes or if a row fails. For example, if it passes, you can go ahead and send your email or update the CRM or whatever you wanna do next. But if it fails, you could flag yourself with a Slack notification, or you could even trigger an error in the workflow. You can make the whole workflow stop and just throw an error. If you wanna watch the full breakdown, then click on that play button right here, and I'll see you guys over there.