The International Legal View of Espionage

Does espionage operate on a legal-until-caught basis? This depends on how states – and international law – conceptualise state sovereignty.