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.

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:

  1. 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.
  2. 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.
  3. 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:

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:

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

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.


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.