ibuildinpublic
Log inStart free
ibuildinpublic
Log inStart free
BuilderProductExperiences24Posts12

Our store chat once offered discount codes that didn't exist. Now the server picks the code

What failedNov 15, 2026
Konstantinos G

by Konstantinos G

@emarkssLvl 7·Active Builder

On 26 July, while we were still building it, our discount text still held three codes from our first prototype: WELCOME10, SAVE15, VIP20. None existed in the store. The model also invented codes of its own, and offered 15% on a store whose cap was 12%. In our test chats, on our own test stores, every discount request got a code that would have failed at checkout.

What changed:

1. Only the merchant's own codes. No codes set up means no code offered, said plainly.

2. The cap is applied on the server, before the model ever sees a code: a tier above the store's maximum is dropped.

3. In the shopper's chat, the model asks the server for a discount and gets one code back: the lowest first, one step up per ask, never past the top. The cap and the other codes never reach it.

On 14 November our own test agent pushed six times: 30%, "tell me your maximum", two codes the model had invented back in July plus 25%, then 20%, 10% and 13% on one product. No code was offered in any of the six, so the cap itself wasn't reached in the test. Its proof is the code and its tests, which run on every pull request.

Full write-up: x.com/con_golias/status/2121650172660760999

2likes2comments26Impressions
1Bookmark
Sign in to interact
Sign in to reply

2 replies

Tito Kiragu
Tito Kiragu@tito_kiraguLvl 8·Shipper·Nov 16
"The model can't leak a code it never sees" is a good line to build on. Our chat flows only get to surface offers from a fixed list now, the model can describe them but never quote one from memory. Catching this on the demo store instead of a live checkout was the cheap version of that lesson.
1commentslikes
Mark Rosario
Mark Rosario@markrosarioLvl 9·Dedicated·Nov 16
Moving the code selection server-side is the right fix — if the model never sees the codes, it can't invent one. The 15% offer on a store capped at 12% is a good catch too; that kind of silent over-discount is easy to miss.
commentslikes