Search engines and AI agents
Every PocketOne app answers three files at its root that crawlers and agents read before anything else:
| File | Who reads it | What it says |
|---|---|---|
/robots.txt |
Search engines, every polite crawler | What not to fetch, and where the sitemap is. |
/sitemap.xml |
Search engines | Every page you want found. |
/llms.txt |
AI agents browsing your site | What the app is, its pages, and how to connect over MCP. |
They're generated from what your app already knows, they agree with each other, and a file of your own in
pb_public or pb_pages replaces any one of them.
Out of the box
Say your app has a few Pages:
pb_pages/
index.ets <h1>Acme Notes</h1>
about.md # About us
pricing.ets
account/index.ets
With nothing set up, /robots.txt closes only the dashboard and MCP, and points at the sitemap:
User-agent: *
Content-Signal: search=yes, ai-input=yes, ai-train=no
Disallow: /_/
Disallow: /mcp
Sitemap: https://notes.example.com/sitemap.xml
/sitemap.xml lists every page (and every .html file in pb_public), and /llms.txt gets a ## Pages section
with each page's title:
## Pages
- [Acme Notes](https://notes.example.com/)
- [About us](https://notes.example.com/about)
- [Your account](https://notes.example.com/account)
- [/pricing](https://notes.example.com/pricing)
A page's title comes from its front matter title, its first # heading, or its <title> or <h1>; a page with
none is listed by its path.
Keep the account pages private
/account is for signed-in users: no reason for search engines or agents to see it. Mark it private in
pb_pages/+config.js:
module.exports = { private: ['/account'] }
All three files follow: robots.txt gains Disallow: /account, the sitemap and llms.txt leave it out, and every page
under /account is sent with X-Robots-Tag: noindex, so it stays out of search results even if someone links to it.
You can mark paths private in Settings → Extensions → robots.txt too, or with $robotsTxt.private('/account') in
pb_hooks.
Private keeps pages out of search. It doesn't stop anyone from opening them: that's what sign-in and API rules are for.
Leave one page out
A page that should work but not be advertised (a thank-you page, a draft) opts out of the sitemap and llms.txt one by one. In Markdown front matter:
---
sitemap: false
llms: false
---
or in the page's .ts code:
export const sitemap = false
export const llms = false
To drop the whole ## Pages section from llms.txt, add llmsTxt: false to +config.js.
List pages with parameters
pb_pages/blog/[slug].ets is one page per post, so Pages can't list it by itself. Export a sitemap function from
blog/[slug].ts and the sitemap lists every post:
export const sitemap = ({ app }) =>
app.findRecordsByFilter('posts', 'published = true', '-updated', 0, 0).map((post) => ({
params: { slug: post.get('slug') },
lastmod: post.get('updated'),
}))
Keep a staging app out of search
On a staging or preview copy, turn on Settings → Extensions → robots.txt → Keep this app out of search results.
Every page then says noindex and the sitemap is empty. Apps run with --dev do this on their own, so a local copy
never ends up in search results.
AI training crawlers
Crawlers that collect pages to train AI models can fetch pages by default, and robots.txt's Content-Signal line
asks them not to train on them (ai-train=no; change it on the same settings page or in pocketone.yaml).
Block AI training crawlers closes the app to them (GPTBot, ClaudeBot, Google-Extended and others), while assistants fetching a page
because someone asked are still let in.
Write a file yourself
Put robots.txt, sitemap.xml or llms.txt in pb_public (or serve it from pb_pages) and it answers instead of
the generated one. The others keep working: a hand-written robots.txt still leaves the generated sitemap in place,
and private paths still keep pages out of it.
Where to go next
- robots.txt: rules, private paths, AI crawlers.
- sitemap.xml: what's listed and how to add URLs.
- llms.txt for AI agents: the preamble and your own sections.
Questions and comments
Comments are a GitHub Discussions thread; sign in with GitHub to post.