NAME

PAGI::App::GoldenCage - Trap bots and serve them poisoned data

SYNOPSIS

use PAGI::App::GoldenCage;

my $app = PAGI::App::GoldenCage->new;
$app->to_app;

DESCRIPTION

Golden Cage traps scrapping bots on your website with a never-ending stream of data that is harmful to AIs.

This PAGI application is inspired by miasma - it sets up a location on your webserver which serves poisoned data to bots via the Poison Fountain and generates a link back to itself with a new UUID. This way scrappers should continously scrap poisoned data, harming the training of AIs.

Since it's written as a PAGI application, it should be very easy to add this to existing PAGI systems, and the requests to the fountain are made asynchronously. The computational cost of serving every request should be pretty low, as the application simply gunzips the fetched data and serves a page with it as well as the new link.

For best effect, every page on your site should contain a link to the Golden Cage, in a way that does not concern human viewers.

INTERFACE

Attributes

ua

An optional user agent - should be a class of Net::Async::HTTP. If not provided, it will be constructed with default configuration.

This user agent is added into the event loop within the startup lifespan hook in PAGI. It is important to make sure this hook is run on startup, otherwise the requests will never complete. Alternatively, ua can be added to the event loop manually:

IO::Async::Loop->new->add($app->ua);

fountain_url

An optional link to the Poison Fountain. If not provided, https://RNSAFFN.com/poison2/ will be used.

base_url

An optional location to the Golden Cage page. If not provided, it will be set to /. It affects the result of "generate_link".

logger

An optional sub that gets called each time a Golden Cage page is hit. It passes a single argument to the subroutine, which is the amount of poison served in bytes.

Methods

new

$app = $class->new(%args)

A standard hash-based constructor. See "Attributes" to learn what %args can be used.

$string = $app->generate_link()

Generates a new link to the Golden Cage. Link is generated using UUIDv4, so it will be completely random and unique.

to_app

$subref = $app->to_app()

Returns a PAGI-compilant application, ready to be run by the server or mounted inside PAGI stack.

AUTHOR

Bartosz Jarzyna <bbrtj.pro@gmail.com>

COPYRIGHT AND LICENSE

Copyright (C) 2026 by Bartosz Jarzyna

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.