Unless they have a warrant, they shouldn’t be sweeping up the conversations of Americans.

Congress is currently deciding whether to let the National Security Agency continue to eavesdrop on the phone calls, emails and other electronic communications of foreigners located abroad. This foreign intelligence program — Section 702 of the Foreign Intelligence Surveillance Act — expires at the end of the year.

Defenders of Section 702, which Congress first approved in 2008, insist that it’s a vital tool in detecting and disrupting terrorist plots. Many civil liberties groups argue that the law needlessly undermines the privacy of Americans, whose emails, phone calls and online chats can be “incidentally” swept up without a warrant when they are communicating with foreigners, creating an end run around the 4th Amendment.

It turns out that both statements are accurate.

Section 702 is valuable and should be reauthorized — not permanently, as the administration proposes, but for another five years. At the same time, Congress must significantly limit the ability of domestic law enforcement agencies to view the communications of Americans. Reauthorization bills approved by committees in the Senate and House so far fall short in that regard.

Although Americans aren’t “targeted” by electronic surveillance under Section 702, any U.S. citizen or permanent resident who happens to communicate with foreigners who are targets can have their personal communications caught up in the dragnet — even those who have nothing to do with terrorism or espionage.

That’s troubling in itself. Even more objectionable is that the FBI can search the database of data collected under the program for information about Americans, including evidence implicating them in a crime. It’s vital that Congress restrict the FBI’s access to the content of NSA-gathered emails and other communications involving Americans, allowing it only if the FBI obtains a warrant based on probable cause that a crime has been committed or that the U.S. person is an agent of a foreign power or terrorist organization.

Sens. Dianne Feinstein and Kamala Harris tried to attach just such a restriction when the Senate Intelligence Committee took up a bill that would reauthorize Section 702 for eight years, but the committee rejected their amendment and approved a weaker alternative. Fortunately, Feinstein says she will press for adoption of her more robust amendment on the Senate floor.

A separate bill introduced by Sens. Ron Wyden (D-Ore.) and Rand Paul (R-Ky.), the USA Rights Act, is even more protective of Americans’ privacy. It would require the FBI in most cases to obtain a court order even to sift through intercepted communications in search of information about Americans, and ban the collection of messages between Americans that merely mention the email address of a foreign target somewhere in the text (a practice known as “about” collection).

Meanwhile, the House Judiciary Committee has approved a third bill on the subject, dubbed the USA Liberty Act. It also would end “about” collection and require a warrant for the government to access information for use in a domestic criminal case. No warrant, however, would be required for searches connected to foreign intelligence or terrorism.

In a recent speech, FBI Director Christopher Wray warned against amending Section 702, arguing that changes sought by civil liberties groups would re-erect walls between law enforcement and foreign intelligence that were removed after 9/11 and “put the American public at greater risk.”

That’s scare-mongering. Even the most privacy-protective proposals pending in Congress allow searches of foreign-intelligence data involving Americans without a court order in life-threatening emergency situations. But in other situations investigators must be required to obtain a warrant before looking at the communications of Americans that are caught up in the foreign-intelligence dragnet. Otherwise, Section 702 opens a loophole that endangers a key privacy protection in the Bill of Rights. And that should apply whether the U.S. person is suspected of violating a criminal law or being an agent of a foreign power. No more backdoor searches.