Skip to content

Fix #134: Feature request: AI agent tarpit#167

Open
JiwaniZakir wants to merge 3 commits intoBlessedRebuS:devfrom
JiwaniZakir:fix/134-feature-request-ai-agent-tarpit
Open

Fix #134: Feature request: AI agent tarpit#167
JiwaniZakir wants to merge 3 commits intoBlessedRebuS:devfrom
JiwaniZakir:fix/134-feature-request-ai-agent-tarpit

Conversation

@JiwaniZakir
Copy link
Copy Markdown

Closes #134

Adds an opt-in tarpit feature to slow down and inject noise into responses served to AI crawlers. A new tarpit section in config.yaml exposes two knobs — enabled (defaults to false) and delay_seconds (defaults to 5) — parsed in Config.from_dict in src/config.py into tarpit_enabled and tarpit_delay_seconds fields.

In src/routes/honeypot.py, trap_page gains a conditional asyncio.sleep(config.tarpit_delay_seconds) after the existing response delay, and _generate_page appends a hidden <div class="link-box tarpit-text"> block containing output from the new _tarpit_text() helper, which samples randomly from a 90-word _TARPIT_WORDS list to produce 60-word nonsense strings intended to pollute LLM training corpora.

Modified files: config.yaml (new tarpit block), src/config.py (Config dataclass fields + from_dict parsing), src/routes/honeypot.py (trap_page, _generate_page, new _tarpit_text and _TARPIT_WORDS).

Verified manually by enabling tarpit: enabled: true with delay_seconds: 3, hitting a trap URL, and confirming the added delay and the injected word-salad <div> in the rendered HTML; feature remains completely inert with enabled: false.


This PR was created with AI assistance (Claude). The changes were reviewed by quality gates and a critic model before submission.

Introduces a configurable tarpit to slow down and serve random
word-salad content to AI crawlers. Disabled by default; enable
via tarpit.enabled in config.yaml or KRAWL_TARPIT_ENABLED env var.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@BlessedRebuS BlessedRebuS changed the base branch from main to dev April 5, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: AI agent tarpit

2 participants