This project includes a Python script that generates a modern robots.txt file that'll help you block AI training bots, while (optionally) allowing AI crawling bots to index your website or content.
Find a file
2026-07-18 19:33:25 -05:00
img added logo yo 2026-07-15 11:10:10 -05:00
src updated script with all options working and doc in readme 2026-07-17 19:33:16 -05:00
.gitignore adding gitignore 2026-07-14 10:20:15 -05:00
LICENSE Initial commit 2026-07-13 17:33:02 -05:00
README.md cleaned up documentation 2026-07-17 20:00:58 -05:00
robotxt rename in comment 2026-07-18 19:33:25 -05:00

robotxt

robotxt logo

This project includes a Python script that generates a modern robots.txt file that'll help you block AI training bots, while (optionally) allowing AI crawling bots to index your your content so that it is still accessible to bots that power real-time AI search and answers. There are 3 levels of AI bot blocking included.

Usage

git clone https://git.silverbeet.tech/phil/robotxt.git
cd robotxt
  • Run the script
python3 robotxt
  • Answer the questions regarding the level of AI bot blocking you want implemented:

    • Option 1: Allow all AI crawlers (maximum visibility) The simplest approach that lets every bot have full access to your content. If your goal is Generative Engine Optimization (GEO) visibility and you want to be cited everywhere, this is the starting point.

    • Option 2: Allow search-linked crawlers, block training-only crawlers This blocks bots that primarily collect training data while keeping your content accessible to bots that power real-time AI search and answers.

    Note: The line between "training" and "retrieval" is blurring. GPTBot is used for both training and retrieval. Blocking GPTBot while allowing OAI-SearchBot is OpenAI's recommended split if you want to opt out of training but stay in ChatGPT search results

    • Option 3: Block all AI crawlers This blocks AI bots for training, and website indexing

    • Option 4: Block "all known" AI crawlers This blocks AI bots for training, and website indexing using a huge list of "all known" AI bots from the ai-robots-txt/ai.robots.txt project

  • Review output of new robots.txt

  • Use the new robots.txt file in your environment (howto: Where should I put my robots.txt file?)

Questions

Eratta

License

Other projects

Other projects I've found that are actively addressing the AI blocking issue that helped in the development of robotxt:

  • ai.robots.txt - an exhaustive list of AI agents and robots to block
    • they have a huge list of all known AI bots to block: robots.txt that I've included as option 4 in this project
  • Known Agents - see how AI agents are crawling your site and using your tools
  • Generate Robotstxt - interactively generate a basic robots.txt file, which includes AI bot blocking options
  • The /llms.txt file - a proposed standard to use a llms.txt file to provide information to help LLMs use a website at inference time, following the ideals of the original robots.txt standard
  • Anubis - an amazing open source project that, "...uses a combination of heuristics to identify and block bots before they take your website down. You can customize the rules with your own policies.", which gives you active and automated control over which bots can access your site and content

Thanks