It is quite rare for governments to be able to craft a policy that contains no moral complexities.

When it comes to national security policy, this is especially so.

One of the messiest tasks for any Western leader to deal with today is the threat posed by Islamist terrorism. As then-President Barack Obama said back in 2013, “there are individuals and groups out there that are intent on killing Americans—killing American civilians, killing American children, blowing up American planes. That’s not speculation. It’s their explicit agenda.”

Knowing how to respond is not easy, but the president’s central mission always remains the same.

In Obama’s words, “[t]he way I’ve thought about this issue is, I have a solemn duty and responsibility to keep the American people safe. That’s my most important obligation as president and commander in chief.”

Obama had to make hard decisions on counterterrorism policy, as President George W. Bush did before him. Yet taking at face value much of the commentary surrounding “extreme vetting” in recent days, one would be led to believe that no moral dilemmas exist when it comes to easing the terror threat.

Politicians, journalists, and analysts have often criticized tough counterterrorism measures by saying, “This is not only morally wrong, it’s ineffective.” If that sounds awfully familiar, it should.

Since 9/11, we have heard this about the National Security Agency’s metadata collection, U.S. drone strikes, the Guantanamo Bay prison, and the CIA’s enhanced interrogation methods on terror suspects. These policies not only left us morally compromised, the argument went. They were counterproductive.

It has always been too convenient that the approach that allowed politicians and the commentariat to feel particularly moral matched exactly what was the most effective approach to counterterrorism. In reality, the idea that keeping people safe and defeating terrorist groups means always being morally above the fray is not backed up by the facts.

Take the example of Northern Ireland and the Irish Republican Army (IRA).

As the journalist Douglas Murray has noted, “those of us who have actually studied the Northern Ireland conflict know that that was an exceptionally dirty war, fought in our own lifetimes.”

Murray highlights the case of a British agent, Stakeknife:

This was a person who worked his way up to become the head of the internal ‘nutting squad’ in the IRA. He was the person whose job it was to find, torture, and kill people thought to be informers within the IRA. He was also a British agent.

Murray goes on to say that “Stakeknife was, among other things, allowed to torture and kill innocent people (that is: members of the public) in order to deepen and protect his cover within the IRA and embed him at the very top of the organization.”

In allowing this, perhaps the British government made the wrong moral choice. Yet the state’s ability to infiltrate the IRA was vital in seeing it operationally defeated.

Who knows how many more lives “Stakeknife” ultimately saved? Members of the public do not have to make such calls.

But because those in power had to take on such morally complex challenges, the IRA was weakened to the extent that it ended up having to negotiate a peace deal. As a result, I grew up in a safer Great Britain than had I been born 10 or 20 years earlier.

There is an honest debate to be had over what the best procedures and processes to employ in this fight are. Yet the entire discussion around counterterrorism policy in the West would be aided if there was some acceptance of a basic reality: The policy that makes you feel the most virtuous may not always be the one that makes the most people safe.