Carlo Allegri / Reuters

On his first day in office, in January 2017, Donald Trump paid a visit to the CIA. He stood before its Memorial Wall, which then had 117 stars commemorating those who lost their lives in the line of duty. “I want to just let you know, I am so behind you,” Trump told the crowd of intelligence officials who’d gathered to hear him speak. “And I know maybe sometimes you haven’t gotten the backing that you’ve wanted, and you’re going to get so much backing,” he said, just days after comparing U.S. intelligence agencies to Nazis.

Then Trump joked about asking for a show of hands to see who in the room had voted for him. He went on a diatribe about the news media. He repeated lies, at length, about the size of the crowd at his inauguration. The blowback was swift. Former CIA directors were angered and concerned. One U.S. official called the visit “uncomfortable,” saying that it had “made relations with the intelligence community even worse.”

The relationship became even more strained after Trump’s CIA visit. He repeatedly cast doubt on the conclusion by U.S. intelligence agencies that Russia interfered in the 2016 election to help him win. The Russia investigation led by Special Counsel Robert Mueller was a “witch hunt.” FBI members who looked into the Trump campaign’s dealings with Russia were partisan and possibly part of a conspiracy. Besides Russia, Trump also disagreed with U.S. intelligence assessments on North Korea and Iran. He faced a constant threat of sabotage from leakers. In Trump’s narrative, members of the intelligence community worked to undermine Trump from the shadows, the cloak-and-dagger henchmen of the “deep state.”

In the end, though, it was someone playing by the rules who triggered perhaps the greatest reckoning of Trump’s presidency.

The intelligence official who brought Trump’s misconduct in the Ukraine scandal to light—a CIA member who was detailed to the White House, according to a report in The New York Times—didn’t do it via press leaks, or by passing it to a sympathetic lawmaker. The whistle-blower went instead through the relatively straightforward and unexciting bureaucratic process of filing a complaint with the office of the intelligence community’s inspector general.

Filing the complaint ensured that classified information would be protected, national-security concerns would be evaluated, and ultimately, the information would reach the proper authorities. This candid and somewhat mundane process, while flawed, was surprisingly effective at holding Trump to account.

“The complaint process compels you to specify how you know what you know,” Brian Katz, a former CIA analyst who recently joined the Center for Strategic and International Studies as an intelligence fellow, told me. “When you’re an intelligence analyst, you’re going to deliver truth to power in the most effective manner you can.”

The key was its simplicity: By channeling the details of Trump’s misconduct into a formal complaint and then feeding it into the intelligence community’s system, the whistle-blower has thrown a wrench into Trump’s heretofore insurmountable deflect-by-chaos machine. As the scandal escalates, Trump and his White House seem to be in increasing disarray. He released a damaging reconstructed transcript of his July 25 call with Ukraine’s president, which left even some of his Republican allies scratching their heads. He threatened the whistle-blower’s sources in front of a room full of U.S. diplomatic staff. His communications team mistakenly emailed a strategy memo to Democratic lawmakers, then tried to recall the message. His personal lawyer, Rudy Giuliani, who is also implicated in the scandal, has tried to drag the State Department down with him, while also embarking on confusing rants in conversations with reporters.

Despite the White House’s best efforts, the fact that the whistle-blower filed a complaint through proper government channels has made it harder for the usual attacks about traitors and dirty tricks to stick. Michael Atkinson, the inspector general who handled the complaint, and Joseph Maguire, Trump’s recent appointment as acting director of national intelligence, have already come to the whistle-blower’s defense.

As with the Mueller investigation, the broad outlines of the Ukraine scandal had already been playing out in public view. Giuliani had been relatively open about his endeavors to persuade Ukrainian authorities to reopen an investigation into unsubstantiated allegations against Joe Biden and his eldest son’s business dealings in the country. It was no secret on Capitol Hill that the administration had put a mysterious stop on the delivery of military aid to Kiev. With the Mueller investigation, Trump had publicly called on Russia to hack Hillary Clinton’s emails, and shortly after firing FBI Director James Comey, the president admitted in a TV interview that he had done so with “this Russia thing” on his mind. But whereas the Mueller inquiry was sprawling and mired in a cloud of false leads and boundless speculation, the whistle-blower complaint has succinctly laid out its allegations, with lawyer-like precision, in a manner that makes them easy to investigate and harder for Trump to escape. The complaint flagged Trump’s phone call with Ukrainian president Volodymyr Zelensky, which White House aides quickly recognized as problematic. It accused White House lawyers of attempting to hide the call’s transcript on a highly classified server. It raised concerns about Giuliani’s outreach. It identified U.S. officials who could corroborate the details. It has helpful footnotes.

