koh / sylius-robots-txt
Channel-aware robots.txt for Sylius with explicit AI crawler rules and Content Signals (RFC 9309).
Package info
github.com/ohartwig/sylius-robots-txt
Type:sylius-bundle
pkg:composer/koh/sylius-robots-txt
Requires
- php: ^8.3
- koh/sylius-agent-contracts: ^1.0
- sylius/sylius: ^2.2.9 || ^2.3.0
- symfony/config: ^7.4 || ^8.0
- symfony/console: ^7.4 || ^8.0
- symfony/dependency-injection: ^7.4 || ^8.0
- symfony/http-foundation: ^7.4 || ^8.0
- symfony/http-kernel: ^7.4 || ^8.0
- symfony/routing: ^7.4 || ^8.0
Requires (Dev)
- koh/dev-sylius: ^1.0
- phpstan/phpstan: ^2.3.7
- phpunit/phpunit: ^11.5.58
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- v1.3.0
- v1.2.0
- v1.1.42
- v1.1.41
- v1.1.40
- v1.1.39
- v1.1.38
- v1.1.37
- v1.1.36
- v1.1.35
- v1.1.34
- v1.1.33
- v1.1.32
- v1.1.31
- v1.1.30
- v1.1.29
- v1.1.28
- v1.1.27
- v1.1.26
- v1.1.25
- v1.1.24
- v1.1.23
- v1.1.22
- v1.1.21
- v1.1.20
- v1.1.19
- v1.1.18
- v1.1.17
- v1.1.16
- v1.1.15
- v1.1.14
- v1.1.13
- v1.1.12
- v1.1.11
- v1.1.10
- v1.1.9
- v1.1.8
- v1.1.7
- v1.1.6
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- dev-main / 1.0.x-dev
- v1.0.1
- v1.0.0
This package is auto-updated.
Last update: 2026-12-02 09:46:56 UTC
README
koh/sylius-robots-txt
Channel-aware robots.txt for Sylius, with explicit AI crawler rules and
Content Signals.
Three things that usually live in a hand-edited static file, modelled instead:
one robots.txt per channel, a named group per AI crawler, and a Content Signal
that is emitted both in the file and as a response header.
Install
composer require koh/sylius-robots-txt
// config/bundles.php Koh\SyliusRobotsTxt\KohSyliusRobotsTxtBundle::class => ['all' => true],
# config/routes/koh_agent.yaml koh_robots_txt: resource: '@KohSyliusRobotsTxtBundle/config/routes.php' ignore_errors: not_found
Delete public/robots.txt. The web server answers from disk before Symfony
is consulted, so a leftover file makes this bundle silently do nothing. The
bundle logs a warning at cache warmup if it finds one.
Configure
Defaults are sensible for a shop that wants to be found and answered from, but not trained on:
# config/packages/koh_robots_txt.yaml koh_robots_txt: disallow: ['/admin', '/_mcp', '/mcp/oauth/'] sitemaps: ['/sitemap.xml'] # relative paths get expanded per channel agentmaps: [] # ARD manifests, e.g. ['/.well-known/ard.json'] ai_crawlers: allowed: true # false ⇒ Disallow: / for every named token agents: [GPTBot, OAI-SearchBot, ClaudeBot, Google-Extended, …] disallow: [] # extra paths hidden from AI crawlers only block_training: true # Disallow: / for the training-only tokens below training_agents: [GPTBot, ClaudeBot, Applebot-Extended, MistralAI-Training, CCBot] content_signal: search: true # may be indexed and linked ai_input: true # may be retrieved at answer time (RAG) ai_train: false # may not be used to train a model response_header: true # also emit Content-Signal on HTML pages
Output
User-agent: *
Content-Signal: ai-train=no, search=yes, ai-input=yes
Allow: /
Disallow: /admin
Disallow: /_mcp
# AI crawlers, named explicitly.
# A wildcard group is not read as a policy for these agents.
User-agent: OAI-SearchBot
User-agent: ChatGPT-User
…
Content-Signal: ai-train=no, search=yes, ai-input=yes
Allow: /
Disallow: /admin
Disallow: /_mcp
# Crawlers used only for model training.
User-agent: GPTBot
User-agent: ClaudeBot
…
Content-Signal: ai-train=no, search=yes, ai-input=yes
Disallow: /
Sitemap: https://shop.example.com/sitemap.xml
Agentmap: https://shop.example.com/.well-known/ard.json # only with agentmaps set
Agentmap is the ARD directive
(§5.1) that points agents at a manifest of the origin's agent artefacts, the
way Sitemap points crawlers at its URLs. It is empty by default because this
package cannot know whether such a manifest is served; koh/sylius-api-catalog
serves one at /.well-known/ard.json.
Why the AI crawlers get their own group rather than being folded into *:
several of them only honour a policy that names their product token, and
scanners check for the tokens specifically. User-agent: * is not read as a
statement about GPTBot.
A named group replaces * for its crawlers, so the paths in disallow are
repeated in it. Only tokens whose operator documents model training as their
only use are shut out; Google-Extended, meta-externalagent and Amazonbot also
feed answers to people and stay in the allowed group.
Why the Content Signal also goes out as a header: robots.txt states a policy
for a crawl, the header states it for the exact resource that was fetched —
which is what a retrieval-time agent sees. Different consumers, same
configuration.
Command
bin/console koh:agent:robots:dump # print for the first enabled channel bin/console koh:agent:robots:dump -c WEB_AT # print for one channel bin/console koh:agent:robots:dump --write # write public/robots.txt
--write is for deployments that prefer a static file. It makes the dynamic
route unreachable, so re-run it whenever the configuration changes.
Decommission
Remove the composer require, the config/bundles.php entry, the route import
and config/packages/koh_robots_txt.yaml. No database table, no cache pool.
Restore a static public/robots.txt if you still want one.
Security
Report vulnerabilities privately — see SECURITY.md. Advisories are published as CSAF 2.0 at https://ole-hartwig.eu/.well-known/csaf/.
The family threat model, covering this package, is at https://github.com/ohartwig/sylius-agent-ready/blob/main/docs/threat-model.md.
Licence
MIT — see LICENSE.