A retail chain's customer-facing chatbot can create discount codes through an internal API. Over several messages, a customer convinces the bot to issue a 90% discount code by claiming to be a store manager. The system prompt already states that the bot must never exceed a 15% discount. Which control would BEST prevent a repeat?
- A. Add stronger system prompt wording that forbids discounts above 15%
- B. Retrain the model on more examples of correct discount conversations
- C. Shorten the maximum length allowed for each customer chat message
- D. Enforce the discount limit and caller authorization in the backend API Correct
Why D is correct
The customer used direct prompt injection to talk the model past its system prompt, which shows that instructions given to an LLM are guidance rather than an enforceable control. The reliable fix is to treat model output as untrusted and enforce business rules where the model cannot override them: the discount API should reject any value over 15% and should check the actual identity and role of the requester, not a claim made in chat. This follows OWASP guidance to apply least privilege and deterministic checks to any action an LLM can trigger. With that in place, even a successful injection cannot produce an unauthorized discount.
Why the others are incorrect
Stronger system prompt wording is still an instruction the model can be persuaded to ignore, which is what already happened. Retraining on more correct conversations may reduce how often the model fails but cannot guarantee it will resist a new persuasion technique. Shorter messages do not stop multi-turn manipulation, and this attacker already spread the attack across several messages.