Règle correspondante
Practice Relating to Rule 107. Spies
Section B. Status of spies
Switzerland’s Basic Military Manual (1987) states:
International law applicable in armed conflict does not prohibit the use of spies and secret agents, who can even be soldiers or civilians of enemy nationality. Nevertheless, upon their capture or arrest, these persons are liable to be sentenced severely, according to the domestic law of the State concerned … A spy who is caught in the act may not be sentenced without previous judgment. 
Switzerland, Lois et coutumes de la guerre (Extrait et commentaire), Règlement 51.7/II f, Armée Suisse, 1987, Articles 41(2) and 43.
Switzerland’s Regulation on Legal Bases for Conduct during an Engagement (2005) states:
220 Gathering information and conducting reconnaissance are permissible at any time. If, when gathering information while in uniform, combatants fall into the hands of the enemy, they must be treated as prisoners of war.
221 Gathering information in a clandestine manner or under a false pretext (e.g. in civilian attire or enemy uniform) is considered espionage. Spies are subject to the criminal law of the State that arrests them (in Switzerland: the Military Criminal Code) and face severe penalties after their arrest. They are not entitled to prisoner-of-war status.
222 Acts of sabotage (i.e. harmful acts committed behind enemy lines) are permitted, as long as they are carried out by combatants in uniform and are aimed exclusively at military objectives. If captured, combatants who have committed acts of sabotage are entitled to prisoner-of-war status. 
Switzerland, Bases légales du comportement à l’engagement (BCE), Règlement 51.007/IVf, Swiss Army, issued based on Article 10 of the Ordinance on the Organization of the Federal Department for Defence, Civil Protection and Sports of 7 March 2003, entry into force on 1 July 2005, §§ 220–222.
Switzerland’s ABC of International Humanitarian Law (2009) states:
Prisoners of war
Spies on the other hand are not normally granted prisoner of war status.
A spy is a person who secretly attempts to obtain information of military importance in enemy controlled territory. Spies operating in civilian clothes are not entitled to the status of Combatants and if captured are not accorded the status of Prisoners of war. Spies in uniform on the other hand do count as combatants and are to be accorded prisoner of war status if captured. 
Switzerland, Federal Department of Foreign Affairs, ABC of International Humanitarian Law, 2009, pp. 34–35 and 38.