What do you do when the moral and emotional stakes of an attack seem to call for war but there is no war that can be constructively fought?

That's a question Barack Obama's national security advisers have grappled with for months, if not years, as I understand from conversations with them dating to before Friday's Paris attacks. Many senior administration officials at this point are part of the permanent national security apparatus, but the core group of real "Obama people" has a surprisingly dovish self-conception, where they see themselves operating in a world in which demands for military intervention are constant and endless— from the media, from congressional Republicans, from foreign governments and their allies in Washington, and from the permanent security bureaucracy itself — but America's actual ability to engage in non-counterproductive interventions is quite limited.

In that context, the administration is faced with a nightmare. And it's a nightmare that looks a lot like what played out in Paris on November 13.

Not the shooting but the aftermath

The nightmare is that in a country where we know it is relatively easy to obtain guns and ammunition and we know that mass casualty shootings are a frighteningly regular fact of life, someday soon a mass casualty shooting will be perpetrated by someone with ties to international Islamist terrorism.

When that happens, it will, of course, be a tragedy, just as the shootings in Sandy Hook and Charleston and elsewhere are tragic crimes. But the real nightmare is what comes next. As the scale of the carnage became evident in Paris, major newspapers leapt toward declarations like "war in the heart of Paris" (la guerre en plein de Paris) and "this time it's war" (cette fois, c'est la guerre) that are, of course, reminiscent of the post-9/11 declaration of a "war on terror."

But a war against whom? And with what purpose in mind?

Public policy wars are at times metaphorical (war on poverty, war on drugs) but given that terrorism is a matter of hard security, a literal military war is clearly what the media and the political system desire. But it's far from clear that extended control over physical territory abroad is necessary for orchestrating violent acts in Western cities.

Foreign conflicts are likely counterproductive on many levels — creating new generations of widows and orphans who resent the West, deepening ideological polarization between Islamists and liberals, and opening up new venues for jihad. Worst of all, once you've decided that the enormity of an attack requires the use of a military hammer, the temptation becomes strong to seek out hammerable nails — as when Donald Rumsfeld told Richard Clarke that the response to 9/11 had to be an invasion of Iraq because there weren't enough good targets in Afghanistan.

The inaction problem

The problem is that inaction seems like a political impossibility. Having discussed this problem with several members of Obama's team, I believe this inaction problem is what the president had in mind when he said something to me that wound up getting him in hot water over a minor question of word choice:

Look, the point is this: my first job is to protect the American people. It is entirely legitimate for the American people to be deeply concerned when you've got a bunch of violent, vicious zealots who behead people or randomly shoot a bunch of folks in a deli in Paris. We devote enormous resources to that, and it is right and appropriate for us to be vigilant and aggressive in trying to deal with that — the same way a big city mayor's got to cut the crime rate down if he wants that city to thrive. But we also have to attend to a lot of other issues, and we've got to make sure we're right-sizing our approach so that what we do isn't counterproductive. I would argue that our invasion of Iraq was counterproductive to the goal of keeping our country safe.

The use of the term "random" when the attack was, in fact, deliberately targeting a kosher deli became a dumb two-day gaffe story. But it's the possibility of random attacks that Obama was worried about because he knows better than anyone that there's nothing he can do to ensure that America isn't afflicted by the occasional mass shooting.

When these shootings are carried out by lone wolves, America responds by arguing for a few days about gun control and then moving on. But a mass shooting perpetrated by a suspect — or several suspects — with known ties to international Islamist terrorism would, politically speaking, demand a more robust response.

"Don't do stupid shit"

A situation like the one above would demand a response that — like the invasion of Iraq — would almost certainly be counterproductive. It would be a violation of the "don't do stupid shit" principle that constitutes a more profound national security doctrine than Obama is given credit for. After all, whether an attack comes tomorrow or next week or next month or next year, the US government is already well aware of the threat posed by ISIS.

If there were any ideas for countering it that the White House thought made sense, the administration would be executing them already. But an actual attack on US soil would, on an emotional level, demand that we "do something" — something that would already have been rejected as unworkable or counterproductive. A land invasion of ISIS territory in Syria and Iraq would be costly and only serve to further roil the waters of the region. Yet the idea of a president going on television in the wake of an attack and not vowing further punitive measures is inconceivable.

In this way, the hardest problem in US counterterrorism policy is in some ways as much a speechwriting challenge as anything else. The next time something goes wrong and an attack hits the United States, how do you sell the American people on the idea of not really doing anything about it?