Do you remember the Collateral Murder video – the one that showed US air crew in Apache helicopters killing people as though playing computer games, laughing at the dead after slaughtering a dozen people, including two Iraqis working for the Reuters news agency? Do you remember how the US military had lied about what happened in that incident in July 2007 – first claiming that all the dead were insurgents, and then that the helicopters were responding to an active firefight? Neither claim was true. Do you recall that Reuters had spent three years unsuccessfully trying to obtain the video?

Was it in the public interest that the world should have eventually seen the raw footage of what happened? You bet. Was it acutely embarrassing for the US military and government? Of course. Was the act of revelation espionage or journalism? You know the answer.

We have two people to thank for us knowing the truth about how those Reuters employees died, along with 10 others who ended up in the crosshairs of the laughing pilots that day: Chelsea Manning, who leaked it, and Julian Assange, who published it. But the price of their actions has been considerable. Manning spent seven years in jail for her part in releasing that video, along with a huge amount of other classified material she was able to access as an intelligence analyst in the US army. Assange has been indicted on 17 new counts of violating the Espionage Act, with the prospect that he could spend the rest of his life in prison.

As editor of the Guardian, I worked with Assange when we jointly (along with newspapers in the US and Europe) published other material Manning had leaked. Vanity Fair called the resultant stories “one of the greatest journalistic scoops of the last 30 years… they have changed the way people think about how the world is run”. The stories were, indeed, significant – but the relationship with Assange was fraught. We fell out, as most people eventually do with Assange. I found him mercurial, untrustworthy and dislikable: he wasn’t keen on me, either. All the collaborating editors disapproved of him releasing unredacted material from the Manning trove in September 2011. Nevertheless, I find the Trump administration’s use of the Espionage Act against him profoundly disturbing.

Imagine the precedent if the Trump administration gets away with this

The Espionage Act was a panic measure enacted by Congress to clamp down on dissent or “sedition” when the US entered the First World War in 1917. In the subsequent 102 years it has never been used to prosecute a media organisation for publishing or disseminating unlawfully disclosed classified information. Nobody prosecuted under the act is permitted to offer a public interest defence.

Whatever Assange got up to in 2010-11, it was not espionage. Nor is he a US citizen. The criminal acts this Australian maverick allegedly committed all happened outside the US. As Joel Simon, director of the Committee to Protect Journalists, has observed: “Under this rubric, anyone anywhere in the world who publishes information that the US government deems to be classified could be prosecuted for espionage.”

Imagine the precedent if the Trump administration gets away with this. Israel and India have extensive nuclear weapons programmes – each protected by ferocious domestic official secrets acts. Think of the outcry if the Netanyahu or Modi governments attempted to extradite a British or US journalist to face life in jail for writing true things about their nuclear arsenals.

Pentagon Papers whistleblower Daniel Ellsberg in 2010. Photograph: Rex/Shutterstock

The new indictment against Assange falls into three parts – each of them attempting to criminalise things journalists regularly do as they receive and publish true information given to them by sources or whistleblowers. Assange is accused of trying to persuade a source to disclose yet more secret information. Most reporters would do the same. Then he is charged with behaviour that, on the face of it, looks like a reporter seeking to help a source protect her identity. If that’s indeed what Assange was doing, good for him. Finally, he is accused of repeatedly publishing material that “could harm the national security of the US”.

Whenever you read about journalists harming national security, massive alarm bells should start ringing. Think no further than Richard Nixon trying to prosecute the Pentagon Papers whistleblower, Daniel Ellsberg, for harming national security in 1971. Ellsberg, an intelligence analyst, found that the Vietnam war had been prosecuted on the basis of a web of lies and thought the public deserved to know. To Nixon, Ellsberg’s commitment to the truth was treason. He reached for the Espionage Act.

Today Ellsberg is celebrated as a principled whistleblower – but he came close to being jailed for his courage. That the New York Times was free to publish the leaked papers was down to judges. Murray Gurfein, a federal judge, refused an injunction, saying: “The security of the nation is not at the ramparts alone. Security also lies in the value of our free institutions. A cantankerous press, an obstinate press, an ubiquitous press must be suffered by those in authority in order to preserve the even greater values of freedom of expression and the right of the people to know.” Gurfein’s ringing judgment was subsequently endorsed by the supreme court.

We need judges to defend free speech, because governments rarely do. When Theresa May was home secretary in 2015, the Law Commission was asked to review the British laws around official secrecy. In 2017, it recommended reforms that could see journalists prosecuted for simply holding secret material, never mind publishing it. The Commission also sought to deny reporters the ability to advance a public interest defence and suggested jail sentences of up to 14 years. Oh, and it suggested that the “public interest” when it came to national security should be defined by the government of the day. Leave it to Richard Nixon or Donald Trump.

Much may depend on the UK supreme court, which – subject to the home secretary’s deliberations – could well end up deciding this extradition request. Assange is a problematic figure in many ways. But the attempt to lock him up under the Espionage Act is a deeply troubling move that should serve as a wake-up call to all journalists. You may not like Assange, but you’re next.

Alan Rusbridger, a former editor of the Guardian, is now principal of Lady Margaret Hall, Oxford