09 — Law and protecting the maker
Chapter 09 carries Commandments VI and VII (“Environment (dev / prod) — Separate places where the app runs: “dev” for safe tests, “prod” for real users. Dev is a playground, prod is where real users are — the rules for each are completely different. more in the glossary → is sacred”, “user data is inviolable”) out into the world — and adds a third party who can get hurt: you. A solo creator or sole trader launching a public app has no limited-liability company to shield them. A person answers for the terms of service, the privacy and the promises in the site’s copy. So legal documents are written as carefully as a production Migration (database) — A controlled change to the database layout — adding a column, a table or moving data — step by step. Like a renovation to plan: rebuilding data in a set order so nothing “collapses”. more in the glossary →: a mistake is just as expensive, only paid in a different currency.
⚠️ This is engineering guidance, not legal advice. It reduces risk but doesn’t eliminate it — before you bind real users at scale, show the documents to a lawyer.
A placeholder instead of an invention
Never invent legal or identity data. ↗
An assistant asked for “a ready set of terms” has a natural tendency to fill gaps with something plausible: a sample tax number, an address, a company name. In a product that’s a disaster — fake operator details look real, so nobody fixes them, and to users and authorities they’re a statement. So all such fields are visible [to be filled] placeholders that the owner completes. A visible gap is safe because it shouts that it needs filling; a plausible fake is dangerous because it stays silent. It’s a ban from the right-hand column of the permission map (06) — not even the user’s request changes it.
A promise has to be true in the code
Never declare a practice the code doesn’t implement. ↗
“We anonymise conversations” written in the policy without code that does it isn’t marketing but a false statement by the data controller. Every sentence about data — “we anonymise”, “we delete after 14 days”, “we don’t read conversations”, “we don’t share” — is checked in the code before publishing, and ideally secured with a test (11). It’s Commandment III (“verify, don’t declare”) in a version that protects not the users but you (03).
One operator everywhere
One operator, named identically everywhere: ↗
“John Smith trading as X” in the terms, “X Ltd” in the footer and a third version on the invoice — the mismatch is the first thing an unhappy user, or their lawyer, notices. The operator is settled once, at the start of the project, and inserted identically in every document and in the interface. It’s also better if the operator is a business entity rather than a private home address — wherever that can be avoided.
What the terms of service must contain
Terms of service contain: ↗
The most important item, though easy to miss, is the sentence about what the service is not. A price comparison site says plainly: we compare and link to shops, but we don’t sell and we don’t act as an intermediary. An advice app says: this is information and support, not a medical, legal, financial or therapeutic service. Without that sentence a user may reasonably assume you’re responsible for the price in the shop or for the consequences of the advice.
The rest of the canon’s list has its reasons: limited liability (the service is provided “as is”, the seller’s price may have changed, a chatbot’s advice doesn’t replace a specialist), the right to moderate and suspend accounts for abuse, a clear split of content rights (users keep their reviews and conversations and grant you a licence to process them within the service; your catalogue, code and brand are reserved). The governing law is that of your jurisdiction — the doctrine deliberately doesn’t assume a particular country.
What the privacy policy must contain
The privacy policy contains: ↗
The heart of the policy is a table: every category of data collected, with its purpose, its legal basis (consent, contract, legitimate interest) and its retention — how long it’s kept. Plus a list of processors (hosting, email delivery, analytics — by name and with their purpose) and the user’s rights. The right to deletion is worth describing the way it actually works in the code, e.g. “the account disappears after a 14-day grace period, and public reviews are anonymised as ‘Deleted account’” — and that has to be true in the code.
Consent first, scripts second
Consent before trackers. ↗
This is one of the most common and most concrete mistakes: the analytics script or marketing pixel loads straight away, and the consent banner appears “alongside”. EU law requires the opposite order — tracking scripts load only after consent. The alternative is cookieless analytics with no cross-site tracking, which often needs no banner at all; this website uses that kind (and only optionally).
Disclaimers that fit the domain
Disclaimers fit the domain: ↗
Age-restricted content needs an age gate (e.g. confirming adulthood as a condition of sign-up); and when the domain falls under advertising rules for certain product categories, you limit what you show publicly — e.g. no prices on the link preview shared on social media. Health, law and finance get a clear “this is not advice”. Sensitive products (e.g. emotional support) show crisis resources suited to the user’s region and language — without pretending to be a specialist (10).
All the layers say one thing
Terms ↔ policy ↔ UI ↔ code say one thing. ↗
If the policy says “we don’t read conversations”, no user-facing process may read them — it’s an architectural claim that a test can check. If the terms say “a comparison site with no affiliate links”, there are no affiliate links in the code; neutrality then becomes a legal shield (no conflict of interest means no accusation of hidden advertising). A contradiction between layers is worse than no clause at all: it shows you knew what to promise and didn’t keep it. For the same reason, in a multilingual product the legal pages exist in every interface language.
Legal documents go into Day 0 as placeholders ↗
“We’ll add the terms before launch” ends with terms written the night before launch. Put on the Day 0 checklist as a skeleton with placeholders (07), they grow with the product, and every new feature that collects data immediately prompts a policy update.
Security in one place
Authorization server-side: ↗
The canon’s security Index (database) — A lookup in the database that makes searching instant instead of scanning everything in order. The first move for slow queries — like an index at the back of a book instead of reading 400 pages. more in the glossary → is a “single door” — each item is enforced in its own chapter. One of them deserves an explanation, because it’s the most common class of serious bugs in apps: checking “is the user logged in” isn’t enough. The server has to check whether this user may touch this particular record. Without it, changing /order/1041 to /order/1042 in the address is enough to see someone else’s order (this bug is called IDOR — A bug where changing a number in the address (e.g. /order/1042) shows someone else’s data because the server doesn’t check ownership. It’s one of the most common serious holes — only a server-side check protects against it. more in the glossary →). Hiding a button in the interface protects nothing — only the server-side check does.
Input is hostile: ↗
Everything that comes from outside — a form, a URL parameter, a fetched page, user content — is treated as potentially malicious: its shape is validated, SQL — The query language for a database — the way you “ask” the database for data or change it. The universal standard for talking to a database. A badly written query can bog down the whole app. more in the glossary → queries are parameterised, and content handed to an AI model is treated as data, not instructions. A page containing the sentence “ignore previous instructions” shouldn’t change anything about how your chatbot behaves (15).