Related Rule
United Kingdom of Great Britain and Northern Ireland
Practice Relating to Rule 107. Spies
The UK LOAC Pamphlet (1981) defines spies as “persons who, acting clandestinely or on false pretences, gather information in the territory of a belligerent with intent to communicate it to the enemy”. 
United Kingdom, The Law of Armed Conflict, D/DAT/13/35/66, Army Code 71130 (Revised 1981), Ministry of Defence, prepared under the Direction of The Chief of the General Staff, 1981, Section 3, p. 9, § 6.
The UK LOAC Manual (2004) defines a spy as a “person who, acting clandestinely or on false pretences obtains or endeavours to obtain information in territory controlled by an adverse party, with the intention of communicating it to the opposing party”. 
United Kingdom, The Manual of the Law of Armed Conflict, Ministry of Defence, 1 July 2004, § 4.9.1.
The UK Military Manual (1958) states:
Regular members of the armed forces who are caught as spies are not entitled to be treated as prisoners of war. But they would appear to be entitled, as a minimum, to the limited privileges conferred upon civilian spies or saboteurs by [Article 5 of the 1949 Geneva Convention IV]. 
United Kingdom, The Law of War on Land being Part III of the Manual of Military Law, The War Office, HMSO, 1958, § 96.
The manual also states: “In addition to the ‘grave breaches’ of the 1949 [Geneva] Conventions, … the following are examples of punishable violations of the laws of war, or war crimes: … killing without trial of spies”. 
United Kingdom, The Law of War on Land being Part III of the Manual of Military Law, The War Office, HMSO, 1958, § 626(l).
The UK LOAC Pamphlet (1981) provides:
Those captured while engaged in espionage do not have PW [prisoner-of-war] status but may not be punished without trial. If members of the armed forces gather intelligence in occupied territory they may not be treated as spies provided that they are in uniform. Even if not in uniform, members of the armed forces who were involved in spying cease to be spies as soon as they return to their own lines. If subsequently captured they cannot be punished for their previous spying activities. 
United Kingdom, The Law of Armed Conflict, D/DAT/13/35/66, Army Code 71130 (Revised 1981), Ministry of Defence, prepared under the Direction of The Chief of the General Staff, 1981, Section 3, pp. 9–10, § 6.
The UK LOAC Manual (2004) states:
“Any member of the armed forces of a Party to the conflict who falls into the power of an adverse Party while engaging in espionage shall not have the right to the status of prisoner of war and may be treated as a spy.” Nevertheless, he is to be treated humanely and his trial must respect established judicial safeguards. A spy may not be punished without first having been tried and convicted. 
United Kingdom, The Manual of the Law of Armed Conflict, Ministry of Defence, 1 July 2004, § 4.9.
The manual specifies:
A person who falls into the hands of an adverse party while engaging in espionage, does not have the right to the status of prisoner of war, although it may be given at the discretion of the detaining power. Even without the status of prisoner of war, a spy may only be subjected to punishment after trial by a court applying the prescribed safeguards. Captured spies remain entitled to the basic humanitarian guarantees provided by Additional Protocol I. 
United Kingdom, The Manual of the Law of Armed Conflict, Ministry of Defence, 1 July 2004, § 8.13.
In its chapter on the enforcement of the law of armed conflict, the manual further states:
16.27. The Hague Regulations 1907 are now recognized as part of customary law. …
16.28. … [T]he Hague Regulations forbid … the punishment of spies without proper trials. 
United Kingdom, The Manual of the Law of Armed Conflict, Ministry of Defence, 1 July 2004, §§ 16.27–16.28.
In its judgment in the Sandrock case (Almelo Trial) in 1945, the UK Military Court at Almelo held that “killing captured members of the opposing forces or civilian inhabitants of occupied territories suspected of espionage … unless their guilt had been established by a court of law” amounts to a war crime. On this basis, it found the accused guilty of the killing without trial of a British soldier who was alleged to be a spy. 
United Kingdom, Military Court at Almelo, Sandrock case (Almelo Trial), Judgment, 24–26 November 1945.