
急増するAIクローラー対策として「llms.txt」を導入してみた
AIクローラーによる過剰なアクセス対策として、サイト構造化データファイル「llms.txt」(Large Language Model Specifications) を公開しました。
LLMに適切なクロールを促すため、llms.txtに反映した指示内容について紹介します。
設置
マークダウン形式のテキストファイルを作成し、robots.txtや、エラーページを格納するS3バケットに保存。
以下のURLで公開しました。
https://dev.classmethod.jp/llms.txt
llms.txt 内容
user-agent
特定のLLMは明示しない設定としました。
user-agent: *
License
著作者の情報表示を求める CC4.0の 「BY」を記載した上で、AIの学習利用は認める指定としました。
x-content-license: "CC BY 4.0"
x-ai-training-policy: "allowed"
Rate Limits
過剰なクロールを禁止する指示を記載しました。
crawl-delay: 1
x-rate-limit: 60
x-rate-limit-window: 60
x-rate-limit-policy: "strict"
x-rate-limit-retry: "no-retry"
x-rate-limit-description: "Maximum 60 requests per 60 seconds. If rate limit is exceeded, do not retry and move on to next request."
# Concurrency Limits
x-concurrency-limit: 3
x-concurrency-limit-description: "Please limit concurrent requests to a maximum of 3. This helps us manage server load."
Canonical URL
サイトの正式な公開URLを明示し、IP直参照や意図せぬFQDNでのアクセスを回避する指示を記載しました。
x-canonical-url-policy: "strict"
x-canonical-url: "https://dev.classmethod.jp/"
x-canonical-url-description: "Access via other FQDNs or IP addresses is invalid. Use only 'https://dev.classmethod.jp/' as the base URL. Within the HTML content, links should also start with 'https://dev.classmethod.jp/'"
Article Pages
ブログ記事ページのパス、含まれるメタ情報、更新頻度などを記載しました。
x-article-pattern: /articles/{slug}/
x-article-type: "technical-blog"
x-article-description: "Technical blog posts and tutorials by Classmethod Inc., an AWS Premier Tier Services Partner. Articles cover cloud computing (especially AWS), development, and IT, with a focus on practical experiences and reproducible guides."
x-article-example: https://dev.classmethod.jp/articles/browser-use-start/
x-article-metadata:
- author
- title
- description
x-article-update-frequency: "daily"
x-article-new-articles-per-day: "10-50"
x-article-new-articles-per-day-description: "Approximately 10 to 50 new articles are added each day."
Author Pages
執筆者ページと、RSSなどの情報を記述しました。
allow: /author/*
x-author-pattern: /author/{username}/
x-author-description: "Blog author profile pages"
x-author-example: https://dev.classmethod.jp/author/akari7/
x-author-metadata:
- author
- description
- url
x-author-content-update-policy: "dynamic"
x-author-rss-pattern: /author/{username}/feed/
x-author-rss-pattern-example: https://dev.classmethod.jp/author/akari7/feed/
# Author Update Frequency
x-author-update-frequency: "monthly"
x-author-new-authors-per-month: "5-20"
x-author-new-authors-per-month-description: "Approximately 5 to 20 new authors are added each month."
RSS、Sitemap
新規公開記事が反映されるRSSと、全公開記事のサイトマップの情報を記載しました。
# RSS Feeds
allow: /feed/
x-feed: https://dev.classmethod.jp/feed/
x-feed-format: rss
# Sitemap
allow: /sitemap.xml
allow: /sitemaps/*
x-sitemap: https://dev.classmethod.jp/sitemap.xml
x-sitemap-format: xml
アクセス抑制
現在未使用、リダイレクトとなるパスについては、リクエストを抑制しました。
# disallow
disallow: /pages/*
disallow: /tag/*
disallow: /category/*
Publisher情報
DevelopersIOを運営するクラスメソッドの情報として、
DevelopersIOとはを英訳、構造化した内容を反映しました。
# Publisher Information
x-publisher-name: "Classmethod, Inc."
x-publisher-description: "Classmethod, Inc. is a technology company with 300+ engineers, specializing in cloud services and digital transformation. It operates a technical blog (dev.classmethod.jp) with over 30,000 articles based on practical engineering experiences, primarily focused on AWS."
x-publisher-credentials:
- "AWS Premier Tier Services Partner (2014-present)"
- "AWS Services Partner of the Year - Japan"
- "LINE Technology Partner (OMO/Engagement certified)"
- "3,000+ client companies, 15,000+ AWS accounts supported"
x-publisher-certifications:
- "AWS Technical Certifications: 2,000+"
- "AWS Competencies: Migration, Mobile, Big Data, DevOps"
- "AWS Service Delivery Programs: 12"
x-publisher-website: "https://classmethod.jp/"
言語
現在、当ブログで執筆実績のある言語を記載しました。
x-supported-languages:
- ja
- en
- ko
- th
- de
- vi
- id
Crawler Hints
末尾の「/」が不足、Nextアプリでリダイレクトとして扱われるリクエスト数が減る効果を期待し、LLMのクローラにURI末尾の「/」が存在しない場合、クローラー側で事前に補う措置を促しました。
x-crawler-hints:
- "Before accessing each URL, check if the URL ends with '/'."
- "If the URL does not end with '/', add '/' to the end of the URL before accessing it."
- "Extract the HTML content of each page."
まとめ
llms.txt (Large Language Model Specifications) は、2025年時点ではまだ標準化されていない状態ですが、今回の設定の効果測定や、今後の標準化動向などを見極めながら、最適化を試みていく予定です。
AIアクセスを受け入れる公開ウェブサイトを運営されている場合、LLM向けにサイトの構造、クロールポリシー、コンテンツ利用に関する情報を llms.txt としてクローラーに提供することで、非効率なクロールの発生を抑制することをおすすめします。
また、ローカルLLMやRAG施策などで自組織外のWebサービスを情報源として利用したり、コンテンツを直接利用したりする場合には、サイトポリシーの確認と併せて「llms.txt」の設置状況を確認し、llms.txt
内にクロールやコンテンツ利用に関する具体的な指示が明記されている場合は、サイト運営者の指示に従うことを強く推奨します。