Most countries would define "working" as earning money from an employer within that country itself, hence depriving citizens of that country of a prospective job.
Basically you're OK as long as you don't get paid for your work there. My friend works in the oil/gas industry and he keeps flying to different countries frequently and works there for almost 3-4 weeks. But he doesn't get paid in that country (he gets some per-diem allowance but that's all).