Related Rule
Ukraine
Practice Relating to Rule 107. Spies
Ukraine’s IHL Manual (2004) states:
Spies are persons who, acting secretly or by deceit, gather (or attempt to gather) information in the territory controlled by a party to the armed conflict with the purpose of further transmission of information to the adverse party. 
Ukraine, Manual on the Application of IHL Rules, Ministry of Defence, 11 September 2004, § 1.2.25.1.
Ukraine’s IHL Manual (2004) states:
1.2.25. Spies … are unlawful participants of the hostilities.
1.2.25.1. … A member of the armed forces of a Party to the armed conflict who, on behalf of that Party and in territory controlled by an adverse Party, gathers or attempts to gather information (e.g. reconnaissance scout) shall not be considered as engaging in espionage if, while so acting, he is in the uniform of his armed forces.
A member of the armed forces of a Party to the armed conflict who is a resident of territory occupied by an adverse Party and who, on behalf of the Party on which he depends, gathers or attempts to gather information of military value within that territory shall not be considered as engaging in espionage unless he does so through an act of false pretences or deliberately in a clandestine manner. Moreover, such a resident shall not lose his right to the status of prisoner of war and may not be treated as a spy unless he is captured while engaging in espionage.
A member of the armed forces of a Party to the armed conflict who is not a resident of territory occupied by an adverse Party and who has engaged in espionage in that territory shall not lose his right to the status of prisoner of war and may not be treated as a spy unless he is captured before he has rejoined the armed forces to which he belongs.
1.2.25.2. … Spies … shall not have the right to be a prisoner of war and are subject to punishment for their actions. However, their punishment may only be imposed by a competent tribunal. 
Ukraine, Manual on the Application of IHL Rules, Ministry of Defence, 11 September 2004, §§ 1.2.25, 1.2.25.1 and 1.2.25.2.