Icon ruby The 2026 Ruby on Rails Community Survey results are in. See what Rails developers told us. →

Icon ruby 2026 Rails Survey results are live →

Article  |  Development

Adding llms.txt to a Rails App, and the Security Catch in Our Review

Reading time: ~ 6 minutes

Adding llms.txt to a Rails App, and the Security Catch in Our Review

There's a new kind of visitor on our client sites, and it doesn't look at anything we designed. AI assistants like ChatGPT, Claude, and Perplexity now browse the web on someone's behalf, and newer "agentic" browsers can click through a site and complete tasks for the person using them. They read the HTML, follow whatever links they can find, and build their own picture of what the site is about. When someone asks their assistant "what's on this site?" the answer comes from whatever the agent happened to crawl first, and that might be a stale archive page or a footer link to a privacy policy.

None of this throws an error. Analytics don't flag it, support tickets don't mention it, and the site works fine for people. The cost shows up later, when a person makes a decision based on an agent's summary that was stitched together from partial information.

Why this matters beyond the code

More of the first impression of an organization now happens inside an AI assistant. Someone asks for a recommendation, gets a short summary, and decides whether to visit at all. We've seen this on our own site at Planet Argon: since adding an llms.txt file, we've noticed more new sales inquiries coming from people who found us through tools like ChatGPT. That's anecdotal, and we're still measuring it, but it was enough to make us take this seriously for clients.

The examples here come from a Rails app, because Rails is our home turf. The idea itself works on any website, whether it runs on WordPress, Shopify, or something custom. It also sits alongside your sitemap and the work you already do for Google search, so adding it doesn't put any of that at risk.

The mission

The goal was to give those agents a proper front door. The emerging convention for this is /llms.txt: a plain text file at the root of a site that tells AI tools what the site is, what matters on it, and where to find it. Think of it as a sitemap written for a reader who understands sentences.

In this case, the site is My Steward Registry, a public vehicle history registry built in Rails. Owners document their vehicles by VIN (rust protection treatments, service records, inspections) and can publish restoration and custom-build stories for others to browse. The content changes constantly, and much of it is written by owners, which shaped every decision that followed.

Three principles we held to

1. The app should write the file. A hand-maintained llms.txt is out of date the week after someone writes it. The application already knows every page, every published record, and every section of the site, so the file is generated from the same data that builds the pages people see.

2. Anything an agent reads deserves the same care as anything a person reads. When an AI tool reads this file, it takes it as the site's own description of itself, so every word in it should be one the site stands behind.

3. Build on what's settled, experiment with what isn't. The tools in this space are changing fast. We wanted to be early on the parts that are stable, and to run small, throwaway experiments on the parts that aren't before committing a client's budget to them.

How it comes together

The file is generated by the application each time it's requested, from a short list of sections: what the registry is, where to start, what's browsable, the published builds, and the site's policies.

The generated llms.txt file for My Steward Registry, showing the registry overview, how records work, and where to start.
The generated /llms.txt includes the registry overview, how records work, and where to start.

The most useful lines turned out to be the ones that set expectations. The file tells agents that the registry labels each entry with its source and doesn't certify a vehicle's condition or value. It explains that owners choose what to share, so a missing record means the owner kept it private. Vehicle records are accessed by VIN and are intentionally left out of any listing. Those are the exact details an agent tends to leave out when it only crawls the pages, and a wrong summary of a vehicle's history can cost someone real money at a sale.

An AI assistant's answer about My Steward Registry before llms.txt, built from crawling a few pages.
Before: an assistant's answer built from crawling a few pages. Accurate, but missing what a missing record means and what the registry does and doesn't vouch for.

The same AI assistant's answer after it found the site's llms.txt file on its own.
After: the same question, once the assistant found /llms.txt on its own. The expectations the site cares about come through.

Because it's generated, the file stays current on its own. When an owner publishes a new build, it appears the next time the file is requested, with caching keeping the cost close to nothing. No one on the client's team has to remember it exists.

The catch in our own review

The most important moment in this project came during our review before release, when we stopped asking "does it work?" and started asking "how could someone misuse it?"

Build titles and descriptions on this site are written by owners. They're free text, and they're exactly what makes the content interesting: a restored 1958 Lincoln Continental or a 1953 Tucker Sno-Cat with its own name. They were also flowing straight into a file that presents itself as the site's own description.

That file uses simple formatting, where a dash starts a new list item and brackets create a link. A title that sneaks in a line break and a dash becomes a new entry. A title with brackets and a web address becomes a link. So an owner could, with one carefully written title, add a fake entry to the site's own map, or slip in a link to a scam site that an agent would read as something the registry itself recommends. A human visitor would never notice, because people don't read llms.txt. The agents that do read it take it at its word.

That's a setup for prompt injection by way of a content field. The fix runs every owner-written value through a cleanup step before it reaches the file, which strips out web addresses, line breaks, and the characters that create formatting. Owner descriptions are wrapped in quotes behind an "Owner's description:" label, the section opens with a note that everything in it comes from the vehicle owners, and every link in the file is one the app builds itself.

A build title written to add a fake entry and an outside link, shown cleaned up as a single entry in llms.txt.
A title written to add a fake entry and an outside link comes out as one entry, with one link back to the registry.

The cleanup protects the structure of the file, and the words still belong to the owner. A title like "Free VIN report" survives as plain text, sitting inside a single entry that's clearly labeled as owner-submitted. That's the balance we wanted: agents can still read whatever an owner wrote, and they know exactly whose voice they're reading. We also wrote automated tests with deliberately hostile titles and confirmed they fail when the cleanup is switched off, so the protection stays in place the next time someone touches the code.

What we deliberately left on the shelf

We also experimented with WebMCP, a proposed browser standard that would let an agent look up a VIN or browse builds directly instead of clicking through pages. It's still in a limited Chrome trial, and its core interface has already changed more than once. Building client features on something that is unsettled means signing up for rework on someone else's schedule, so we kept what we learned and decided to wait until the standard settles.

How we're measuring it

It's too early to point to results, so we're tracking a few signals over the next several months for both the registry and our own site:

  • Who reads the file. Server logs show which AI crawlers request /llms.txt and how often.

  • Where visitors come from. Analytics can show visits referred by AI assistants like ChatGPT, Perplexity, and Claude. This takes some care: in mid-October 2026, a ChatGPT bug briefly stripped the tracking tag from its links, and those visits showed up as "direct" traffic until OpenAI fixed it.

  • What new leads tell us. Asking "how did you find us?" catches what analytics miss.

  • What the assistants say. Every month or so, we ask a few assistants the same question about the site and compare their answers, the same test behind the screenshots above.

Support for llms.txt is still not standardized. None of the major AI companies have said their crawlers read it. One large log study found coding agents fetch it more often than AI search bots, which is one more reason to watch actual behavior over announcements.

The lesson

AI assistants are already part of how people meet a website, whether anyone planned for them or not. The good news for any organization with an established site is that the site already knows what an assistant needs to hear. Giving it a voice took a small, generated file and some careful thought about who gets to write what. At Planet Argon, we talk a lot about giving existing applications a second life, finding new value in software that already works instead of starting over, and this is a good example of it: the same codebase, quietly taking on a new audience.

The part worth carrying into the next project is the review moment. Any time content written by one party ends up in a file that software trusts, the structure of that file belongs to the site alone.

Curious what AI says about your site?

If you'd like to know how AI assistants describe your business today, we'll check for you. We'll ask a few of the major assistants about your site and share what they get right, what they miss, and whether an llms.txt file would help. Get in touch to set it up.

Have a project that needs help?