Annex to the Convention: Regulations respecting the laws and customs of war on land - Section II : Hostilities - Chapter II : Spies - Regulations: Art. 31.
Art. 31. A spy who, after rejoining the army to which he belongs, is subsequently captured by the enemy, is treated as a prisoner of war, and incurs no responsibility for his previous acts of espionage.