--- author: email: mail@petermolnar.net image: https://petermolnar.net/favicon.jpg name: Peter Molnar url: https://petermolnar.net copies: [] lang: en published: '2025-04-15T09:00:00+01:00' summary: A quick guide on combining an anti-AI tarpit with automatic blocking title: How to block and confuse AI crawlers with nepenthes and fail2ban --- GenAI is a disgusting, festering thing that keeps getting worse by the day. And night. And minute. They relentlessly ignore rules, copyright, established practices and standards[^1] - and that's just the technical perspective, let alone the morally implicating ones[^2]. People came up with proof-of-work JS solutions to block the attacks off[^3], and while it's the proper solution against the issue, I wanted something different. A little while ago I came across with AI "poisoning" tarpits[^4]. While it's a wonderful idea, it turned out that there are many, many, MANY bots that would gladly get lost 5-6 levels deep in the link maze it generates, happily heating my meager server CPU (I use a passively cooled thin client as my server), so I decided to add a fail2ban blocking on top. I do have to note that if you run a web **application** that is JS dependent anyway, you're probably best off setting up Anubis. This solution is more fitting for websites that don't need or use JS. There's a promised no-JS version of Anubis, but it's not there yet. **1: add a rule to your robots.txt to disallow any visits to a certain path url on your site** User-agent: * Disallow: /ohwowyoushouldntbehere **2: add an invisible url pointing to the disallowed path on your site, ideally on every page** ``` html ``` **3: set up Nepenthes[^5] on the disallowed path** `templates/toplevel.lustache`
You shouldn't be on this page. Please leave.
{{ content }}
{{/ content }}