The Senate recently passed the Justice Against State Sponsors of Terrorism Act (JASTA) – a law intended to permit victims of the September 11, 2001 attacks to sue Saudi Arabia in court for being complicit in the terrorist acts committed that day.

The law has opened up Pandora’s Box, creating risks with international consequence for Americans working directly or indirectly for our intelligence agencies. This has apparently now dawned on Congress as it seeks to amend JASTA.

The last classified pages of the 9/11 report released earlier this year appeared to indicate that Saudi Arabian government officials had a hand in aiding those plotting the attack. Congress thus sought to hold their government accountable by passing JASTA. It did so over the objections of senior U.S. government officials and President Barack Obama’s veto (which Congress overrode overwhelmingly).

What Congress missed in JASTA’s wording was to target a real culprit behind the 9/11 attacks — the government of Iran that sanctioned them, following the demand that nation’s constitution mandates. To do so now means modifying JASTA accordingly.

JASTA’s wording neglected a most important distinction between rogue government officials working individually as part of a terrorist effort and government officials sanctioned by their government to do so. This is the all-important distinction concerning involvement by Iranian versus Saudi government officials.

Unlike the Saudi officials, Iranian conspirators were obeying the nation’s 1979 constitution in aiding terrorist activities. Iran’s constitution contains a unique mandate in which Tehran explicitly claims extraterritorial jurisdiction to spread its Islamic Revolution throughout the world. No other member of the international community makes such an outrageous, overreaching claim of extraterritoriality to impose its laws on other nations.

The U.S. Congress should restrict JASTA’s application only to states claiming this jurisdictional exercise of authority—one refuted by the rest of the global community. Not doing so may allow a wave of frivolous lawsuits against the United States itself, potentially endangering national security operations on the ground.

International law has long recognized sovereign immunity — i.e., one nation cannot be sued in the courts of another absent the former’s consent. This right extends “to the person and property of foreign governments themselves.”

While JASTA would open the door to suing a foreign country in the U.S., that door can swing both ways, allowing a foreign country to sue the U.S. in our own courts as well.

For example, Iraqi Sheikh Jamal Al-Dhari wrote he sees JASTA as “constituting a window of opportunity for millions of Iraqis who have lost their sons and daughters in military operations by U.S. military forces and by U.S. contracted forces since the U.S. invasion in 2003 to pursue compensation from the U.S. government for what they have endured… With the passage of JASTA, we intend to hold the United States accountable for unleashing this situation.”

Foreign nations often claim U.S. drone missile strikes kill innocent victims. They will use JASTA as a means of pursuing such claims, resulting in lengthy litigation to prove whether victims truly were innocent.

Foreign governments that decide to retaliate against the United States over this law will not deem themselves limited to action commensurate with our legislation. As one critic observes about JASTA, it disrupts maintenance of “a prudent defense of basic international-relations protocols… Once the principle of sovereign immunity is breached, all bets are off.”

Similarly, JASTA will open the floodgates for Americans who disagree with presidential actions involving U.S. military forces or assets to file lawsuits claiming the U.S. government is guilty of terrorist activity. While such claims of war crimes against the administration of George W. Bush were filed pre-JASTA, many more against the U.S. can be expected post-JASTA.

Should Congress allow itself to be motivated by emotion regarding the 9/11 families rather than the logic that dictates JASTA not be implemented as is, a potential mid-ground position is available to recognize this, keeping the international standard intact and isolating liability to an egregious terrorist nation such as Iran.

Even if the released 9/11 pages support evidence some rogue Saudi officials may have been involved, there is no evidence of official Saudi government complicity as is the case with Iran, nor does obeying Saudi law require officials, as in Iran, to participate in such illicit activities. Accordingly, Tehran should be JASTA’s real target. Doing so, either via the proposed amendment or the extraterritorial hook, eliminates the Pandora’s box paradox.