An llms.txt file is public by design, so anything written in it should be safe for a stranger to read. Before you publish or regenerate one, check four things: URLs with tokens or signatures, internal and staging hostnames, links to gated pages, and descriptive text that reveals unannounced or confidential work. If anything sensitive has already shipped, removing the line is not enough. Rotate the secret and fix the source that generated it.

Why this file needs its own review

The spec describes llms.txt as a Markdown file with an H1 title, a blockquote summary, optional details and H2 sections listing URLs for further detail [1]. The llms.txt project's changes page says agents should view or search the file to find what they need, then follow the relevant links [2]. Every link in the file is therefore an invitation to fetch it, and every sentence is text a reader or agent can take at face value.

The security guidance on LLMs points the same way. OWASP says system prompt leakage can expose sensitive information such as API keys, database credentials or user tokens, and that such secrets should not be stored in system-prompt-like text [3]. It adds that the main risk is not the disclosure itself but that sensitive data sits where it should not, or that authorization can be bypassed [3]. NIST describes prompt injection causing a GenAI system to leak private information from restricted resources it can access [5].

Neither source is about llms.txt. The principle carries over, though. If a secret or private link is in a file meant for discovery, the file is the problem, and no downstream control fixes it.

The checklist

1. Search every URL for credentials

Any URL that grants access by itself must not be in the file. Look for these patterns:

PatternWhat it usually is
?token=, ?key=, ?api_key=, ?access_token=Query-string credentials
?sig=, X-Amz-Signature, Expires=Pre-signed or time-limited links
?session=, sid=, ?auth=Session identifiers
/share/<long-id>, /invite/<id>, magic-link pathsCapability URLs that act as passwords
user:pass@hostCredentials embedded in the authority part

Run a quick scan on the file as it will be served:

curl -s https://example.com/llms.txt | grep -niE '(token|key|secret|sig|signature|session|auth|password|expires)='
curl -s https://example.com/llms.txt | grep -niE '://[^/ ]+:[^/ ]+@'

Zero matches does not prove the file is clean. Long random path segments carry no tell-tale parameter name, so read the paths too.

2. Remove internal and staging hostnames

Scan for hosts that are not your public site:

curl -s https://example.com/llms.txt | grep -niE '(staging|stage|dev|test|qa|preview|internal|intranet|localhost|\.local|127\.0\.0\.1|10\.[0-9]+\.|192\.168\.)'

Also compare every hostname against a short allowlist of the domains you intend to publish. An allowlist catches hosts your keyword list does not anticipate, such as hosted preview URLs or a vendor's default domain.

Check each link in a private browser window with no session. If it redirects to a login, returns 401 or 403, or shows account-specific content, it does not belong. The same goes for admin panels, dashboards, order pages and checkout steps. Replace it with a public page that covers the topic, or delete the line.

The H1, the summary blockquote and the notes after each link are free text. They tend to pick up details the URLs don't:

  • codenames or descriptions of unannounced products
  • customer or partner names you have not published elsewhere
  • internal pricing, margins or roadmap dates
  • names of internal tools, repositories or environments

Before:

## Docs
- [Billing migration plan](https://docs.example.com/billing-v2): Q3 move off the legacy vendor, Acme Corp contract ends in August

After:

## Docs
- [Billing](https://docs.example.com/billing): How invoices, plans and payment methods work

Ask of each line: would we be comfortable seeing this on a public page? If not, it is not an llms.txt line.

5. Find the source that produced the line

A private URL in the file usually got there from a generator: a sitemap export, a CMS query, a docs build or a script that lists every route. Fix the filter at that source, or the next run will bring the line back. Typical causes:

  • drafts or unpublished entries included in the page list
  • an environment variable that sets the base URL to a staging host in some builds
  • a route list that includes authenticated sections
  • a hand-edited file that was copied from an internal version

If the file is generated, diff the output against the previous version before each release and read the diff.

6. Do not use robots.txt as the cover

Putting a private path in llms.txt and disallowing it in robots.txt does not protect it. The disallow is a request to well-behaved crawlers, and robots.txt itself is public and lists the very paths you want hidden. Access control belongs on the server, with authentication, authorization and network rules. The related post below covers this in detail.

If something already leaked

  1. Rotate first. Revoke the token, signature or share link, and issue a new one if it is still needed. A deleted line does not make the old value safe, because copies may exist in caches, archives or logs on other systems.
  2. Remove the line and redeploy the file.
  3. Purge caches at your CDN and any server-side cache so the old version stops being served.
  4. Check your access logs for requests to the exposed URL from the time the file went live. Look for unfamiliar IPs and user agents.
  5. Decide on disclosure. If the link exposed customer data, your legal and security people decide on notification, not the content team.
  6. Fix the generator from step 5 so it does not recur.

Staging hostnames and internal project names are lower risk than live credentials. Still, remove them and check that the staging environment requires authentication.

Make it a release gate

Put the two grep commands above in your deploy pipeline and fail the build on any match. Keep the hostname allowlist in version control. A person should still read the final file once per release, because the checks catch patterns and not meaning.

What to do next

  1. Fetch your live llms.txt and run the credential and hostname scans.
  2. Open every link without a session and remove anything that is gated.
  3. Read the title, summary and link notes for confidential detail.
  4. Trace any problem line back to the generator and fix it there.