17 comments

  • pedrozieg2 hours ago
    What I like about this approach is that it quietly reframes the problem from “detect AI” to “make abusive access patterns uneconomical”. A simple JS+cookie gate is basically saying: if you want to hammer my instance, you now have to spin up a headless browser and execute JS at scale. That’s cheap for humans, expensive for generic crawlers that are tuned for raw HTTP throughput.<p>The deeper issue is that git forges are pathological for naive crawlers: every commit&#x2F;file combo is a unique URL, so one medium repo explodes into Wikipedia-scale surface area if you just follow links blindly. A more robust pattern for small instances is to explicitly rate limit the expensive paths (&#x2F;raw, per-commit views, “download as zip”), and treat “AI” as an implementation detail. Good bots that behave like polite users will still work; the ones that try to BFS your entire history at line rate hit a wall long before they can take your box down.
    • nucleardog1 hour ago
      Yeah, this is where I landed a while ago. What problem am I _really_ trying to solve?<p>For some people it&#x27;s an ideological one--we don&#x27;t want AI vacuuming up all of our content. For those, &quot;is this an AI user?&quot; is a useful question to answer. However it&#x27;s a hard one.<p>For many the problem is simply &quot;there are a class of users that are putting way too much load on the system and it&#x27;s causing problems&quot;. Initially I was playing wack-a-mole with this and dealing with alerts firing on a regular basis because of Meta crawling our site very aggressively, not backing off when errors were returned, etc.<p>I looked at rate limiting but the work involved in distributed rate limiting versus the number of offenders involved made the effort look a little silly, so I moved towards a &quot;nuke it from orbit&quot; strategy:<p>Requests are bucketed by class C subnet (31.13.80.36 -&gt; 31.13.80.x) and request rate is tracked over 30 minute windows. If the request rate over that window exceeds a very generous threshold I&#x27;ve only seen a few very obvious and poorly behaved crawlers exceed it fires an alert.<p>The alert kicks off a flow where we look up the ASN covering every IP in that range, look up every range associated with those ASNs, and throw an alert in Slack with a big red &quot;Block&quot; button attached. When approved, the entire ASN is blocked at the edge.<p>It&#x27;s never triggered on anything we weren&#x27;t willing to block (e.g., a local consumer ISP). We&#x27;ve dropped a handful of foreign providers, some &quot;budget&quot; VPS providers, some more reputable cloud providers, and Facebook. It didn&#x27;t take long before the alerts stopped--both for high request rates and our application monitoring seeing excessive loads.<p>If anyone&#x27;s interested in trying to implement something similar, there&#x27;s a regularly updated database of ASN &lt;-&gt; IP ranges announced here: <a href="https:&#x2F;&#x2F;github.com&#x2F;ipverse&#x2F;asn-ip" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ipverse&#x2F;asn-ip</a>
      • embedding-shape40 minutes ago
        &gt; If anyone&#x27;s interested in trying to implement something similar, there&#x27;s a regularly updated database of ASN &lt;-&gt; IP ranges announced here: <a href="https:&#x2F;&#x2F;github.com&#x2F;ipverse&#x2F;asn-ip" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ipverse&#x2F;asn-ip</a><p>What exactly is the source of these mappings? Never heard about ipverse before, seems to be a semi-anonymous GitHub organization and their website has had a failing certificate for more than a year by now.
        • cmrx644 minutes ago
          whois (delegation files) according to the embedded blog post
      • sgc1 hour ago
        You ban the ASN permanently in this scenario?
    • pm21535 minutes ago
      I&#x27;m curious about whether there are well coded AI scrapers that have logic for &quot;aha, this is a git forge, git clone it instead of scraping, and git fetch on a rescrape&quot;. Why are there apparently so many naive (but still coded to be massively parallel and botnet like, which is not naive in that aspect) crawlers out there?
  • flexagoon31 minutes ago
    Oh hey, I wrote the &quot;you don&#x27;t need anubis&quot; post you (or the post author, if that&#x27;s not you) got inspiration from! Glad to hear it helped!
  • BLKNSLVR4 hours ago
    I really don&#x27;t know how effective my little system would be against these scrapers, but I&#x27;ve setup a system that blocks IP addresses if they&#x27;ve attempted to connect to ports on my system(s) behind which there are no services, and therefore their connections must be &#x27;uninvited&#x27;, which I classify as malicious.<p>Since I do actually host a couple of websites &#x2F; services behind port 443, it means I can&#x27;t just block everything that tries to scan my ip address at port 443. However, I&#x27;ve setup Cloudflare in front of those websites, so I do log and block any non-Cloudflare (using Cloudflare&#x27;s ASN: 13335) traffic coming into port 443.<p>I also log and block IP address attempting to connect on port 80, since that essentially deprecated.<p>This, of course, does not block traffic coming via the DNS names of the sites, since that will be routed through Cloudflare - but as someone mentioned, Cloudflare has its own anti-scraping tools. And then as another person mentioned, this does require the use of Cloudflare, which is a vast centralising force on the Internet and therefore part of a different problem...<p>I don&#x27;t currently split out a separate list for IP addresses that have connected to HTTP(S) ports, but maybe I&#x27;ll do that over Christmas.<p>This is my current simple project: <a href="https:&#x2F;&#x2F;github.com&#x2F;UninvitedActivity&#x2F;UninvitedActivity" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;UninvitedActivity&#x2F;UninvitedActivity</a><p>Apologies if the README is a bit rambling. It&#x27;s evolved over time, and it&#x27;s mostly for me anyway.<p>P.S. I always thought it was Yog Sothoth (not Sototh). Either way, I&#x27;m partial to Nyarlathotep. &quot;The Crawling Chaos&quot; always sounded like the coolest of the elder gods.
    • ewpratten4 hours ago
      Regarding the Cloudflare part of this, I’d recommend taking a look at “Authenticated Origin Pulls”. It lets you perform your validation at the TLS layer instead of doing it with IP ACLs if that interests you.
  • Simplita5 hours ago
    We ran into similar issues with aggressive crawling. What helped was rate limiting combined with making intent explicit at the entry point, instead of letting requests fan out blindly. It reduced both load and unexpected edge cases.
    • cheshire_cat5 hours ago
      What do you mean by &quot;making intent explicit at the entry point&quot;?
  • frogperson44 minutes ago
    I think it would be really cool if someone built a reverse proxy just for dealing with these bad actors.<p>I would really like to easily serve some markov chain non-sense to Ai bots.
    • jakewil29 minutes ago
      perhaps Iocaine [1] is what you&#x27;re looking for. See the demo page [2] for what it serves to AI crawlers.<p>1. <a href="https:&#x2F;&#x2F;iocaine.madhouse-project.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;iocaine.madhouse-project.org&#x2F;</a><p>2. <a href="https:&#x2F;&#x2F;poison.madhouse-project.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;poison.madhouse-project.org&#x2F;</a>
  • maelito6 hours ago
    I&#x27;m having lots of connections every day from Singapor. It&#x27;s now the main country... despite the whole website being French-only. AI crawlers, for sure.<p>Thanks for this tip.
    • arjie6 hours ago
      Amazonbot does this despite my efforts in robots.txt to help it out. I look at all the Singapore requests and they’re Amazonbot trying to get various variants of the Special:RecentChanges page. You’re wasting your time, Amazonbot. I’m trying to help you.
    • input_sh6 hours ago
      Fun fact: you don&#x27;t get rid of them even when you put a captcha on all visitors from Singapore. I still see a spike in traffic that perfectly matches the spike in served captchas, but this time it&#x27;s geographically distributed between places like Iraq, Bangladesh and Brazil.<p>Hopefully it at least costs them a little bit more.
      • reconnecting4 hours ago
        Usually, there are multiple layers of different counter-protection measures. If you block by country, they shift to different IP ranges, if you block by IP, they might use a new IP for every request, and escalate further depending on the bot owner and your actions.
  • andai6 hours ago
    Can someone help me understand where all this traffic is coming from? Are there thousands of companies all doing it simultaneously? How come even small sites get hammered constantly? At some point haven&#x27;t you scraped the whole thing?
    • marginalia_nu4 hours ago
      &gt; At some point haven&#x27;t you scraped the whole thing?<p>Git forges will expose a version of every file at every commit in the project&#x27;s history. If you have medium sized project consisting of say 1000 files and 10,000 commits, the crawler will identify a number of URLs on the same order of magnitude as English Wikipedia, just for that one project. This is also very expensive for the git forge, as it needs to reconstruct the historical files from a bunch of commits.<p>Git forges interact spectacularly poorly with naively implemented web crawlers, unless the crawlers put in logic to avoid exhaustively crawling git forges. You honestly get a pretty long way just excluding URLs with long base64-like path elements, which isn&#x27;t hard but it&#x27;s also not obvious.
    • input_sh5 hours ago
      &gt; How come even small sites get hammered constantly?<p>Because big sites have decades of experience fighting against scrapers and have recently upped their game significantly (even when doing so carries some SEO costs) so that they&#x27;re the only ones that can train AI on their own data.<p>So now, when you&#x27;re starting from scratch and your goal is to gather as much data as possible, targetting smaller sites with weak &#x2F; non-existent scraping protection is the path of least resistence.
      • andai2 hours ago
        No I meant like, if you have a blog with 10 posts.. do they just scrape the same 10 pages thousands of times?<p>Because people are reporting constant traffic, which would imply that the site is being scraped millions of times per year. How does that make any sense? Are there millions of AI companies?
        • marcthe121 hour ago
          Basically the scrappers do not bother to cache your website or if they do, with an insanely low ttl. Also they do not specialize the content. So the worst hit sites are something like git hosting due the bfs style scrape (every link). The worst part is alot of this is done via tunneling so ip can be different each time or from residential ops. Which makes it annoying.
    • bingo-bongo5 hours ago
      AI companies scrape to:<p>- have data to train on<p>- update the data more or less continuously<p>- answer queries from users on the fly<p>With a lot of AI companies, that generates a lot of scraping. Also, some of them behave terribly when scraping or is just bad at it.
      • adastra225 hours ago
        Why don’t they scrape once though?
        • blell5 hours ago
          1) It may be out of date 2) Storing it costs money
    • reppap5 hours ago
      It&#x27;s not just companies either, a lot of people run crawlers for their home lab projects too.
    • m0llusk3 hours ago
      It isn&#x27;t only companies, it is a mass social movement. Anyone with basic coding experience can download some basic learning apparatus and start feeding it material. The latest LLMs make it extremely easy to compose code that scrapes internet sites, so only the most minimal skills are required. Because everything is &quot;AI&quot; now aspiring young people are encouraged to do this in order to gain experience so they can get jobs and a careers in the new AI driven economy.
    • devsda5 hours ago
      May be the teams developing AI crawlers are dogfooding &amp; are using the AI itself(and its small context) to keep track of the sites that are already scraped. &#x2F;s
  • s_ting7653 hours ago
    I use the same exact trick from the source the article mentions.<p>I call it `temu` anubis. <a href="https:&#x2F;&#x2F;github.com&#x2F;rhee876527&#x2F;expert-octo-robot&#x2F;blob&#x2F;f28e48fc59b2a1b823551dfd1cb5ea6ea8bb7f88&#x2F;app-charts&#x2F;caddy-chart&#x2F;templates&#x2F;configmap.yaml#L19" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rhee876527&#x2F;expert-octo-robot&#x2F;blob&#x2F;f28e48f...</a><p>Jokes aside, the whole web seems to be trending towards some kind of wall (pay, login, app etc.) and this ultimately sucks for the open internet.
    • BLKNSLVR2 hours ago
      You missed the obvious portmanteau:<p>Temubis
  • petee3 hours ago
    You can also add a honeypot urls to your robots.txt to trap bots that are using it as an index
  • mintflow49 minutes ago
    recently I just noticed github trying(but failed) to charge the self host runners, I find a afternoon to setup a mini PC to install freeBSD and gitaea on it, then setup tailscale to let it only listen on the 100.64.x.x IP address.<p>Since I do not make this node public accessable, so no worry for AI web crawlers:)
  • userbinator7 hours ago
    <i>Unfortunately this means, my website could only be seen if you enable javascript in your browser.</i><p>Or have a web-proxy that matches on the pattern and extracts the cookie automatically. ;-)
  • reconnecting7 hours ago
    tirreno (1) guy here.<p>Our open-source system can block IP addresses based on rules triggered by specific behavior.<p>Can you elaborate on what exact type of crawlers you would like to block? Like, a leaky bucket of a certain number of requests per minute?<p>1. <a href="https:&#x2F;&#x2F;github.com&#x2F;tirrenotechnologies&#x2F;tirreno" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;tirrenotechnologies&#x2F;tirreno</a>
    • reconnecting6 hours ago
      I believe there is a slight misunderstanding regarding the role of &#x27;AI crawlers&#x27;.<p>Bad crawlers have been there since the very beginning. Some of them looking for known vulnerabilities, some scraping content for third-party services. Most of them have spoofed UAs to pretend to be legitimate bots.<p>This is approximately 30–50% of traffic on any website.
    • notachatbot1237 hours ago
      The article is about AI web crawlers. How can your tool help and how would one set it up for this specific context?
      • reconnecting7 hours ago
        I don&#x27;t see how an AI crawler is different from any others.<p>The simplest approach is to count the UA as risky or flag multiple 404 errors or HEAD requests, and block on that. Those are rules we already have out of the box.<p>It&#x27;s open source, there&#x27;s no pain in writing specific rules for rate limiting, thus my question.<p>Plus, we have developed a dashboard for manually choosing UA blocks based on name, but we&#x27;re still not sure if this is something that would be really helpful for website operators.
        • Roark666 hours ago
          &gt;It&#x27;s open source, there&#x27;s no pain in writing specific rules for rate limiting, thus my question.<p>Depends on the goal.<p>Author wants his instance not to get killed. Request rate limiting may achieve that easily in a way transparent to normal users.
  • KronisLV5 hours ago
    We should just have some standard for crawlable archived versions of pages with no back end or DB interaction behind them etc., for example if there&#x27;s a reverse proxy, whatever it outputs is archived and it wouldn&#x27;t actually pass on any call in the archive version. Same for translating the output of any dynamic JS into fully static HTML. Then add some proof-of-work that works without JS and is a web standard (e.g. server sends header, client sends correct response, gets access to archive) and mainstream the culture for low-cost hosting for such archives and you&#x27;re done, also make sure that this sort of feature is enabled in the most basic configuration for all web servers and such, logged separately.<p>Obviously such a thing will never happen, because the web and culture went in a different direction. But if it were a mainstream thing, you&#x27;d get easy to consume archives (also for regular archival and data hoarding) and the &quot;live&quot; versions of sites wouldn&#x27;t have their logs be bogged down by stupid spam.<p>Or if PoW was a proper web standard with no JS, then ppl who want to tell AI and other crawlers to fuck off, they could at least make it uneconomical to crawl their stuff en masse. In my view, proof of work that would work through headers in the current day world should be as ubiquitous as TLS.
  • apples_oranges7 hours ago
    HTTP 412 would be better I guess..
    • jsheard4 hours ago
      You shouldn&#x27;t really serve aggressive scrapers any kind of error or otherwise unusual response, because they&#x27;ll just take that as a signal to try again with a different IP address or user agent, or a residential proxy, or a headless browser, or whatever else. There&#x27;s no obligation to be polite to rude guests, give them a 200 OK containing the output of a Markov chain trained on the Bee Movie script instead.
      • loloquwowndueo13 minutes ago
        Unless your output is static, you’d then be paying the cost of running the markov generator.
  • immibis1 day ago
    My issue with Gitea (which Forgejo is a fork of) was that crawlers would hit the &quot;download repository as zip&quot; link over and over. Each access creates a new zip file on disk which is never cleaned up. I disabled that (by setting the temporary zip directory to read-only, so the feature won&#x27;t work) and haven&#x27;t had a problem since then.<p>It&#x27;s easy to assume &quot;I received a lot of requests, therefore the problem is too many requests&quot; but you can successfully handle many requests.<p>This is a clever way of doing a minimally invasive botwall though - I like it.
    • userbinator7 hours ago
      <i>Each access creates a new zip file on disk which is never cleaned up.</i><p>That sounds like a bug.
      • isodev3 hours ago
        I think that’s been fixed in Forgejo a long time ago
    • bob10297 hours ago
      &gt; you can successfully handle many requests.<p>There is a point where your web server becomes fast enough that the scraping problem becomes irrelevant. Especially at the scale of a self-hosted forge with a constrained audience. I find this to be a much easier path.<p>I wish we could find a way to not conflate the intellectual property concerns with the technological performance concerns. It seems like this is essential to keeping the AI scraping drama going in many ways. We can definitely make the self hosted git forge so fast that anything short of ~a federal crime would have no meaningful effect.
      • idontsee7 hours ago
        &gt; There is a point where your web server becomes fast enough that the scraping problem becomes irrelevant.<p>It isn&#x27;t just the volume of requests, but also bandwidth. There have been cases where scraping represents &gt;80% of a forge&#x27;s bandwidth usage. I wouldn&#x27;t want that to happen to the one I host at home.
      • spockz7 hours ago
        Maybe it is fast enough but my objection is mostly due to the gross inefficiency of crawlers. Requesting downloads of whole repositories over and over, leading to storing these archives on disk wasting CPU cycles to create them and storage space to retain them, and bandwidth to sent them over the wire. Add this to the gross power consumption of AI and hogging of physical compute hardware, and it is easy to see “AI” as wasteful.
  • Roark665 hours ago
    I&#x27;m glad the author clarified he wants to prevent his instance from crashing not simply &quot;block robots and allow humans&quot;.<p>I think the idea that you can block bots and allow humans is fallacious.<p>We should focus on a specific behaviour that causes problems (like making a bajillion requests one for each commit, instead of cloning the repo). To fix this we should block clients that work in such ways. If these bots learn to request at a reasonable pace why cares if they are bots, humans, bots under a control of an individual human, bots owned by a huge company scraping for training data? Once you make your code (or anything else) public, then trying to limit access to only a certain class of consumers is a waste of effort.<p>Also, perhaps I&#x27;m biased, because I run a searXNG and Crawl4AI (and few ancillaries like jina rerank etc) in my homelab so I can tell my AI to perform live internet searches as well as it can get any website. For code it has a way to clone stuff, but for things like issues, discussions, PRs it goes mostly to GitHub.<p>I like that my AI can browse almost like me. I think this is the future way to consume a lot of the web (except sites like this one that are an actual pleasure to use).<p>The models sometimes hit sites they can&#x27;t fetch. For this I use Firecrawl. I use MCP proxy that lets me rewrite the tool descriptions so my models get access to both my local Crawl4ai and hosted (and rather expensive)firecrawl, but they are told to use Firecrawl as last resort.<p>The more people use these kinds of solutions the more incentive there will be for sites not to block users that use automation. Of course they will have to rely on alternative monetisation methods, but I think eventually these stupid capchas will disappear and reasonable rate limiting will prevail.
    • popcornricecake3 hours ago
      &gt; I think this is the future way to consume a lot of the web<p>I think I see many prompt injections in your future. Like captchas with a special bypass solution just for AIs that leads to special content.
    • asfdasfsd5 hours ago
      And people who block AI crawlers on moral grounds?
    • szundi5 hours ago
      [dead]
  • csilker7 hours ago
    Cloudflare has a solution to protect routes from crawlers.<p><a href="https:&#x2F;&#x2F;blog.cloudflare.com&#x2F;introducing-pay-per-crawl&#x2F;" rel="nofollow">https:&#x2F;&#x2F;blog.cloudflare.com&#x2F;introducing-pay-per-crawl&#x2F;</a>
    • roywashere6 hours ago
      Sure, but the whole point of self-hosting forgejo is to not use these big cloud solutions. Introducing cloudflare is a step back!
      • csilker4 hours ago
        The way is same with cloudflare. Cloudflare has a documentation and manifest.
        • 63stack3 hours ago
          I&#x27;m so fascinated by replies like this, it&#x27;s too random and nonsensical to be a language barrier issue, but it also does not pattern match into LLM generated text. Reminds me of ~2010 era wordpress comment spam.