Espionage against a nation is a crime under the
legal code of many world states.
Espionage law in the United States In the United States, it is covered by the
Espionage Act of 1917. The risks of espionage vary. A spy violating the host country's laws may be deported, imprisoned, or even executed. A spy violating its own country's laws can be imprisoned for espionage or/and
treason (which in the United States and some other jurisdictions can only occur if they take up arms or aids the enemy against their own country during wartime), or even executed, as the
Rosenbergs were. For example, when
Aldrich Ames handed a stack of dossiers of U.S.
Central Intelligence Agency (CIA) agents in the
Eastern Bloc to his KGB-officer "handler", the KGB "rolled up" several networks, and at least ten people were secretly shot. When Ames was arrested by the U.S.
Federal Bureau of Investigation (FBI), he faced life in prison; his contact, who had
diplomatic immunity, was declared
persona non grata and taken to the airport. Ames' wife was threatened with life imprisonment if her husband did not cooperate; he did, and she was given a five-year sentence.
Hugh Francis Redmond, a CIA officer in China, spent nineteen years in a Chinese prison for espionage—and died there—as he was operating without diplomatic cover and immunity. In United States law, treason, espionage, and spying are separate crimes. Treason and espionage have graduated punishment levels. The United States in
World War I passed the Espionage Act of 1917. Over the years, many spies, such as the
Soble spy ring,
Robert Lee Johnson,
the Rosenberg ring,
Aldrich Hazen Ames, Ames was formerly a 31-year
CIA counterintelligence officer and analyst who committed espionage against his country by
spying for the
Soviet Union and
Russia. So far as it is known, Ames compromised the second-largest number of CIA agents, second only to
Robert Hanssen, who also served a prison sentence until his death in 2023.
Use against non-spies Espionage laws are also used to prosecute non-spies. In the United States, the Espionage Act of 1917 was used against socialist politician
Eugene V. Debs (at that time the Act had much stricter guidelines and amongst other things banned speech against military recruiting). The law was later used to suppress publication of periodicals, for example of
Father Coughlin in
World War II. In the early 21st century, the act was used to prosecute
whistleblowers such as
Thomas Andrews Drake,
John Kiriakou, and
Edward Snowden, as well as officials who communicated with journalists for innocuous reasons, such as
Stephen Jin-Woo Kim. , India and Pakistan were holding several hundred prisoners of each other's country for minor violations like trespass or visa overstay, often with accusations of espionage attached. Some of these include cases where Pakistan and India both deny citizenship to these people, leaving them
stateless. The BBC reported in 2012 on one such case, that of Mohammed Idrees, who was held under Indian police control for approximately 13 years for overstaying his 15-day visa by 2–3 days after seeing his ill parents in 1999. Much of the 13 years were spent in prison waiting for a hearing, and more time was spent homeless or living with generous families. The Indian
People's Union for Civil Liberties and
Human Rights Law Network both decried his treatment. The BBC attributed some of the problems to tensions caused by the
Kashmir conflict.
Espionage law in the UK From ancient times, the penalty for espionage in many countries was execution. This was true right up until the era of
World War II; for example,
Josef Jakobs was a Nazi spy who parachuted into Great Britain in 1941 and was executed for espionage. Espionage is illegal in the UK under the
National Security Act 2023, which repealed prior Official Secrets Acts and creates three separate offences for espionage. A person is liable to be imprisoned for life for committing an offence under Section 1 of the Act, or 14 years for an offence under Sections 2 and 3.
Government intelligence law and its distinction from espionage Government intelligence is very much distinct from espionage, and is not illegal in the UK, providing that the organisations of individuals are registered, often with the ICO, and are acting within the restrictions of the Regulation of Investigatory Powers Act (RIPA). 'Intelligence' is considered legally as "information of all sorts gathered by a government or organisation to guide its decisions. It includes information that may be both public and private, obtained from much different public or secret sources. It could consist entirely of information from either publicly available or secret sources, or be a combination of the two." However, espionage and intelligence can be linked. According to the MI5 website, "foreign intelligence officers acting in the UK under diplomatic cover may enjoy immunity from prosecution. Such persons can only be tried for spying (or, indeed, any criminal offence) if diplomatic immunity is waived beforehand. Those officers operating without diplomatic cover have no such immunity from prosecution". There are also laws surrounding government and organisational intelligence and surveillance. Generally, the body involved should be issued with some form of warrant or permission from the government and should be enacting their procedures in the interest of protecting national security or the safety of public citizens. Those carrying out intelligence missions should act within not only RIPA but also the Data Protection Act and Human Rights Act. However, there are spy equipment laws and legal requirements around intelligence methods that vary for each form of intelligence enacted.
Military intelligence and military justice by
Alphonse de Neuville, 1880 In war, espionage is considered permissible as many nations recognize the inevitability of opposing sides seeking intelligence each about the dispositions of the other. To make the mission easier and successful,
combatants wear
disguises to conceal their true identity from the enemy while penetrating enemy lines for intelligence gathering. However, if they are caught behind enemy lines in disguises, they are not entitled to
prisoner-of-war status and subject to
prosecution and punishment—including
execution. The
Hague Convention of 1907 addresses the status of wartime spies, specifically within "Laws and Customs of War on Land" (Hague IV); October 18, 1907: Chapter II Spies". Article 29 states that a person is considered a spy who, acts clandestinely or on false pretences, infiltrates enemy lines with the intention of acquiring intelligence about the enemy and communicate it to the
belligerent during times of war. Soldiers who penetrate enemy lines in proper uniforms for the purpose of acquiring intelligence are not considered spies but are
lawful combatants entitled to be treated as prisoners of war upon capture by the enemy. Article 30 states that a spy captured behind enemy lines may only be punished following a trial. However, Article 31 provides that if a spy successfully rejoined his own military and is then captured by the enemy as a lawful combatant, he cannot be punished for his previous acts of espionage and must be treated as a prisoner of war. This provision does not apply to citizens who committed
treason against their own country or co-belligerents of that country and may be captured and prosecuted at any place or any time regardless whether he rejoined the military to which he belongs or not or during or after the war. The ones that are excluded from being treated as spies while behind enemy lines are escaping prisoners of war and downed
airmen as
international law distinguishes between a disguised spy and a disguised escaper. It is permissible for these groups to wear enemy uniforms or civilian clothes in order to facilitate their escape back to friendly lines so long as they do not attack enemy forces, collect military intelligence, or engage in similar military operations while so disguised. Soldiers who are wearing enemy uniforms or civilian clothes simply for the sake of warmth along with other purposes rather than engaging in espionage or similar military operations while so attired are also excluded from being treated as unlawful combatants. For example, during
World War II, eight German agents entered the U.S. in June 1942 as part of
Operation Pastorius, a sabotage mission against U.S. economic targets. Two weeks later, all were arrested in civilian clothes by the
FBI thanks to two German agents betraying the mission to the U.S. Under the Hague Convention of 1907, these Germans were classified as spies and tried by a
military tribunal in
Washington D.C. On August 3, 1942, all eight were found guilty and sentenced to death. Five days later, six were executed by
electric chair at the District of Columbia jail. Two who had given evidence against the others had their sentences reduced by President
Franklin D. Roosevelt to prison terms. In 1948, they were released by President
Harry S. Truman and deported to the
American Zone of occupied Germany. Eighteen German soldiers were shot by the
United States Army after being caught in American uniform as part of
Operation Greif during the
Battle of the Bulge in 1944. In June 1945, after Germany had been occupied by the allies, the US Army executed six individuals, including two German youths aged 16 and 17, for espionage committed against American forces during the final stages of
World War II. The U.S. codification of enemy spies is Article 106 of the
Uniform Code of Military Justice. This provides a mandatory death sentence if a person captured in the act is proven to be "lurking as a spy or acting as a spy in or about any place, vessel, or aircraft, within the control or jurisdiction of any of the armed forces, or in or about any shipyard, any manufacturing or industrial plant, or any other place or institution engaged in work in aid of the prosecution of the war by the United States, or elsewhere". ==Spy fiction==