hn.today

AI Ban Hammer

yunzi.co.uk6 points0 comments
Screenshot of AI Ban Hammer

The writer describes a lightweight way to deter AI crawlers that disregard robots.txt, motivated by frustration that some companies - including ChatGPT, which the writer says was caught - ignore explicit requests not to crawl. An initial PHP honeypot recorded the IP addresses of bots entering a forbidden directory and blocked them through .htaccess, returning HTTP 402, “Payment Required.” After testing it for about a day, the writer abandoned that setup over concerns about PHP security, denial-of-service risks, and an ever-growing block file. Instead, the writer adapted an Apache configuration that logs the IP addresses of visitors to a robots.txt-disallowed directory, then uses the log as a RewriteMap to block later requests from those addresses. The response can be 403 or 402, with a custom message.

The trap works by hiding a link to the forbidden directory in a page, using CSS to make it invisible to human visitors. Logs show several apparent AI crawlers entering it, usually while disguising themselves as ordinary browsers rather than identifying as bots; only one used a Python crawling-library user agent. Other captured addresses made isolated requests, suggesting links may be passed between systems or requests sent from changing IPs. The writer emphasizes that this is a modest obstacle, not a comprehensive solution, and that robots.txt is only a convention. A genuinely human-only internet seems impractical: even identity checks based on trusted human keys could be undermined by a single bot using a valid key, while human verification would risk requiring social gatekeeping.

Read on yunzi.co.uk0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Web

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.