The US Senate has just voted down the USA Freedom Act by a vote of 58-42, leaving it just two votes shy of the 60 it needed. The bill would have ended the controversial phone record metadata collection by the NSA, but the Senate was not in favor of rolling back any of the NSA's broad surveillance powers.

While telephone companies would have still collected the data in question, the records would have stayed in the hands of the phone companies and a new type of court order would have been needed by the government to access these records. Additionally, companies would no longer have been required to hold onto their records longer than they ordinarily would have for normal business purposes.

Congress will need to act by next June

However, new legislation around this program will still be required despite the Senate's vote today. Next June, the legal basis for the phone record collection program as part of the Patriot Act will expire — so new legislation will be required if the NSA wants to have continued easy access to these records.

Originally, the USA Freedom Act was meant to be not just a way to ban bulk collection under Section 215 but a multi-pronged reform bill, incorporating changes to how the government managed national security letters and internet surveillance. But a series of amendments to the House version weakened it, until a last-minute change watered it down to the point that some privacy advocates withdrew support. The bill passed, but Leahy promised to roll back the biggest changes with his own Senate version, which was introduced this summer.

Leahy's bill, to many, is a major and welcome improvement. One of the most important differences is its definition of the "specific selection terms" that NSA agents use to look for call records: the House version left the phrasing nebulous, while the Senate adds several qualifiers, including an explicit ban on searching for broad terms like entire cities or area codes. The EFF worries that it could still be twisted by the intelligence community, but it still decided it was by far the better option, given that "essentially, the House bill left it up to the intelligence agencies," as Elizabeth Goitein, co-director of the NYU Brennan Center for Justice's Liberty and National Security Program, puts it. The bill also includes better transparency measures for national security letters and covers a wider range of phone surveillance tactics than the narrowly focused House bill.

"You can't push it too far without losing critical support from both sides"

It may also be less likely to get amended into uselessness. Leahy boasts of having groups that ranged from the ACLU to the NRA on board with the bill, and the White House put its weight behind the bill yesterday, calling it "a reasonable compromise that enhances privacy and civil liberties and increases transparency." And the Reform Government Surveillance coalition, which includes Google, Facebook, Microsoft, and others, is unsurprisingly urging its passage. The bill is "a rare creature," says Goitein, "and you can't push it too far without losing that critical support from both sides." It's also coming some six months before the sunset of the Patriot Act, which justifies phone surveillance. If Congress can't approve a surveillance reform bill that explicitly keeps Section 215 around, it might expire altogether, something the White House warns would remove "critical authorities."

Obama has promised to end bulk collection of phone records, but his administration has repeatedly had the order that allows it reauthorized, albeit with more restrictions on how intelligence agencies can search the database. It's also fighting over the program's legality in court. A federal appeals court recently heard arguments over whether collecting bulk phone records in court is unconstitutional, following a decision by one judge who condemned the program.