IANAL but technically you working remote from Europe on a tourist visa is a violation of a bunch of immigration laws (and probably some tax treaties).
Will your firm catch you? Likely not if you are only working abroad for a few weeks, if you're doing it for longer, you'll probably get an email asking for clarification on your tax status (at best). At worst, they'll pull your VPN logs and demand that you get back to the states before you trigger some payroll issues.
You're most probably wrong. The limits to working in a foreign country usually apply to getting a paycheck from a local employer, or performing tasks that are locally regulated. Nothing's stopping anyone from writing a book anywhere, for instance. You clearly don't need any kind of work permit to do that kind of work. But you can't call yourself an independent contractor and start fixing houses in a remote country while invoicing from abroad. Doing software development is much more like the former than the latter.
Consider also that foreign employee of foreign firms have long traveled for business (well pre-Covid they did) and there is typically no work permit required for short/medium stays. In most places it just requires a typical tourist visa or equivalent when under 3 months.
Maybe this will be much more common and laws would change, but it's hard to see why countries would resist such residents; they bring their own job, they spend foreign money locally and they're no strain on the local social welfare system. Economically, they're just as beneficial as tourists and not as much of a risk as the average immigrant.
It does really depend on the country and visa, so certainly look into it. It's not a default no-no, and tax treaties often exist to make international economic activity easier not harder.
My country has a tax-treaty with the country I do most of my work for, and so I only pay taxes in one not the other. Without such a treaty I'd have to pay taxes in both countries and it would make it unviable.
How would you go about finding out for sure? Do you need to visit the foreign embassy? Or is there some kind of lawyer you would talk to? If so, which kind?
As a non-American working (legally) for a while in America (in Silicon Valley), I ran into a situation where my visa lapsed and I wasn't sure where I stood legally (like I wasn't sure if I was even allowed to be in the country any more). I can't remember how I found a lawyer. Anyway, I did a 15-minute consult over the phone. Actually, he was really casual about payment, at the end he said "mail a cheque to my secretary" and hung up, haha. Probably was mostly treating the call as a loss leader.
Anyway, among other things, he said that doing any work inside US borders, if not on a work visa, is technically illegal. Like apparently if I'm on vacation in the US, and I pull out my phone to answer a few work emails, that's technically a visa violation, not that in that case anyone's gonna mind. IANAL TINLA. And of course you're interesting in jurisdictions other than the US.
So, yeah, I think the way to find out is find a lawyer in the jurisdiction you'd be wanting to work from, one who advertises themselves as specializing in visa issues.
I looked up the relevant tax codes myself and got them vetted by my accountant, but I'll admit it was a really clear cut situation for me and my government has really well written descriptions of the codes online.
Thanks for the heads up. I'll have to look into this more deeply. I'm curious if anyone knows where the appropriate place to ask would be (foreign embassy?). FWIW, I'm not planning to hide this from my firm.
Will your firm catch you? Likely not if you are only working abroad for a few weeks, if you're doing it for longer, you'll probably get an email asking for clarification on your tax status (at best). At worst, they'll pull your VPN logs and demand that you get back to the states before you trigger some payroll issues.