AFTER EDIT: To clarify this point a bit, the world of espionage practice distinguishes "operatives" (nationals-employees of the foreign government, who first of all need a visa status even to be in the host country) from "agents" (nationals of the host country, who often have employment status in some sensitive position in the host country's government or armed forces). Yes, the United States and absolutely every country is harsh in its treatment of its own citizens who act as espionage agents directed by the intelligence operatives of foreign countries. Quite a few of the prisoners in the federal SuperMax prison in Colorado are people like John Walker or Robert Hanssen who were paid by the United States taxpayers to handle secret information with discretion and who were pledged by their terms of employment to not have contacts with foreign intelligence operatives at those operatives' direction. Men like that do hard prison time in any country where their activities are discovered. But the foreign operative usually just ends up expelled from the host country, unless there was something illegal in itself about the foreign operative's presence in the host country.