Related Rule
New Zealand
Practice Relating to Rule 107. Spies
New Zealand’s Military Manual (1992) defines spies as “people, wearing civilian clothing or otherwise disguised, who collect information clandestinely behind enemy lines or in the zone of operations with the intention of communicating that information to a hostile Party”. 
New Zealand, Interim Law of Armed Conflict Manual, DM 112, New Zealand Defence Force, Headquarters, Directorate of Legal Services, Wellington, November 1992, § 506(2).
New Zealand’s Military Manual (1992) states:
Although spying is not contrary to the law of armed conflict, international law provides that spies, if captured, may be tried in accordance with the law of the captor and may be liable to the death penalty. To punish them without a proper trial is, however, a war crime. The collection of information by persons wearing uniform is a permitted means of conflict and a person so engaged is liable to be fired upon as is any other member of the enemy forces. If captured, such a person is to be treated as a prisoner of war. 
New Zealand, Interim Law of Armed Conflict Manual, DM 112, New Zealand Defence Force, Headquarters, Directorate of Legal Services, Wellington, November 1992, § 506(2) and (3).
The manual adds:
Persons who have evaded capture when carrying out acts of espionage and who have rejoined their own forces or own national authority cannot be charged with such acts if subsequently captured; if they are members of armed forces they must be treated as prisoners of war. 
New Zealand, Interim Law of Armed Conflict Manual, DM 112, New Zealand Defence Force, Headquarters, Directorate of Legal Services, Wellington, November 1992, § 506(4).