Sens. Patrick J. Leahy (D-Vt.) and Dianne Feinstein (D-Calif.) are set to offer differing proposals on the NSA’s phone records program. (Evan Vucci/AP)

After nearly five months of controversy and debate, members of Congress may face a clear choice over the National Security Agency’s program to collect the phone records of nearly every American: endorse it or shut it down.

On Tuesday, lawmakers are expected to introduce the first comprehensive NSA legislation since the agency’s phone records program was disclosed in June. The proposal, from a bipartisan coalition in the House and the Senate, would effectively halt “bulk” records collection under the USA Patriot Act. Another bipartisan group of lawmakers is preparing legislation that would preserve the program while strengthening privacy protections.

The dueling proposals are setting the stage for what could be a fierce political showdown over the NSA’s authorities. NSA Director Keith Alexander and Director of National Intelligence James R. Clapper Jr. — who are set to testify before Congress on Tuesday — have defended the phone records program as a vital counterterrorism tool. But privacy advocates and critics on Capitol Hill, led by a diverse group of liberal Democrats and libertarian conservatives, have described it as a gross infringement on civil liberties.

“There’s no sugarcoating it. These two trains — one that codifies bulk collection and the other that outlaws it — are on a collision course,” said Gregory Nojeim, senior counsel at the Center for Democracy and Technology, a privacy advocacy group.

President Obama has called for reforms to restore Americans’ and foreign allies’ trust, including “appropriate” changes to the program collecting data from Americans. “Just because we can get information doesn’t necessarily always mean that we should,” he said at a news conference in Russia last month.

White House spokeswoman Caitlin Hayden said Monday that she could not comment on legislation that had not been introduced yet. But in general, she said, the administration supports changes to achieve “greater oversight, greater transparency and constraints on the use of this authority, as well as measures to enhance public confidence” in the Foreign Intelligence Surveillance Court (also known as the FISA court) process. “We are working closely with Congress on these important reforms.”

In July, the House narrowly defeated a measure to defund the phone records collection program. Since then, fresh disclosures about the NSA’s activities and capabilities, based on leaks from former agency contractor Edward Snowden and declassified court opinions, have continued to spark controversy — and have built support for reining in the surveillance.

The phone call database contains billions of records of numbers dialed, as well as the lengths and times of calls, but not their content.

“This is going to be a huge battle because it is fundamentally about whether or not the oversight structure that we set up in the 1970s — to use Congress as a proxy for public oversight so we can have the secrecy of the programs — can be sustained,” said Paul Rosenzweig, who was a senior homeland security policy official in the George W. Bush administration.

The two sets of legislation reflect different judgments about what the proper balance between security and privacy is and ought to be.

On one hand, there is the approach taken by Sen. Patrick J. Leahy (D-Vt.), the Senate Judiciary Committee chairman; Rep. F. James Sensenbrenner Jr. (R-Wis.), a former House Judiciary Committee chairman; and Sen. Ron Wyden (D-Ore.), a senior member of the Senate Intelligence Committee. They would end the mass collection of phone data by requiring the government to prove to a court that it is seeking call records relevant to either an agent of a foreign power who is the subject of a terrorism investigation or someone with a link to that agent. Such a requirement would make bulk collection impossible, the proponents say.

The legislation also would require a warrant to deliberately search for the e-mail and phone call content of Americans that is collected as part of a surveillance program targeting foreigners located overseas.

“The government has not made its case that bulk collection of domestic phone records is an effective counterterrorism tool, especially in light of the intrusion on American privacy,” Leahy said at a hearing this month.

Some experts say a viable alternative would be to have phone companies give the NSA data from searches based on phone numbers linked to terrorism. “This process could easily be automated to make it virtually instantaneous,” Edward W. Felten, a Princeton University computer science professor, said in a court brief filed Friday in an ACLU lawsuit challenging the phone program’s constitutionality.

On the other hand, the approach taken by Sen. Dianne Feinstein (D-Calif.), chairman of the Senate Intelligence Committee, and Rep. Mike Rogers (R-Mich.), chairman of the House Intelligence Committee, focuses on increasing transparency and privacy protections.

The intelligence committee leaders have not introduced their respective bills, but Feinstein has outlined the changes under consideration. They include limiting access to the call database; codifying the requirement that analysts have a “reasonable articulable suspicion” that a phone number is associated with terrorism to query the database; requiring that the FISA court promptly review each such determination; and limiting the retention period for phone records, now five years.

“This program is constitutional,” Feinstein said at a hearing on the issue last month. “It is legal. . . . I also believe that collecting timely and actionable intelligence is critical to our nation’s security.”

The Intelligence Committee’s bill, she said, would also expand the NSA’s authority to allow it to continue intercepting for three days the phone calls and e-mails of an overseas foreign target who had entered the United States. That would give the government a chance to go to the FISA court to seek a traditional individual warrant to continue the collection. If the warrant was denied, the intercepts would have to be deleted.

The bill would also require Senate confirmation of the NSA director and inspector general.

Both approaches have at least one element in common: a recommendation, endorsed by Obama, that there be a special advocate to promote privacy interests before the FISA court.

The proposal to end bulk collection, if it is allowed to reach the floor, could succeed in the House, where a similar effort failed by only 12 votes in July. At least eight lawmakers who voted against the July measure and two who did not vote on it are now in favor of Leahy and Sensenbrenner’s approach, congressional aides said.

“The public is justifiably concerned about the fact that everybody’s phone calls apparently have been snared in this — even people who have no relationship to terrorism,” Sensenbrenner said in an interview. “But what has come out since the end of July, I think, is going to tip the scales in favor of a significant NSA reform.”

Rosenzweig, for his part, said he thinks “the insurgent movement” will not succeed in ending bulk collection, “but I am quite sure that they are going to wind up getting changes — that something will happen.”