Editor’s note: This post was originally published on Quora, in answer to the question, “What happens if you commit a crime in space?” We have republished it with permission from the author, NASA space engineer and instructor Robert Frost.
You get arrested when you return to Earth.
The principal basis of determination is the Outer Space Treaty of 1967.
Article VIII of that treaty says:
A State Party to the Treaty on whose registry an object launched into outer space is carried shall retain jurisdiction and control over such object, and over any personnel thereof, while in outer space or on a celestial body.
As far as the ISS [International Space Station] is concerned, there is an Intergovernmental Agreement (IGA) signed by all partners in 1998 that further specifies legal authorities aboard and in the proximity to the ISS: Page on State
Canada, the European Partner States, Japan, Russia, and the United States may exercise criminal jurisdiction over personnel in or on any flight element who are their respective nationals.
In a case involving misconduct on orbit that: (a) affects the life or safety of a national of another Partner State or (b) occurs in or on or causes damage to the flight element of another Partner State, the Partner State whose national is the alleged perpetrator shall, at the request of any affected Partner State, consult with such State concerning their respective prosecutorial interests.
An affected Partner State may, following such consultation, exercise criminal jurisdiction over the alleged perpetrator provided that, within 90 days of the date of such consultation or within such other period as may be mutually agreed, the Partner State whose national is the alleged perpetrator either: (1) concurs in such exercise of criminal jurisdiction, or (2) fails to provide assurances that it will submit the case to its competent authorities for the purpose of prosecution.
There are also documented codes of conduct for astronauts: 14 CFR Part 1214 – SPACE FLIGHT
In addition, if the offender is a member of the U.S. military (as many astronauts are), then they can also be prosecuted under the UCMJ (Uniform Code of Military Justice).