The foreign master would have to be an enemy of the US, and the action would have to have something to do with battling the US in a war or other military pursuit. CIA guys working for British intelligence would be traitors but not enemy combatants. Working for the Muslim Brotherhood or No Name’s friends in Syria, they might be.
Like the upper level cabal guys right? We are in a state of war, the hotness of which is hard to determine. But it is part of our current national policy. Those participating in the activities constituting the war without a governmental sanction are by definition unlawful combatants, IAW LOAC. Treasonous behavior is apart from unlawful participation.
There is no such distinction in LOAC. Obviously the mission of the US mil includes 'domestic enemies'.