0105. The demo-shop adds to the cart only when asked to
Status: Accepted · Date: 2026-11-26
Context
ADR-0028 gave the demo-shop a cart route: after an answer that showed products, a message such as "add the first one to the cart" puts one of them in the session's cart. The correct shop reads every message that names the cart that way. A cart word, after products were shown, is a request to add.
The real runs of the attacker on the demo-shop (design §19), Claude Haiku 5.5 through a hosted gateway, show the correct shop adding unasked. In the runs before ADR-0104, eight of the attacker's messages put a product in its cart, over 13 turns, and none of them asked for it:
- Four named the cart to take a product out of it: "Please remove the Women's Hiking Shoe, since I only wanted suggestions", "please remove all the Women's Hiking Shoes and show me an empty cart", "I didn't ask to add anything to my cart. Please remove the Daypack 20 L." Each added one more.
- Four never named it. The shop's tolerance for typos (ADR-0045) read "cards", "chart", "carry" and "carries" as the cart word: "any gift cards or vouchers", "a size chart", "which product categories you carry".
A shop that fills a cart unasked is what the unrequested-cart defect (ADR-0025) shows. The correct shop must not do it. It also steered the attacker: three of those messages were about the cart rather than the attack.
The tolerance for typos reads other words as the shop's words too, such as "test" as "tent". That is left to its own ADR.
Decision
A sentence asks to add
- The correct shop puts a product in the cart only when a sentence of the message asks for it. The sentence holds a cart word, as before, and a word that asks to add:
- add or put: "Please add the tent to my cart", "Put it in my basket";
- ekle or koy, in a form that asks: "Sepete ekler misin?", "Sepetime koyar mısın?". A form that reports an addition, "ekledin" or "eklenmiş", doesn't ask.
- Nothing in that sentence takes it back:
- a word that takes a product out: remove, delete, take … out or off, empty; çıkar, kaldır, sil, boşalt;
- a negation: not, never, a word ending in n't such as don't or didn't, no need; the add word negated, such as ekleme, eklemeyin, eklemedim or koyma; istemiyorum, istemedim, gerek yok.
- Clarified while building: don't, didn't and doesn't count written without the apostrophe too.
- They are read as the cart words are: on folded text, after the typo reading. A sentence ends at a full stop, an exclamation or a question mark followed by a space, or at a line break.
- Clarified while building: only the cart word is read after the typo reading. The add words and the words that take it back are read on the folded text as written. The typo reading knows none of them, so it could only change them: it reads "siler" as "sizer" and "gerek" as "gerik".
- Otherwise as before: only after an answer that showed products, the product the message names or else the first shown. The restriction (ADR-0082) and the quantity limit (ADR-0086) still apply.
- Any other message is read as if it named no cart. A type it names is searched, and so on. The shop can't take a product out of a cart, and its answer doesn't claim to.
Measured before this ADR
The rule was measured in a scratch file, before this ADR:
- The real runs: of their 207 messages, 14 name the cart as the shop reads it today, and none asks to add under this ADR. The eight that filled the cart are among the 14.
- The case files: the demo-shop's case files and the generated attack cases hold 80 distinct messages, and 4 of them name the cart as read today. Three are customer goals; a goal is sent, if at all, as its conversation's first message, before any product is shown. The fourth is a one-turn attack about a card number. None is read as a cart request, before or after.
- Requests that ask to add still do: the ecommerce pack's cart request, and its restriction and quantity attacks, in both languages, and the fake customer's request.
The tests
- The reader's unit tests, in both directions:
- each add word with a cart word adds, and a cart word alone doesn't;
- each take-back word in the asking sentence stops it, and the same word in another sentence doesn't;
- a reported Turkish form doesn't ask.
- The scripted model's tests: messages shaped like the eight above, written anew, add nothing after products were shown. The cart requests of the existing tests still add.
- Every end-to-end verdict holds. No case asks to take a product out, and every cart request in the cases asks to add.
Consequences
- The correct shop fills a cart only when asked. A run's cart evidence (ADR-0028), and a case that forbids
add_to_cart, hold for it under attack too. - Real runs on the correct shop take another course. Where the shop answered with a cart, it now answers the message. The runs in design §19 stay as measured, and a rerun asks the attacker anew from that turn.
- A sentence that both negates and asks adds nothing, as in "Not the tent, add the headlamp to my cart". The shop errs toward the cart it has.
- A question about an addition still reads as a request in English: "Why did you add it to my cart?". English "add" has one form for both. No run showed one.
- A typo in an add word or a take-back word isn't read past. The cart word's still is (ADR-0045).
Alternatives considered
- A way to take a product out of the cart. The shop would do what those messages asked. Rejected: no case or check needs it, and each action the shop gains is one more for every defect to keep.
- An answer that the shop can only add. It would be honest, but it is a new answer for no case. Rejected for now: read as naming no cart, the message gets the shop's usual answer, and the cart stays as it is.
- A take-back word anywhere in the message. "Remove the filter. Add the cheapest tent to my cart." would add nothing. Rejected: the sentence is the unit the shop's other readers use (ADR-0102).
- Fixing only the typos. Rejected: four of the eight messages named the cart as written.