The difference between the more lubricious ways that Trump suggests the intelligence community is undermining him and the formal and legal way in which the Ukraine scandal was brought to light underscores a telling contrast between the way Trump apparently believes the intelligence community operates and the way many of its members actually see themselves and their jobs.

Members of the intelligence community often portray themselves as obsessively rules- and ethics-oriented. They place their faith in the chain of command and bureaucratic process. Much of this is embedded in the community’s DNA. Obtaining and keeping a government security clearance requires answering invasive questions about things like drug use, personal contacts, and sexual history. It means promising to protect classified information—even when, as is often the case, the information that’s classified is banal—and submitting to lie-detector tests. An FBI applicant is disqualified if he or she has used marijuana anytime within the previous three years, even if it was legal in the state or country of use, and even if it was prescribed by a licensed physician.

In short, to a degree that might surprise those steeped in the ways that Hollywood, or Trump, portrays U.S. intelligence professionals, these people can be squares.

Gregory Treverton, who directed the National Intelligence Council during the Obama administration, described intelligence officials to me as “straight shooters” who don’t consider themselves as working for or against any one administration, but rather “for the country.”

The intelligence community is sprawling, encompassing 17 agencies and a bewildering array of job descriptions. Like the military, it contains a diverse mix of people and persuasions. But Treverton’s summation of the community’s ethos is commonly held.

For example, one intelligence veteran who is generally sympathetic to Trump told me that he has been unimpressed by the Ukraine scandal—“I’m yawning”—and thinks there might be something to Trump’s allegations about Biden and his son. At the same time, the official, who spoke on condition of anonymity because he isn’t authorized to talk to the press, offered an expletive for the Trump-allied “clowns” who “promote conspiracy theories about an IC that serves a shadowy deep state.”

He added that he was sick of seeing the intelligence community promoted as “saviors of the Republic” by some Democrats and painted as enemies by Trump and some Republicans. “We see ourselves as truth-sayers. Facts are what they are,” he said. “We act as honest brokers who want to support [Trump] as we did Obama and Bush. But it’s tiresome being impugned by the boss and Republicans and Democrats alike.”

To be sure, the CIA and other U.S. intelligence agencies have had their fair share of scandals. There are certainly some intelligence professionals who operate unethically or, to use a common euphemism, color outside the lines. Comey was recently reprimanded by the Justice Department’s inspector general for his handling of sensitive memos. Two FBI agents involved in the special counsel’s Russia investigation were fired for sending anti-Trump texts. On the far more serious end are well-known scandals concerning issues such as torture, extraordinary rendition, bulk collection of Americans’ phone records, warrantless wiretapping, and the intelligence failures in the run-up to the Iraq War.

But the by-the-books mentality generally applies to a significant portion of the intelligence community, and for the ethos they preach, a whistle-blower complaint is perhaps a perfect recourse against a president who embodies the opposite.

“The narratives out there about rogue intelligence officers that kind of pervade in the media—Jack Ryan and things like that—none of that exists,” Katz, the former CIA analyst who is now with CSIS, told me. “There’s a regulation for everything. There’s a protocol for everything. The other element is you sign a secrecy oath on your first day, and as part of this you undergo security reviews and polygraphs regularly. So there’s that to hold you to account.”

Katz, who has written primers on the mind-set of intelligence analysts that make reference to the cubicle-based comedy Office Space, said that the intelligence community has struggled from the start to find its place under Trump. “I think for those in the intelligence community, they chose their profession because they believed in the mission,” he said. “But it’s a particularly acute time when the first customer, the president, actually goes out of his way to call you the deep state or enemies of that state, and labels whistle-blowers going through the proper channels as spies.”

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.