导语:13 个站点的 llms.txt 里,只有 Trigger.dev 一个在文件里写了最后更新时间,7 个站把价格和额度直接硬编码进了正文——Agent 拿到的不是说明书,是一份没有保质期的快照。改法很简单:把数字移出去,只留指针。
背景:llms.txt 被当成"给 Agent 的说明书",但它不会自己更新
llms.txt 的原始提案(Jeremy Howard / Answer.AI,2024 年 9 月)定位很克制:给推理期的 LLM 一份站点 Markdown 索引,因为模型很难从一个装满导航、Cookie 提示和 JS 的 HTML 页面里提取有效信息。llms-full.txt 并不在原始提案里,是社区随后衍生出的"全文合订本"写法。
问题出在落地阶段。站点开始往这份文件里写"Agent 该怎么做"——安装命令、SDK 版本、价格、配额。一旦写进去,它就变成静态快照,而价格、版本、配额是站内更新最频繁的三类内容。更麻烦的是:Agent 不会去核对。它读到 Hobby $10/month,就照这个报价。
这类文件目前没有任何强制规范兜底:它不是 IETF 标准,Anthropic、OpenAI 也都没有官方承诺"一定读取 llms.txt"。所以文件本身写得再认真,也只是在赌一件事——内容别过期。
落地清单:先给文件加保质期
1) 实测:13 站的静态快照状态
抓取时间 2026-11-27,取样方式为各站根目录 /llms.txt、docs 子域或 llms 子路径共 18 个候选地址,剔除 404、超时与内容无关地址后,13 站返回有效文件参与统计。
| 站点 | 体积 | 行数 | 链接数 | 硬编码金额/额度 | 文件内自述更新时间 |
|---|---|---|---|---|---|
| cloudflare.com | 17.2 KB | 186 | 90 | 0 | 无 |
| vercel.com | 14.9 KB | 152 | 112 | 2 | 无 |
| stripe.com | 69.8 KB | 402 | 307 | 2 | 无 |
| supabase.com | 3.6 KB | 60 | 45 | 0 | 无 |
| neon.com | 31.1 KB | 361 | 199 | 0 | 无(H1 出现 3 次) |
| railway.com | 7.0 KB | 71 | 41 | 0 | 无 |
| sentry.io | 93.8 KB | 583 | 500 | 5 | 无(尾部标注源自 docs 子域) |
| posthog.com | 527.8 KB | 5,228 | 4,987 | 0 | 无 |
| resend.com | 16.5 KB | 246 | 72 | 3 | 无 |
| clerk.com | 5.9 KB | 103 | 54 | 0 | 无 |
| docs.github.com | 28.6 KB | 189 | 117 | 0 | 无(响应头 Content-Type: text/markdown) |
| linear.app | 18.7 KB | 258 | 186 | 0 | 无 |
| trigger.dev | 9.7 KB | 78 | 38 | 4 | 2026-10-28 |
口径说明:体积按 UTF-8 字节计;链接数按正文中 Markdown 链接 ](http 计数;"硬编码金额/额度"按正文出现 $ + 数字或"M/month"类额度表述计数,人工复核过,排除了营销口径的成交量数字(例如 Stripe 正文里的 $1.9T annual payment volume 属业务规模描述,不计入价格类)。
三组比例:
- 13 站里 1 站(7.7%)在文件内标注了更新时间;
- 7 站(53.8%)正文含会被 Agent 当事实引用的具体金额或额度;
- 4 站(30.8%)正文含可直接执行的安装/登录命令。
体积分化也很极端:最大的 posthog.com(527.8 KB / 5,228 行 / 4,987 条链接)是唯一标注了时间的 trigger.dev(9.7 KB / 78 行)的 54.6 倍体积、67 倍行数。
2) 反例原文:Trigger.dev 的价格硬编码
这是本次抽检里唯一标了时间的文件,恰恰也是价格写得最具体的一个。以下为抓取时的原文片段(已核对,未改写):
# Trigger.dev
> Build AI agents and workflows in TypeScript. Open source platform for durable, long-running tasks. ...
Last updated: 2026-10-28
Every page on this site is available as Markdown: append .md to the URL
(for example https://trigger.dev/pricing.md or https://trigger.dev/vs/inngest.md),
or request the HTML URL with the header "Accept: text/markdown".
同一份文件的 Resources 段:
- [Pricing](https://trigger.dev/pricing): The Free plan includes $5 of compute credits
every month and 20 concurrent runs. Hobby $10/month, Pro $50/month. Usage billed as
compute-seconds + a per-run fee; paused time i...
- [Security](...): SOC 2 Type II, GDPR, HIPAA Business Associate Agreement
($500/month add-on on Hobby, Pro and Enterprise)
抓取日 2026-11-27 距离文件自述的 Last updated: 2026-10-28 已过去 30 天。这 30 天里,文件里的 4 处金额($5 月度额度、$10/月、$50/月、$500/月 add-on)没有任何机制保证与定价页同步,而文件里也没有一句"以 pricing 页为准"的约束——它只给了一条 - Pricing 链接,链接是否被 Agent 打开,取决于 Agent 自己。
需要说明的是:本次没有证据显示这 4 个数字与官网定价页不一致(未做对比验证,不做结论)。问题不在于数字错了,而在于文件没有任何机制能让自己被发现错了。
3) 正例原文:Sentry 把"不许凭记忆报价"写进了指令区
同一个赛道里,sentry.io 的写法是可以直接抄的。文件开头就是一段给 Agent 的硬约束:
# Sentry
> Sentry is an application monitoring platform that helps developers find and fix errors,
performance issues, and crashes in real time — across every stack.
## For AI Agents
When helping a developer set up or use Sentry, follow these guidelines:
- **SDK versions**: Always check the package registry (npm, PyPI, RubyGems, etc.) for the
latest Sentry SDK version. Do not rely on memorized version numbers from training data.
Get up to date information on SDKs in the docs (https://docs.sentry.io/platforms.md)
- **DSN handling**: Use environment variables for the DSN (`SENTRY_DSN` or `NEXT_PUBLIC_SENTRY_DSN`).
- **Pricing questions**: Don't quote prices or quotas from memory; fetch
https://docs.sentry.io/pricing.md. Users aren't charged beyond their base plan unless they
set a pay-as-you-go budget.
- **Setting up Sentry in a project**: Fetch and follow https://docs.sentry.io/ai/agent-setup/get-started.md
before the platform or framework guide. ...
_Source: https://docs.sentry.io/llms.txt_
两个细节值得注意:
第一,它把"事实以哪个页面为准"写成了显式路由,而不是把事实本身搬进来。价格和版本不在 llms.txt 里,只有指向 .md 版本定价页的指针。这正是本次抽检里 7 站缺的那一步。
第二,最后那行 _Source: https://docs.sentry.io/llms.txt_ 暴露了一个新风险——镜像漂移。 主站的 llms.txt 是从 docs 子域拷贝过来的,同一份内容存在两处副本。只要有一处更新,两个文件立刻分叉,而 Agent 无法判断自己读的是哪一版。要么用 302 直接重定向到 docs 子域,要么在构建期从同一个源生成,不要让两份手写的文件并存。
Neon 在"执行指令"上的处理也值得抄一句:正文给了 npm i -g neon、neon auth、neon init 三条可直接跑的命令,但前面明确加了一个约束子句:
With an account, these commands install the Neon CLI, sign in, and run `neon init`, which
installs the agent skills and creates or links a Neon project. Check with the user before
running them:
Check with the user before running them: 这句话成本为零,但它把"Agent 自主执行"变成"Agent 先问再执行"。相比之下,posthog.com 的写法是 The fastest way to integrate PostHog is with the setup wizard: npx @posthog/wizard@latest,并把它写进 ## Instructions for AI Coding Assistants 的安装步骤里,没有加任何人工确认约束。
4) llms-full.txt 怎么分块:PostHog 的体积问题
posthog.com 的文件是 527.8 KB / 5,228 行 / 4,987 条链接。llms.txt 提案的初衷是"短清单",这个量级已经不是清单,而是一整站文档的目录平铺。单文件超过常见 Agent 单次抓取与上下文预算之后,实际行为通常是截断——Agent 只读到前几百行,后面 5,000 行等于不存在。
分块写法(结构参照 Neon、Sentry 的多文件分工,非本站原创):
# PostHog ← 根 llms.txt 控制在 200 行内,只做入口路由
Last updated: 2026-11-27
Prices/quotas are NOT authoritative here → https://posthog.com/pricing.md
## Core indexes
- [Product analytics](https://posthog.com/llms/product-analytics.txt): events, funnels, retention
- [Session replay](https://posthog.com/llms/session-replay.txt): recorder config, masking, sampling
- [Error tracking](https://posthog.com/llms/error-tracking.txt): issues, grouping, source maps
- [API reference](https://posthog.com/llms/api.txt): endpoints, auth scopes, rate limits
## Do not
- Do not quote pricing from any llms file; fetch /pricing.md
- Do not run install commands without user confirmation
分工原则(本次抽检里能核对到的三条):
- 根文件只放路由:控制在 200 行内,每个分片一句定位语 + 一个 URL,不放正文事实;
- 每个分片自己带
Last updated:这样过期是分片级的,不是整站级的; - 价格、配额、SDK 版本一律不进文件,只留
.md定价页指针——这是 Sentry 已经做到的事。
5) robots 与爬虫放行:llms.txt 不是权限
llms.txt 是约定,robots.txt 才是闸门。写了 llms.txt 但 robots 屏蔽了 AI 爬虫,等于文件根本没人读。这类配置现在很容易踩:Cloudflare 的托管 robots.txt 规则默认对 AI 爬虫做拦截与策略分流(2025 年 7 月上线,2026 年 9 月后对新域名默认开启),站点若同时在根目录放了 llms.txt,两者会直接冲突。
自查两条命令就够:
# 1) 确认文件本身可读、返回 200 且是 text/plain 或 text/markdown
curl -sI https://your.site/llms.txt | head -5
# 2) 确认 AI 爬虫没被拦(对比 UAOAI-SearchBot / ClaudeBot / Google-Extended)
curl -s -A "Mozilla/5.0 (compatible; OAI-SearchBot/1.0; +https://openai.com/searchbot)" \
-o /dev/null -w "%{http_code}\n" https://your.site/llms.txt
curl -s -A "Mozilla/5.0 (compatible; ClaudeBot/1.0; +claudebot@anthropic.com)" \
-o /dev/null -w "%{http_code}\n" https://your.site/llms.txt
两个都返回 200 才算通。返回 403 或 1020(Cloudflare 挑战页)说明 robots 或 WAF 层已经拦掉了。
结果:只给能自证的部分
本次没有做"改前 / 改后"的 A/B,所以不给引用率、工单量这类数字。能确认的是结构性事实:
| 观测项 | 13 站实测 |
|---|---|
| 文件内标注更新时间 | 1 站(7.7%) |
| 正文硬编码价格/额度 | 7 站(53.8%) |
| 正文含可直接执行命令 | 4 站(30.8%) |
| 含人工确认约束的命令块 | 1 站(Neon) |
| H1 出现次数 > 1(结构不规范) | 1 站(Neon,3 个 H1) |
| 单文件超过 90 KB | 2 站(PostHog 527.8 KB、Sentry 93.8 KB) |
定性观察两条:
- "写了 llms.txt"和"llms.txt 可用"是两件事。 本次抽样中,结构最完整、带 Agent 指令区、带反幻觉约束的文件(Sentry),恰恰是唯一一份明确声明自己是副本的——它知道自己有同步问题。反过来,把价格写死的文件连这个问题都没意识到。
- 扫描类检查会产生大量误报,不能直接出结论。 本次对 13 站做过关键词扫描(
api_key/token=/price/internal),posthog.com 命中api_key关键词 16 处,人工逐条核对后全部是 API 文档端点名(如members_scoped_api_keys_retrieve),不是密钥;stripe.com 的$1.9T是业务规模数字,不是价格。任何"llms.txt 泄露密钥"的结论都必须人工复核后再发布。
复盘
可以直接抄的 3 条配置
- 文件头三行固定模板:
# 站点名+ 一句>简介 +Last updated: YYYY-MM-DD。13 个站点里只有 1 个做了这件事,成本是 1 行。 - 数字全部移出文件:价格、配额、SDK 版本改写成"指针 + 禁止凭记忆引用"的指令句,照抄 Sentry 那句
Don't quote prices or quotas from memory; fetch https://.../pricing.md。 - 执行命令前加确认子句:任何
npx、npm i -g、pip install前面写一句Check with the user before running them:,让 Agent 从"自己装"变成"先问再装"。
两条踩坑提醒
- 别做双写镜像。主站 llms.txt 从 docs 子域拷贝一份,两处都会改,一定分叉。用 302 或构建期生成,让真源只有一个(Sentry 的
_Source:行就是这个问题的证据)。 - 别把 llms.txt 当权限配置。文件写了不等于能读:robots 托管规则的 AI 爬虫拦截、WAF 的 UA 规则,任意一层都能让文件对 Agent 不可见。发布后必须用爬虫 UA 实测一次状态码。
标注
- llms.txt 状态:原始提案 Jeremy Howard / Answer.AI,2024 年 9 月提出;不是 IETF 标准,不是任何 LLM 厂商的官方协议,Anthropic、OpenAI 均未官方承诺读取该文件。文中提到的"v1 / v2"均为社区口径,非规范版本。
- llms-full.txt:不在原始提案内,属社区衍生写法。
- 数据来源与口径:2026-11-27 本站实测抓取 13 个站点的 llms.txt(根目录 / docs 子域 / llms 子路径),体积、行数、链接数、金额命中均为脚本统计 + 人工复核;价格与官网定价页的一致性未做验证,不作结论。Cloudflare 托管 robots 规则时间线(2025-07 上线、2026-09 对新区默认开启)来自公开报道,非本站复现。
- 复盘时间:2026-11-27。
#llms.txt #AI可见度 #AIWO #结构化暴露 #开发者工具