Then we'll have a nice discussion about whether it is or not (or we ask the legal team). If it's legal then it's still up to me whether I find it okay, and then it's really my personal choice if I want to leave the company over this or if I want to try to get someone else to implement it or whatever. However, that wasn't really the point being discussed.
I was specifically talking about the scenario where you're asked to do something illegal and immoral, and its illegality is not disputed by the boss or legal team or something.
what happens when xyz isn’t illegal?