The White House and a bipartisan Congress finally appear to moving in the right direction with plans to end mass telephone data collection by the National Security Agency.

If implemented properly, the plans will answer the main criticisms of the NSA program by ending the mass capture of all U.S. telephone "metadata" on a daily basis, the retention of this data by the government for five years and its availability to intelligence analysts without a specific judge's order.

The plan sketched by President Barack Obama is broadly similar to the plan recommended by the Republican chairman and Democratic ranking member of the House Intelligence Committee.

Telephone companies would be required to keep the metadata they collect on every call for billing and other company purposes for the 18 months already prescribed by the Federal Communications Commission, but with the added requirement that they keep it in a specific form required by the federal government to facilitate accountability.

Under the president's proposal, intelligence agencies would have to get a judge's order for a specific search before they could access any of the metadata. This is clearly preferable to the House proposal that a judge grant broad access and only review a query once it had been answered by a telephone company.

The government presumably would reimburse telephone companies for converting their metadata to a common format.

The government, in searching the databases, would be limited to two "hops," meaning it could look for information on the initial suspect's number, numbers it connected with, and numbers that the first "hop" batch of numbers connected with. While that is better than previous practice, it is still a pretty large universe of numbers, representing the phone records of many American citizens. The role of the federal Foreign Intelligence Surveillance Court in overseeing such searches will remain a critical safeguard.

The approach, while still sketchy, has won conditional approval from privacy advocates including the Electronic Privacy Information Center and the American Civil Liberties Union.

The proposals still have to be enacted into law this year before existing authority, known as section 215 of the Patriot Act, expires. In the process, Congress needs to review other NSA programs that have taken an expansive view of the reach of Section 215, such as the alleged mass surveillance of emails.

A case could be made against the entire Section 215, which authorizes the government to demand data on individuals kept by banks, libraries, utilities, Internet service providers and other firms, as well as telephone companies, without presenting evidence to a judge that the information is required in an investigation.

But that broader privacy case would require the Supreme Court to change its opinion that such data are not covered by the Fourth Amendment's requirement for a search warrant. Until such change, the best we can hope for is a Congress vigilant to oppose overzealous interpretations of its laws such as the one that allowed the NSA to collect telephone metadata.