In The Martian, astronaut Mark Watney and his crewmates onboard the Hermes face a relentless series of challenges in order to rescue Watney from the harsh surface of Mars and return him home. For the most part, these challenges are technical and scientific – how do you grow food on Mars? How much fuel is needed to alter a spaceship’s orbit? How much disco can one man listen to before he goes insane?

Because explanatory journalism is all the rage, the internet is chock-full of explainers which discuss the relative plausibility of the scientific solutions they come up with. Which is a good thing, because despite a life-long love of space, your humble correspondent is grossly unqualified to challenge the science behind The Martian.

But in the (distant) background of the technical challenges, both Watney and the crew of the Hermes must confront legal challenges as well. And this particular newly-minted lawyer/former pirate-hunter is more than happy (and at least nominally qualified) to discuss the plausibility of these instead.

Let’s law the s**t out of this thing.

Is Mark Watney really a space pirate?

As he sets out on his months long journey from the HAB to the Mars Ascent Vehicle, Matt Damon demands that NASA refer to him by his new name “Captain Blondebeard.” This is in honor of both his fresh new alone-on-a-planet beard and the legal conclusion he’s come to:

“I’ve been thinking about laws on Mars. There’s an international treaty saying that no country can lay claim to anything that’s not on Earth. By another treaty if you’re not in any country’s territory, maritime law aplies. So Mars is international waters. Now, NASA is an American non-military organization, it owns the Hab. But the second I walk outside I’m in international waters. So Here’s the cool part. I’m about to leave for the Schiaparelli Crater where I’m going to commandeer the Ares IV lander. Nobody explicitly gave me permission to do this, and they can’t until on board the Ares IV. So I’m going to be taking a craft over in international waters without permission, which by definition… makes me a pirate. Mark Watney: Space Pirate.”

So there’s a couple leaps of logic here, and Watney is at least on the right track because he realizes there are (at least) two separate questions behind every legal issue:

First, what law applies?

And second, what does that law say?

Watney concludes that the Law of the Sea applies to his situation. This probably isn’t quite right. Though the so-called “Moon Treaty” explicitly attempted to model the Law of Space on the Law of the Sea, that Treaty has thus far been signed by only a handful of nations, none of which have their own ability to launch astronauts into space – and doesn’t include the United States, so it’s not binding on Watney. While there *is* a treaty that says no nation will lay claim to any celestial body, that doesn’t mean that maritime law neccesarily applies: Antarctica isn’t owned by any nation, but that doesn’t mean the Law of the Sea applies to the South Pole, it just means that treaty law and international agreements govern.

As a result, figuring out what law applies as a general matter on the entire surface Mars is actually a fairly tricky (and mostly unresolved) question.

But good news! We can actually dodge the hard question and answer an easy one, because as it turns out, all that really matters is the law that governs the MAV (the lander that Watney is going to “pirate”). The Outer Space Treaty of 1967 (to which the U.S. and most other space-faring nations are party), provides that when a State like the U.S. launches an object into space, the U.S. would “retain jurisdiction and control over such object, and over any personnel thereof, while in outer space or on a celestial body.”

So it doesn’t matter that the MAV is unmanned – it’s still U.S. property and U.S. law still applies onboard. This means that he’s not really a pirate: he’s a U.S. government employee making use of U.S. government property. At most, he’d be guilty of some version of misappropriation or theft of government property, but he wouldn’t be a pirate.

Even if the Law of the Sea or some similar regime did apply, Watney still probably can’t live up to the fearsome reputation that’s implied by his self-given title of Captain Blondebeard. He says that he’s a pirate because he’s taking a craft without permission in international waters. Mere theft or taking of a vessel, however, isn’t technically piracy. Piracy is defined as robbery at sea, see, e.g. U.S. v. Furlong, 18 U.S. 184 (1820), and robbery requires the use of force or threat of force.

So if you find a boat drifting out in the ocean and take it without permission, you’re not necessarily a pirate, because you didn’t use force or threat (though you may have broken other admiralty laws). Similar principles would presumably apply here – the MAV is unmanned, so oboviously no force or threats are required. Even if the MAV had belonged to Russia or China (like the various spacecraft commandeered by Sandra Bullock’s character in Gravity), he could probably take it without technically being a pirate, because the act would be at most theft, not robbery.

