One obvious way to 'fuck up' is to do work with or for a local company. I've also heard rumors that they sometimes check co-working spaces and pick up any 'tourists' that have been renting space there for an extended period of time.
But basically as long you work for a foreign company or clients and don't draw attention to yourself I doubt they care too much.
I've heard of people in Indonesia(Bali) getting caught because they post in public Facebook groups about the work they do, like "Hey guys I'm a yoga instructor/web designer/surf teacher/English teacher and I'm available for hire!"
Thats interesting. I would also find it interesting if they distinguished between e.g. yoga instructor/surf teacher since they are working locally (sounds pretty illegal to me) and remote work like web design. Has anyone further info?
But basically as long you work for a foreign company or clients and don't draw attention to yourself I doubt they care too much.