fix: make the Block AI crawlers setting an explicit decision - #92
Merged
Merged
Conversation
The setting withdrew a recognised AI crawler's good-bot pass and left the outcome to heuristic scoring. Scoring adds no user-agent points for a recognised bot, so a well-behaved AI crawler could finish below the block threshold. A crawler the owner has chosen to block is now refused before scoring, with the flag ai_crawler_blocked so the Detections page says why. The custom allowlist still wins, search engines and social bots are unaffected, and monitor mode suppresses the block like every other enforcement path. Adds behaviour tests for the setting.
cport1
force-pushed
the
fix/block-ai-crawlers-blocks
branch
from
September 21, 2026 22:38
8746f1a to
c43b327
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
Block AI crawlers now refuses a recognised AI crawler as an explicit decision, before any heuristic scoring.
Why
The setting worked by withdrawing the crawler's good-bot pass and letting scoring decide. Scoring adds no user-agent points for a recognised bot, so a well-behaved AI crawler sending ordinary headers could finish below the block threshold. An owner's instruction should not depend on how a request happens to score.
Behaviour
min_score_to_block, with the flagai_crawler_blockedanddenied_by: block_ai_crawlers, so the Detections page says why.Tests
New
tests/AiCrawlerPolicyTest.phpcovers each line above. Full suite: 106 passed.