Leaks are coming out of the White House at a seemingly record pace, many of which have painted a picture of a dangerously ignorant and ill-equipped president who is narcissistic to the extreme, unable to let go of even the smallest of slights. But some of these leaks have halted a Trump appointment and controversial policies in their tracks, and it’s a lesson showing how whistleblowers and leaks to the press are vital for democracy.

National Security Adviser Michael Flynn was forced to resign late Monday—just three weeks into the job—following the revelation that he lied to both the Trump administration and the public when he said he did not discuss outgoing President Obama’s sanctions on Russia with that country’s US ambassador just after the election. Multiple outlets have reported over the past few days that intercepts of the phone calls showed that he in fact did, despite personally telling Vice President Mike Pence the opposite.

But here’s the important part: It turns out it wasn’t the lying that got him fired; it’s that his lying leaked to the press. The Washington Post reported that the acting attorney general told the White House weeks ago that transcripts showed Flynn likely misled administration officials. It wasn’t until the public found out he lied—based on a torrent of leaks from inside the administration in the past week—that Flynn was forced out.

The Flynn episode is just the latest and most high-profile case in which the Trump administration has been forced to reverse course because of leaks to journalists. The New York Times reported on Sunday night that “Defense Secretary Jim Mattis was exploring whether the Navy could intercept and board an Iranian ship to look for contraband weapons possibly headed to Houthi fighters in Yemen,” a policy which many people would consider both incredibly dangerous and potentially illegal—and could have been considered an act of war.

But the Times reported that “Mr. Mattis ultimately decided to set the operation aside, at least for now. White House officials said that was because news of the impending operation leaked.” Whoever leaked those plans was likely committing a crime, but also potentially staved off a huge international controversy that could have led to yet another military incursion in the Middle East.

RELATED: Donald and Melania Trump’s relationship through a lens

Sign up for CJR 's daily email

This is not the first time a leak has forced the Trump administration to pull a controversial policy, either. In the first few days of his presidency New York Times’ Charlie Savage published a leaked draft of an executive order which would have set in motion the re-opening of several CIA ‘black sites’ around the world—the same type of squalid prisons where George W. Bush hid terror suspects from the courts and the Red Cross, and engaged in a widespread torture regime.

After an uproar, the Trump administration quickly disavowed the draft executive order, and nothing resembling it has made it to Trump’s desk.

Then, two weeks ago, Trump was also reportedly dissuaded from implementing another executive order that would roll back LGBT rights across the federal government. The New York Times gave Ivanka Trump and her husband Jared Kushner credit for convincing him, but the only the reason they reportedly even knew about the draft was because it was leaked to the media.

So not only are leaks allowing the public to put pressure on the government to pull back awful policies, but it’s even informing other people within the Trump administration.

Other reporting based on leaks from inside the White House has shown Trump to be a short attention-spanned neophyte, offending world leaders and seemingly unaware of major US policies, like the New START nuclear treaty with Russia, as he makes up positions on them. Other leaks have provided even more salacious details: Trump has been portrayed as a president who is obsessed with watching cable television at all hours of the day, muttering to himself about “fake news” any time someone criticizes him. While these leaks are clearly an attempt to disparage him, it is also a window into how he operates and vital for the American public to know not just what policies he wants to implement but his motivations.

Now, of course, every leak has an agenda behind it, and it’s important for the public to be skeptical of anonymous comments that are unaccompanied by documents, especially if they are single sourced. It may be the administration floating policies to see how the public will react; it might be someone trying to disparage Trump; or competing parties within the administration may be trying to win an argument through the press. But there’s no doubt many government employees are leaking because they are genuinely terrified about what Trump is actually doing and believe the public has the right to know.

RELATED: Former White House photographer grabs headlines with Instagram sass

While there are certainly many people within the administration willing to sound the alarm, news organizations, to their credit, have been much more aggressive about advertising their willingness to accept leaks from disgruntled administration officials. Many now have secure tips pages, like these at The New York Times and BuzzFeed. There has been a marked increase in both journalists and news organizations broadcasting how to use encryption tools like Signal or SecureDrop to speak with them and get information to the public.

Now, the question is how far will the Trump administration go to crack down on the press and the sources they are talking to. Trump himself has blamed the leftover “Obama people” for the leaks, saying “It’s a disgrace that they leaked because it’s very much against our country.” And the White House has allegedly already started investigating who leaked transcripts of Trump’s alarming conversations with the leaders of Mexico and Australia. “National Security Council staffers have been instructed to cooperate with inquiries, including requests to inspect their electronic communications,” Politico reported, but “It’s not clear whether the investigation is a formal proceeding, how far along it is or who is conducting it.”

Speaking to the press about confidential and classified material is a risky and often courageous move. Many people, especially those close to the Obama administration, were highly critical of whistleblowers like Chelsea Manning and Edward Snowden in the past. But it’s now more clear than ever that we will need more people like them in the next few years if we really want to hold the Trump administration accountable.

Photo by Gage Skidmore

Has America ever needed a media watchdog more than now? Help us by joining CJR today

Trevor Timm is the executive director of Freedom of the Press Foundation, a non-profit organization that supports and defends journalism dedicated to transparency and accountability. He is also a twice-weekly columnist for the Guardian, where he writes about privacy, national security, and the media.