Outgoing President Barack Obama required some nerve to commute Chelsea Manning, the former U.S. military intelligence analyst who was responsible for a 2010 leak of classified materials to anti-secrecy group WikiLeaks. Manning, previously known as U.S. Army Private First Class Bradley Manning, was clearly guilty of violating the Espionage Act, the main charge against her. The 35-year sentence was designed not so much to punish Manning, as to warn others in the services against following her lead, with possibly disastrous consequences.

U.S. soldier Chelsea Manning, who was born male but identifies as a woman, imprisoned for handing over classified files to pro-transparency site WikiLeaks, is pictured dressed as a woman in this 2010 photograph obtained on August 14, 2013.Courtesy U.S. Army/Handout via REUTERS

As Manning admitted while accepting guilt for ten of the charges against her, uploading 250,000 diplomatic cables and many thousands of battlefield reports into WikiLeaks, whose purpose – according to its creator, Julian Assange, is to destabilise governments – was not a good idea.

But in a democratic society, the day-to-day relationship between the state and the news media only partly depends on the law: it is also a series of bargains. This is especially true in the United States, which has probably the world’s greatest commitment to journalistic freedom. If a news organisation discovers a secret, or receives a leak, it usually faces no state intervention – unlike the leakers, who under the Obama presidency were pursued with greater zeal than previously, in part because leaking, aided by digital technology, was more common. The first amendment to the U.S. constitution, which ensures press freedom, is interpreted strictly, and freedom generally upheld.

So there’s precedent for taking a view of a leak – even, by a stern president, of the leaker – which departs from the law’s severity. And much of the material which Manning put into the public domain was in the public interest. It included a video of U.S. soldiers in a helicopter firing on a group in a Baghdad street – killing 12 people, including two Reuters employees.

There were intelligence reports assessing the prisoners held without trial in the Guantanamo prison camp, which make grim reading. The diplomatic cables make up a rich haul of unbuttoned assessments of foreign leaders and threats. The battlefield reports or “war logs” revealed the fog of war, in some cases dramatically – and were the main cause of concern by the military that dangerous information was contained within them.

Yet at Manning’s trial Brigadier General Robert Carr, by then retired, said no deaths could be attributed to the leaks. Other damage was more plausible, with foreign leaders angered by the revelations of U.S. diplomats’ view of them. But most such officials are realists, and will have been well-aware – perhaps through their own secret services – of the U.S. view of them as individuals. What concerns them is the U.S. government’s attitude toward their country: the extent of its hostility, its commitment to them as allies, its willingness to fund them.

Despite the significance of her crimes, it was always quite hard to see Manning as other than a butterfly broken on a wheel. Her parents were divorced, her mother, who was Welsh, was a heavy drinker and attempted suicide – as Manning herself has done twice in prison in the past year. She was gay: had come out in her teens, but had kept it relatively quiet because of fear of bullying.

She was a computer whiz who had, like Assange, retreated into the internet as a child. When examined by the army, she was found to have skill enough to be assigned to duty as an intelligence analyst. Deployed to Iraq, reading the war logs and other material, she became disillusioned about the U.S. presence there and in Afghanistan. Reading an army counter-intelligence report on WikiLeaks, she noted, as she said in a statement made at her pre-trial hearing, that it “seemed to be dedicated to exposing illegal activities and corruption”.

She was caught between two sharply differing worlds: that of the military, to which she had sworn loyalty, and that of WikiLeaks and its supporters, for whom the U.S. Army was at least a virtual enemy. The knowledge she was gaining, she wrote, “burdens me emotionally”. Leaking was to unburden herself: she describes a feeling relief after her first transmission of files.

The belief that she should “spark a domestic debate” was admirable: yet she could not know how the material would be used, and thus, if un-redacted, could endanger her army comrades, or others serving the United States. She was caught up in personal, emotional struggles which rendered duty less real, a betrayal of her oath less a momentous act than an emotional unburdening. For the military, such considerations were irrelevant. The stiff sentence said to others who might be thinking of emulation – here’s what you can expect.

What will the new commander-in-chief make of this? He’s said to be “troubled” by the commuting of the sentence. Constitutional scholars believe it would be hard, but not impossible, to repeal the decision – but Trump might take on the task to please the military.

This is, for Trump, a tangled web. He has expressed guarded approval of Assange for leaking the Democratic National Committee emails, which embarrassed Hillary Clinton; his position was followed more enthusiastically by former Alaskan governor Sarah Palin and the Fox News commentator Sean Hannity. Yet Manning’s document theft put WikiLeaks and Assange on the map, giving them both a prominence they have never lost.

But Trump spoke then, as always, from no understanding of U.S. policy or security. His comments are of the moment, usually designed to further or protect his own interests – his approval of Assange is part of his campaign against the intelligence services for sharing a report alleging sexual adventures in Moscow.

So lightly considered are his pronouncements that they can be reversed as easily as made. The Manning case is an early test of how far he can transform himself, and see the power of the office as about the United States and the world, not about him. At 70, with a lifetime of settled convictions and instincts, that will be hard. Harder still for his country and the world if he can’t.