The release of the Senate Intelligence Committee report on torture under the Bush administration has revived calls for the Obama administration to prosecute those responsible for violating the law. Critics argue correctly that if torturers are not punished, then torture could happen again. But Obama has acted rightly by refusing to authorize prosecutions. He acted rightly because prosecutions would have failed to secure convictions; and he acted rightly as a matter of principle. Criminal punishment of a partisan opponent who engages in illegal behavior for policy rather than personal reasons can pose a risk to democracy.

The committee report makes plain that CIA agents who tortured detainees, and higher government officials who authorized torture (up to President Bush), violated the law. A federal statute bans torture. Other laws make it illegal for anyone, including officials, to use physical violence against people in order to extract information from them. The United States is also a party to an international treaty, the Convention Against Torture, which bans torture and requires governments to refer torturers to prosecutors.

So how could Obama spare the torturers? As we have just learned from the debate about immigration, the president enjoys broad prosecutorial discretion. Just as he can decide not to prosecute foreigners who violate our immigration laws, he can decide not to prosecute Americans who violate our torture laws.

So the question is why Obama decided to spare the torturers. When prosecutors—or their bosses—make such a judgment, their chief concern is usually how to use their limited resources in the most effective way. Prosecutors do not bring cases unless they think they will win. Otherwise, they waste resources that could be used to prosecute other criminals.

The committee report is full of damning evidence that shows extensive and brutal torture, even beyond the limits prescribed by government lawyers, and which apparently did not yield valuable information. Despite these findings, it is unlikely that prosecutors would be able to convict anyone of a crime. Some more recent history is helpful here. As we saw with the police shooting of Michael Brown in Ferguson and the chokehold death of Eric Garner in New York, the law gives a great deal of protection to police officers who are accused of abusing their power. The principle applies to CIA agents as well.

Of course, there are differences in the cases. More deference will be given to a police officer who must deal with a potentially violent criminal suspect on the street than to an agent who beats up a bound suspect in custody. But there are cross-cutting considerations. The torture detailed in the committee report took place abroad, sometimes in military zones, involving people who were thought to be hardened militants rather than ordinary criminals.

Moreover, the CIA agents were told by government lawyers that the law permitted them to use waterboarding and other coercive techniques. And they were acting in the arena of national security, under conditions of great uncertainty about the extent of their powers. The Obama administration has used a legal doctrine called the state secrecy privilege to prevent victims of torture from using evidence of torture in civil actions against government officials. If secrecy concerns driven by national security justify constraints on civil actions, then they justify constraints on criminal actions as well.

So prosecutors would confront broad legal standards that protect discretionary behavior of agents, and they would be unable to introduce a great deal of relevant evidence. They would also contend with the best lawyers in the country, who would flock to these high-profile cases and scrutinize the government investigation for errors. Defense lawyers would point out that much evidence is stale; and they would threaten to humiliate elected officials, including Democrats, by putting them on the stand and asking them how much they knew about the CIA’s interrogation methods. They would in this way make the prosecution of Bush administration officials look like a partisan witch hunt. Prosecutors, meanwhile, would confront juries that sympathize with the CIA agents. One doesn’t need to be a psychologist to know that jurors will side with government officials who were trying to protect the country from another terrorist attack.

Some commentators have argued that the United States has an obligation under international law to prosecute those responsible for torture. The Convention Against Torture does require governments to investigate torture allegations, but it doesn’t require them to prosecute hopeless cases. And even if it did, the question of prosecutorial discretion is just pushed back to another level. Foreign countries need to decide whether they care enough about torture to band together and put pressure on the United States to prosecute torturers. They clearly don’t. Indeed, most foreign countries use torture themselves.

But Obama’s best argument for letting matters rest is the principle against criminalizing politics. This is the idea that you don’t try to gain political advantage by prosecuting political opponents—as governments around the world do when authoritarian leaders seek to subvert democratic institutions. Of course, if a Republican senator takes bribes or murders his valet, the government should prosecute him. But those cases involve criminal activity that is unrelated to the public interest. When the president takes actions that he sincerely believes advance national security, and officials throughout the government participate for the same reason, then an effort to punish the behavior—unavoidably, a massive effort that could result in trials of hundreds of people—poses a real risk to democratic governance.

Obama’s problem is that if he can prosecute Republican officeholders for authorizing torture, then the next Republican president can prosecute Obama and his subordinates for the many questionable legal actions of the Obama administration—say, the drone strike that killed Anwar al-Awlaki and three other American citizens. Sen. Ted Cruz cites the drone strike as one of 76 alleged illegal actions by the Obama administration. You don’t have to believe every one of Cruz’s charges to see that Obama and his subordinates could spend years under investigation after he leaves office if a Republican president thought such a course of action politically expedient. Although a jury would be just as unlikely to convict Obama officials as it would be to convict Bush officials, the problem is that the investigations themselves are extraordinarily burdensome. The prospect of criminalization of political behavior raises the stakes for elections because if you or your boss loses an election, you not only lose the trappings of office but gain the prospect of being investigated for the rest of your life. This will encourage officeholders to take ever more extreme actions to stay in office.

That is the lesson of unstable democracies—Turkey, right now, is the best example, where President Recep Tayyip Erdogan has used criminal investigations to harass his opponents. But we have our own experience of this in the United States. In the wake of the Watergate scandal, Congress passed a statute that authorized an independent counsel—uncontrolled by the president—to investigate wrongdoing in the executive branch. A series of independent counsels wreaked extraordinary havoc investigating the Iran-Contra scandal in the Reagan administration and the Whitewater, Monica Lewinsky, and related scandals in the Clinton White House. While there is little doubt that in some cases high-level executive officials broke the law, Congress allowed the independent counsel statute to lapse because the disruption caused by these investigations was worse than the behavior that was investigated.

The upshot is that, hidden in our unwritten constitution is a norm that Congress cannot criminalize certain behavior that the president authorizes on national-security grounds. This is just how our system works, driven by an implicit deal between the parties to keep political warfare within boundaries.

Does this mean that nothing can be done to stop the president from acting illegally? Outside the extreme case of impeachment, the answer is: elect presidents who you think will respect the will of Congress. The only way to ensure that U.S. officials will not use torture in the next national-security emergency is to elect presidents who won’t authorize it.