Local deterministic crawler tarpit and RFC 9309 robots.txt honeypot for WordPress, with hybrid HTTP 429/403 quarantine, HMAC-chained audit logging, and privacy-preserving daily IP digests.
| Field | Value |
|---|---|
| Author | Arnold Wender |
| Repository | github.com/arnoldwender/crawler-labyrinth |
| Companion Astro Package | arnoldwender/astro-crawler-labyrinth |
| Companion JS Core (npm) | arnoldwender/crawler-labyrinth-js |
| Stack & Requirements | WordPress 6.4+ · PHP 8.2+ · Pure PHP (no external proxy calls) |
| License | GPLv2 or later |
| Built with an agentic workflow | Developed with AI coding agents. Review and test it like any third-party code before you use it in production. |
| Support & Liability | Zero support — reproducible bugs on GitHub Issues only · no private support · AS IS / no liability (SUPPORT.md) |
| Local Verification | php tests/test-suite.php && php tests/test-css-tokens.php && bash tests/run-mutations.sh |
Many crawler-tarpit snippets work by fetching and relaying third-party HTML from an external server on every crawler hit. In production WordPress hosting, relaying external pages carries real operational risks:
- Worker Exhaustion: Holding PHP-FPM workers open on blocking outbound HTTP requests allows slow crawlers to saturate site capacity before they saturate their own.
- Untrusted Markup Exposure: Relaying unverified external HTML creates XSS and supply-chain liability under your own origin.
- Zero Outbound Dependencies:
DecoyGeneratorsynthesizes bounded archival HTML5 or plain-text folios locally in sub-millisecond PHP execution using HMAC-SHA256 — zero outbound HTTP calls, zero CDN scripts, and zero third-party data transfers.
- RFC 9309 Multi-Group
robots.txtInjection (RobotsInjector): InjectsDisallow: /<prefix>/into everyUser-agent:group (not onlyUser-agent: *), preventing explicitAllow: /blocks for search or citation crawlers from shadowing the disallow rule. - Accessible-Inert Footer Bait (
BaitRenderer): Prints<div hidden inert aria-hidden="true" data-crawler-labyrinth="1">with signed depth-1 links (rel="nofollow noopener",tabindex="-1",aria-hidden="true") inwp_footeron unauthenticated public frontend responses only. Screen readers and keyboard tab order skip it automatically; logged-in users, feeds, previews, AJAX, and REST requests are excluded. - Bounded Labyrinth, Dry-Run & Hybrid Quarantine (
TrapRouter):hybrid(default): Serves deterministic archival decoys (200 OKwithX-Robots-Tag: noindex, nofollow, noarchive, nosnippet, noai, noimageaiandX-Crawler-Labyrinth: decoy) up tocrawler_labyrinth_strike_thresholdhits (default5), then quarantines the client IP digest with HTTP429 Too Many Requests(includingRetry-After) or403 Forbidden(X-Crawler-Labyrinth: quarantined) forcrawler_labyrinth_block_ttl_minutes.labyrinth: Continues serving ring-bounded archival decoys indefinitely without quarantining.block: Immediately quarantines on the first disallowed hit.observe: Dry-run audit mode — serves decoys and logs'observed'rows (X-Crawler-Labyrinth: observed) withentry_vectormetadata without quarantining.- Pre-Query Interception & Burst Shedding: Runs on
init(priority1, skippingis_admin()) beforeWP_Query, and sheds flood spikes exceedingcrawler_labyrinth_burst_limitper 60-second UTC window with HTTP429(X-Crawler-Labyrinth: burst-shed,Retry-After: 60) without writing per-IP transients or MySQL rows.
- Search & Citation Crawler Protection: Optional User-Agent enforcement (
crawler_labyrinth_intercept_training_ua, disabled by default) explicitly exempts search, citation, and link-preview bots (Googlebot,Bingbot,Applebot,OAI-SearchBot,ChatGPT-User,Claude-SearchBot,Claude-User,PerplexityBot,Perplexity-User,MistralAI-User,Slackbot,Storebot-Google,DuckDuckBot) before evaluating training scraper tokens (GPTBot,CCBot,ClaudeBot,anthropic-ai,Bytespider,PetalBot,Diffbot,Omgilibot,ImagesiftBot,DataForSeoBot,Scrapy). - Tamper-Evident Audit Chain & Pseudonymizing Retention (
HitLogger): Records hits in{prefix}crawler_labyrinth_hitsusing daily rotating keyed HMAC-SHA256 IP digests (raw IP addresses are never stored). Each row links to the previousrow_hash(prev_hash). A daily WP-Cron job (crawler_labyrinth_daily_purge) redacts expireduser_agent_excerptvalues across batches, removes expired transients, and appends an advisory-locked (GET_LOCK)retention_pseudonymizedresidual hash record so keyset-paginated chain integrity (verify_chain()) remains verifiable. - Standalone Admin UI: Ships a self-contained, token-based stylesheet (
assets/css/crawler-labyrinth-admin.css) with zero external dependencies and a WordPress Dashboard telemetry widget.
- Copy or install the
crawler-labyrinthdirectory intowp-content/plugins/crawler-labyrinth/. - Activate Crawler Labyrinth in Plugins → Installed Plugins or via WP-CLI:
wp plugin activate crawler-labyrinth
- Open Crawler Labyrinth in the WordPress Admin menu to inspect telemetry, test previews, or customize trap limits.
Page Cache & Reverse Proxy Note: If you use Varnish, Nginx FastCGI cache, or a full-page cache plugin, exclude your trap prefix (default
/crawler-trap/*) from caching so PHP can count per-client strikes and emit429/403quarantine headers dynamically. See docs/DEVELOPER-GUIDE.md for examples.
Live Telemetry & Audit view displaying HONEYPOT STATUS (Active, /crawler-trap/), DECOY PAGES SERVED, QUARANTINED REQUESTS, UNIQUE IP DIGESTS, the HYBRID and HMAC CHAIN VALID badges, Recent Crawler Trap Activity, retention controls, and Data Lifecycle & Uninstall.
Trap Settings tab configuring Activation & Routing (including the opt-in AI training scraper toggle sparing search and citation bots, plus Trap Route Prefix) and Defense Mode & Quarantine Limits.
Decoy & robots.txt Preview tab inspecting a live Sample Synthetic Archival Entry and the RFC 9309 robots.txt Group Injection Preview.
| Option Name | Default | Allowed Range / Values | Purpose |
|---|---|---|---|
crawler_labyrinth_enabled |
'1' |
'1' | '0' |
Global enable/pause switch |
crawler_labyrinth_route_prefix |
'crawler-trap' |
3-32 chars [a-z0-9-] |
Trap URL path segment (reserved WP paths blocked) |
crawler_labyrinth_mode |
'hybrid' |
'hybrid' | 'labyrinth' | 'block' | 'observe' |
Decoy, block, dry-run observe, or escalating strike mode |
crawler_labyrinth_response_format |
'html' |
'html' | 'plain' |
Archival HTML5 or plain-text response format |
crawler_labyrinth_link_count |
1 |
1..5 |
Hidden depth-1 bait links rendered in wp_footer |
crawler_labyrinth_max_depth |
8 |
1..16 |
Maximum traversal depth before wrapping back to depth 1 |
crawler_labyrinth_strike_threshold |
5 |
1..100 |
Decoy responses served before quarantine in hybrid mode |
crawler_labyrinth_block_ttl_minutes |
360 |
5..10080 |
Quarantine transient duration in minutes |
crawler_labyrinth_block_status |
429 |
429 | 403 |
HTTP status code emitted while quarantined |
crawler_labyrinth_update_robots |
'1' |
'1' | '0' |
Inject Disallow: /<prefix>/ into robots_txt groups |
crawler_labyrinth_intercept_training_ua |
'0' |
'1' | '0' |
Opt-in interception of training scraper User-Agents |
crawler_labyrinth_retention_days |
30 |
0..365 |
Days before user_agent_excerpt is redacted (0 keeps) |
crawler_labyrinth_burst_limit |
120 |
0 (off) or 5..10000 |
Global trap hits per 60 s UTC bucket before 429 burst shedding |
crawler_labyrinth_delete_data_on_uninstall |
'0' |
'1' | '0' |
Opt-in removal of options, transients, and audit table on uninstall |
crawler_labyrinth_hmac_secret |
Auto-generated | 64-char hex | Persistent 256-bit key for tokens, digests, and hash chain |
crawler_labyrinth_schema_version |
'1.0.0' |
SemVer string | Internal database schema version marker |
crawler_labyrinth_active_quarantine_max |
0 |
Unix timestamp | High-water mark skipping multi-day quarantine lookback when no bans are active |
wp crawler-labyrinth status
wp crawler-labyrinth preview --depth=2 --seed=archpreview1 --format=plain
wp crawler-labyrinth verify_chain
wp crawler-labyrinth purge_expired --dry-runAll endpoints require an authenticated administrator (current_user_can( 'manage_options' )):
GET /wp-json/crawler-labyrinth/v1/status— Normalized configuration and hit summary counters.POST /wp-json/crawler-labyrinth/v1/preview— Deterministic decoy preview (depth,seed,format).POST /wp-json/crawler-labyrinth/v1/verify-chain— Runs full HMAC chain verification (200if valid,409on mismatch).
| Hook | Type | Parameters | Purpose |
|---|---|---|---|
crawler_labyrinth_ready |
Action | Plugin $instance |
Fires after plugin bootstrap completes |
crawler_labyrinth_trap_triggered |
Action | string $action, string $token, int $strikes, string $ip_digest |
Fires when a decoy is served or a client enters quarantine |
crawler_labyrinth_bait_html |
Filter | string $html, string $prefix, int $count |
Customize footer bait HTML prior to wp_kses() |
crawler_labyrinth_client_ip |
Filter | string $raw_ip |
Resolve real client IP behind trusted reverse proxies |
crawler_labyrinth_allowed_bots |
Filter | list<string> $tokens |
Extend search/citation crawler User-Agent exemptions |
crawler_labyrinth_training_bots |
Filter | list<string> $tokens |
Extend training scraper User-Agent list for opt-in guard |
crawler_labyrinth_decoy_pools |
Filter | array $pools |
Customize collections, subjects, actions, and appendices phrase pools |
Detailed developer documentation lives in docs/ARCHITECTURE.md and docs/DEVELOPER-GUIDE.md.
php tests/test-suite.php
php tests/test-css-tokens.php
bash tests/run-mutations.sh
php tests/test-pot-freshness.php
python3 .github/scripts/security-audit.pyWhen testing inside an active WordPress installation:
wp eval-file wp-content/plugins/crawler-labyrinth/tests/test-runtime.php --allow-root --user=1Zero Support & Use at Your Own Risk: See SUPPORT.md.
- Zero support: This plugin is published as-is with zero technical, setup, configuration, or user support, and zero response SLA.
- GitHub Issues only: Reproducible software defects must be reported exclusively via GitHub Issues (or GitHub Security Advisories for security vulnerabilities). Opening an issue carries no guarantee of a reply or fix.
- No private support: Do not send private support requests via email,
arnoldwender.com, or direct messages. Private inquiries are never answered. - Zero responsibility & no warranty ("AS IS"): Under Sections 11 and 12 of the GNU General Public License v2 or later, this software is provided "AS IS" without warranty of any kind, and the author accepts zero responsibility or liability for any damages, downtime, data loss, false positives, caching/proxy misbehavior, or search/crawler indexing effects arising from its use.
- Support Policy: See SUPPORT.md — zero support and no private support under any circumstances.
- Contributing: See CONTRIBUTING.md and CODE_OF_CONDUCT.md.
- Security Policy: See SECURITY.md — submit vulnerability reports exclusively via GitHub Private Vulnerability Reporting, never privately via email or public issues.
Licensed under the GNU General Public License v2 or later (GPL-2.0-or-later).



