Where an AI app's terms of service and privacy policy should live
Keep one canonical copy of each legal document — the terms of service and the privacy policy — in the service that owns the facts they describe, and have every site that shows them render them from that copy. Two copies always drift: the price changes in the code, the terms page still quotes the old one, and nobody notices until a customer quotes the page back at you.
This is not legal advice. This page covers where the documents live and how they are served, not what they should say. That question belongs to a lawyer.
One copy, in the place that knows the facts
The terms describe the product: what it does, what it costs, what data it holds, who is responsible for what. The system that knows those facts is usually the backend — the API server, the billing ledger, the database — and not the marketing site, which is normally a separate repository, deployed separately and edited by different people.
When the same document exists in both places, one of them is stale, and it is usually the one a lawyer is reading.
Put the document where the code it describes lives, in Markdown, at a
predictable path (terms.md, privacy.md), in
the same repository as that code. It can then change in the same pull
request as the behavior it describes, and the record of who changed what
is the repository's own logs.
Serve it two ways: a page for people, Markdown for agents
The same source becomes an HTML page for people and search engines, and stays Markdown for programs. Both are the same text; neither is a copy of the other.
GET /terms— the page: title, "Last updated" date and the document's body, rendered from the Markdown as the page is served.GET /terms.md— the Markdown itself, astext/markdown, which is what an agent should fetch.- In the page's
<head>, a<link rel="alternate" type="text/markdown" href="…/terms.html">names the machine copy, so a tool that reads the HTML knows where it is.
Markdown matters for agents because it is plain text: an agent answering "how much do credits cost" reads it faster, and for fewer tokens, than it parses a styled page.
HTML matters because search engines index it. Google's list of the
file types it can index names plain text (.txt) but not
Markdown, so a legal page that should be findable needs an HTML version
(Google
Search Central, file types indexable by Google, checked
2026-11-06).
If the site is served from more than one place — several datacenters,
or a language mirror — give every copy the same canonical URL, on the
one host you want in search results. Google calls
rel="canonical" "a strong signal that the specified URL
should become canonical" (Google
Search Central, consolidate duplicate URLs, checked 2026-11-06).
Render at request time, without losing search or speed
The pattern that keeps one source and still serves a fast, indexable page has three parts:
- Prerender the page around the document. At build
time, render the site's own layout — header, footer, styles, navigation
— with placeholders where the document's title, date and body go, plus
an empty
<article>. The shell is static, so every request shares its assets and layout. - Fill it in as it is served. The server fetches the canonical Markdown, renders it to HTML, and substitutes the title, date and body. The page cannot then show text that the canonical document no longer contains.
- Hand the same data to the browser. Put the rendered
document in a global (
window.__LEGAL_DOC__) and have the page pick it up during hydration, so the browser-rendered page matches the HTML the server sent. For navigation inside the app, a small JSON endpoint (/legal-docs/terms.json) returns the same fields.
Cache the Markdown — an hour in memory is plenty — and keep the last good version on disk. When the source can't be reached, serve the copy and retry after a few minutes instead of holding the failure for the full hour. A deployment that has never fetched the document has nothing to fall back on; that is what a 502 and a message naming the document are for.
Stand on its own
The legal pages should be the last thing to break, not the
first. If they live inside the app whose data handling they
describe, an outage, a bad deploy or a
billing problem takes them down with it — and /terms is
exactly what a customer, a payment processor or a crawler looks for when
something is wrong.
Serve them from whatever stays up: a static site, the account site, a CDN. Where the page has to fetch from a service that can fail, the last-known-good copy above is what makes that acceptable.
Say when it changed
Every legal page shows a "Last updated" date, and the date belongs in the document itself — not only in the page's chrome — so the Markdown carries it too. Keep a short changelog of substantive changes: pricing, what data is collected, who it goes to, what rights a user has. "We may change these terms at any time" gives you the flexibility to change a price quietly, and costs you the trust that saying "we will tell you" earns.
Write what the code actually does
The most common defect on a legal page is not a missing clause. It is a sentence copied from a template that the product does not do. "Credits expire after one year" — because the generator's template said so — is a promise, whether or not anyone could enforce it, and the ledger has never had an expiry.
When you find one, pick one:
- Implement it, if it is worth implementing.
- State what happens, and promise notice. That is accurate, so it stops being a promise you are breaking. Cloudish's terms, for example, now say credits do not currently expire, and that introducing expiry would come with at least 30 days' notice, applying only to credits added after the policy takes effect (Cloudish, terms.md, checked 2026-11-06).
Do not leave the unenforced claim in. It is the one sentence on the page a user can catch you on.
Clauses an AI app needs that a plain website does not
Templates are written for websites selling subscriptions. An app that runs models on users' API keys, and lets agents use them, describes a different relationship:
- Who acts with a key. Keys are handed to agents and applications, so "you are responsible for activity under your keys" has to continue "including actions taken by your agents and applications", or a user can reasonably say the agent did it, not them.
- What the output is worth. Say that model output can be wrong — hallucinated — that the user must check it, and who owns it.
- Abuse. AI apps get used to generate spam at scale and to attack other systems. A clause saying you may not host or distribute malware or attack other systems, and that you may suspend an account for it, is worth having before you need it.
- Age. Templates usually say 13, the US children's-privacy threshold, while a product sold with prepaid credits is meant for adults. Cloudish's terms and its privacy policy now both say 18, and say what happens if it learns otherwise. Whatever number you pick, the two documents should give the same one.
- Money. Prepaid credits need a price, what happens to unused ones, whether they are refundable, and what happens to them on termination.
- Changes and termination. What gets an account removed from the service, and how much notice a change to pricing, data handling or users' rights gets. Name the jurisdiction whose law governs the agreement.
Check that it works
Four commands, against the deployed site:
# The page, as a browser and a crawler see it
curl -s https://www.example.com/terms | grep -o '<h1[^>]*>[^<]*</h1>'
curl -s https://www.example.com/terms | grep -c '%' # no placeholders left behind
# The Markdown, as an agent sees it
curl -s https://www.example.com/terms.md | head -3
# The link to it, in the page head
curl -sI https://www.example.com/terms | grep -i '^link:'Then break the source on purpose — stop the service, or point the
fetch at a dead host — and load
/terms again. The last-known-good copy should still be
served, and a document that was never fetched should fail with a message
naming what could not be loaded, not a blank page.
Checklist
- one canonical Markdown file per document, in the repository that owns the behavior
/{name}as HTML and/{name}.mdas Markdown, both served from that file- a canonical URL and a
rel="alternate"link to the Markdown in the page head - the "Last updated" date in the document itself
- every promise in the document matching what the code does
- keys, agents, model output and abuse covered
- the legal pages still served when the service behind them is down
Related pages
- Data protection when you use AI: the questions a privacy policy answers
- Data protection by vendor
- Security for AI apps and agents
- From idea to deployed AI app: where the legal pages fit in a deploy
- The cloud, for AI apps
See also
Glossary terms used on this page: Agent, API, API key, Deploy, Host, Logs, Model, Token, Tool.
Sources
All checked on 2026-11-06.
- Google Search Central, File types indexable by Google
- Google Search Central, Consolidate duplicate URLs
- Cloudish, terms.md and privacy.md, the disclosed example's canonical copies
First version written with AI assistance, from a change made while building the Cloudish site, and checked against the sources on 2026-11-06. Not legal advice. Found a mistake? Fix it or open an issue. Text licensed under CC BY 4.0.