Most travellers who get caught in tourist traps are not naive — they are being polite. Moroccan culture places genuine value on hospitality and extended social interaction, and touts exploit exactly that instinct. Saying no feels rude; following someone for a moment feels like good manners.
The most effective adjustment is a small one: treat any unsolicited approach as neutral rather than friendly. A warm "la, shukran" — no, thank you — delivered without eye contact and while continuing to walk ends 95% of approaches. You do not need to explain yourself, justify your refusal, or engage further. This is not rudeness by local standards; it is simply a clear signal.
It also helps to slow down and eat breakfast at your riad before heading out. Most hustles happen when travellers are slightly disoriented, in a hurry, or hungry. A calm start and an approximate mental map of where you are heading removes the vulnerability that makes these approaches effective.
And if you do end up deep in a souk following someone you wished you hadn’t — it happens, even to experienced travellers — the exit is always available. Browse politely, decline to buy, say shukran, and leave. Nobody is blocked in. The pressure is social, not physical.