President Trump and his allies are outraged at reports that the FBI used an “informant” to spy on Trump’s 2016 campaign. “Really bad stuff!” the president tweeted early Friday. Supporters of the White House claim the FBI’s reported tactics were illegal. House Intelligence Committee Chairman Devin Nunes (R-Calif.) has even subpoenaed the Justice Department for information on who the informant might have been; department and FBI officials say public disclosures of this kind could put sources in danger.

But Trump and his backers are wrong about what it means that the FBI reportedly was using a confidential source to gather information early in its investigation of possible campaign ties to Russia. The investigation started out as a counterintelligence probe, not a criminal one. And relying on a covert source rather than a more intrusive method of gathering information suggests that the FBI may have been acting cautiously — perhaps too cautiously — to protect the campaign, not undermine it.

As a former FBI counterintelligence agent, I know what Trump apparently does not: Counterintelligence investigations have a different purpose than their criminal counterparts. Rather than trying to find evidence of a crime, the FBI’s counterintelligence goal is to identify, monitor and neutralize foreign intelligence activity in the United States. In short, this entails identifying foreign intelligence officers and their network of agents; uncovering their motives and methods; and ultimately rendering their operations ineffective — either by clandestinely thwarting them (say, by feeding back misinformation or “flipping” their sources into double agents) or by exposing them.

By early summer 2016, according to the New York Times, the FBI had already identified at least four members of the Trump campaign with significant ties to or contacts with Russian intelligence. The next logical step in a counterintelligence investigation would be to discern what Russia was trying to do with those people. Sending a source to talk to suspected foreign agents such as campaign advisers Carter Page and George Papadopoulos could illuminate whether these individuals were being developed — or even tasked — as intelligence assets for Russia. And that could have served to generate even more information: If the U.S. intelligence community had later picked up “chatter” on Russia’s end following these interactions, the FBI could have verified that these individuals were, in fact, in communication with Russian operatives.

Understanding that the FBI may have been using an intelligence source — not a criminal “informant” — also explains the Justice Department’s concern about the purported source’s safety. To obtain information about Russia’s intentions and methods, the FBI would have had to use someone who would not raise red flags if their interactions with campaign officials got back to Russia. So there is a high likelihood that this person is someone already familiar to Russian intelligence, and possibly someone who was already in Russian business or organized crime circles, which all have links back to Russian President Vladimir Putin — which means the source would be in potential danger if discovered. The Washington Post reports that the FBI is working to protect the purported source in light of Nunes’s request and to “mitigate the damage” if his or her identity is disclosed, which suggests that this individual may be currently providing law enforcement authorities with intelligence and will need to cease if made public.

The real question isn’t why the FBI apparently tried to obtain intelligence from within Trump’s campaign, though — it’s why the bureau didn’t do so more aggressively and directly.

Using a confidential intelligence source would have made sense if the FBI’s long-term strategy was to allow Russia to believe it was operating undetected and to collect intelligence on Russian methods. But an infiltration of a U.S. presidential campaign by a hostile foreign power presented a grave national security threat of the highest order. That should have justified shutting down — neutralizing — any Russian operation immediately, even if it meant potentially losing long-term collection. One way that the FBI sometimes does this is to overtly approach suspected agents and question them on their activities. Russian intelligence officers might have scurried away from their efforts to target the Trump campaign once it was clear that the FBI was watching.

But this would also have made the Trump campaign’s possible ties to Russia public and put the campaign under a cloud of suspicion. News that FBI agents had approached Trump campaign officials would have undoubtedly raised questions from the media and the Clinton campaign — and since counterintelligence investigations are classified, the Justice Department would not have been able to reveal publicly that the purpose of the investigation was to counter Russia, not target the campaign itself. Precisely because the Trump campaign wasn’t under investigation at the time for criminal wrongdoing, the FBI appears to have taken an approach that tried to avoid inviting unwarranted speculation that it was.

Ironically, the FBI’s apparent attempt to protect the campaign by investigating Russia’s efforts quietly is now being weaponized against it. Accusations that the FBI was “spying” on the Trump campaign — rather than spying on foreign spies, which is its job — erase the important distinctions between counterintelligence and criminal investigations. It also displays a shocking ignorance of the devastating consequences to our national security if the Justice Department hands over the information that Nunes is demanding: “Burning” the FBI’s purported source and exposing how it obtained intelligence against Russia’s efforts only helps Russia cover its tracks, change tactics and improve its future operations against the United States.

The Trump administration’s assault against the FBI’s efforts to assess a national security threat posed by suspected foreign agents only raises more questions about what went on in 2016. Trump has repeatedly insisted that he is innocent of colluding with Russia and had no idea about his campaign staff’s Russia contacts. So he should be glad to know that the FBI appears to have been trying to thwart a hostile country’s efforts to infiltrate his campaign. That he and his allies in Congress do not even acknowledge that these individuals posed a national security threat and instead attack the FBI for apparently doing its job suggests that they would have been happy for whatever Russia was doing in 2016 to continue unimpeded.

Read more:

What’s in Flynn’s plea deal shouldn’t scare the White House. What isn’t should.

Russian intelligence would have seen Paul Manafort as the perfect mark

Russia’s outreach to George Papadopoulos went just how spies would have done it