Even better, whatever crime Watney is guilty of by “stealing” the MAV, he has an extremely strong case for a necessity defense. Necessity provides that a crime can be justified and excused if committing the criminal act was necessary to prevent some greater harm to the defendant or others: the canonical example is borrowing your neighbor’s garden hose to put out a fire. Here, Watney probably meets all of the elements – there was no adequate legal alternative, stealing the MAV didn’t create any greater harms, and Watney did not substantially contribute to the emergency in the first place.

So never fear Captain Blondebeard – you are almost certainly safe from prosecution for stealing the MAV. But will Watney’s colleagues on the Hermes be so lucky?

Could the crew on the Hermes really be subject to court martial for mutiny?

Millions of miles away from Mars, Commander Lewis (played by Jessica Chastain) and the crew of the Hermes are faced with a similar question of law-breaking. After receiving a coded message, the Hermes crew discovers that NASA has decided not to alter the trajectory of the Hermes so that they can go recover Watney, opting instead for a last-ditch effort to send Watney a rocket full of food. Realizing that the “Rich Purnell” maneuver has a much better chance of success, the crew discusses whether to disobey NASA’s decision.

During the discussion, Commander Lewis notes that as military members, her and Michael Peña’s Major Martinez could be subject to court martial if they execute the maneuver – they are subject to the military code, and defying NASA in this way could be seen as “mutiny.”

Here, Commander Lewis is much closer to the truth than Watney’s piracy-analysis. Despite being on a civilian mission, Commander Lewis and Major Martinez are most definitely subject to the Uniform Code of Military Justice (UCMJ), which applies to all military personnel regardless of where they might go.

The question, then, is whether or not taking control of the Hermes is really a “mutiny.” Article 94 of the UCMJ defines the crime, and provides that any person subject to the UCMJ who “with intent to usurp or override lawful military authority, refuses, in concert with any other person, to obey orders or otherwise do his duty . . . is guilty of mutiny.”

That probably fits what Commander Lewis and Major Martinez do. They are definitely acting in concert, and their action is at the very least against NASA’s intent that they continue with the mission as planned. There are two wrinkles, however,

First, at the time Commander Lewis gives the order to defy NASA, they haven’t actually received any orders yet – NASA hasn’t told them anything, so NASA hasn’t technically ordered them not to fire the engines and execute the maneuver. And second, we don’t know is how much implicit authority Commander Lewis, as Commanding Officer of the Hermes, has in piloting the ship. It may be that NASA has a standing order which says “thou shalt not fire the engines without permission,” in which case, yeah, mutiny. But it’s also possible that the commander of the mission has been given broad discretion to maneuver the vessel as she deems necessary to accomplish the mission, or as is key here – to rescue a member of her crew. In that case, the lack of a contrary order by NASA could provide a defense to mutiny.

The problem with this argument is that Commander Lewis’ actions show that she clearly intended to defy the authority of NASA, whether they had given an explicit order or not: disabling the communications systems and remote override demonstrate that pretty clearly. While the commander of a interplanetary-spacecraft would probably be given a lot of latitude, there’s almost certainly some sort of caveat along the lines of “if you can contact NASA before acting, do that first.” So if the US Government were so inclined, Commander Lewis and Major Martinez could get some handcuffs along with that ticker tape parade when they come home.

The “good” news is that they wouldn’t necessarily be alone! Commander Lewis implies that only the military members of the spacecraft are subject to the Uniform Code, but she might be wrong on that score. Civilians are not normally subject to the Code, but there is a narrow exception for “persons serving with or accompanying an armed force in the field” during wartime or a “contingency operation.” While that authority usually only extends to the battlefield, you could probably argue that the Hermes is the equivalent of a warship, and that a manned mission to space is exactly the sort of “contingency” operation which requires at least the potential for the imposition of military discipline. So the entire crew of the Hermes could technically be guilty of mutiny.

The real good news is that politics usually wins out over technical legal arguments. Commander Lewis and her crew can be pretty confident that neither she nor anyone else will never be prosecuted for their decision, because it would be too embarrassing to admit that the astronauts had defied authority in this way. Indeed, in the book and movie, NASA pretends that the Purnell maneuver had been the plan all along, and presumably the “mutiny” is never brought up again.

So never fear, astronauts – you focus on sciencing the s**t out of things, we’ll handle the law, and we can all come home safe.

The author is an officer in the US Navy, but the opinions expressed in this article are solely his own, and do not reflect those of the United States Navy, Department of Defense, or US Government. The legal opinions offered in this article are provided for informational and entertainment purposes only, and should not be relied on during any future voyages to sea and/or space.