By Kara Brandeisky, ProPublicaThis piece first appeared on ProPublica.

When the House of Representatives recently considered an amendment that would have dismantled the NSA’s bulk phone records collection program, the White House swiftly condemned the measure. But only five years ago, Sen. Barack Obama, D-Ill. was part of a group of legislators that supported substantial changes to NSA surveillance programs. Here are some of the proposals the president co-sponsored as a senator.

As a senator, Obama wanted to limit bulk records collection.

Obama co-sponsored a 2007 bill, introduced by Sen. Russ Feingold, D-Wis., that would have required the government to demonstrate, with “specific and articulable facts,” that it wanted records related to “a suspected agent of a foreign power” or the records of people with one degree of separation from a suspect. The bill died in committee. Following pressure from the Bush administration, lawmakers had abandoned a similar 2005 measure, which Obama also supported.

We now know the Obama administration has sought, and obtained, the phone records belonging to all Verizon Business Network Services subscribers (and reportedly, Sprint and AT&T subscribers, as well). Once the NSA has the database, analysts search through the phone records and look at people with two or three degrees of separation from suspected terrorists.

The measure Obama supported in 2007 is actually similar to the House amendment that the White House condemned earlier this month. That measure, introduced by Reps. Justin Amash, R-Mich., and John Conyers, D-Mich., would have ended bulk phone records collection but still allowed the NSA to collect records related to individual suspects without a warrant based on probable cause.

The 2007 measure is also similar to current proposals introduced by Conyers and Sen. Bernie Sanders, I-Vt.

As a senator, Obama wanted to require government analysts to get court approval before accessing incidentally collected American data.

In Feb. 2008, Obama co-sponsored an amendment, also introduced by Feingold, which would have further limited the ability of the government to collect any communications to or from people residing in the U.S.

The measure would have also required government analysts to segregate all incidentally collected American communications. If analysts wanted to access those communications, they would have needed to apply for individualized surveillance court approval.

The amendment failed 35-63. Obama later reversed his position and supported what became the law now known to authorize the PRISM program. That legislation — the FISA Amendments Act of 2008 — also granted immunity to telecoms that had cooperated with the government on surveillance.

The law ensured the government would not need a court order to collect data from foreigners residing outside the United States. According to the Washington Post, analysts are told that they can compel companies to turn over communications if they are 51 percent certain the data belongs to foreigners.

Powerpoint presentation slides published by the Guardian indicate that when analysts use XKeyscore — the software the NSA uses to sift through huge amounts of raw internet data — they must first justify why they have reason to believe communications are foreign. Analysts can select from rationales available in dropdown menus and then read the communications without court or supervisor approval.

Finally, analysts do not need court approval to look at previously-collected bulk metadata either, even domestic metadata. Instead, the NSA limits access to incidentally collected American data according to its own “minimization” procedures. A leaked 2009 document said that analysts only needed permission from their “shift coordinators” to access previously-collected phone records. Rep. Stephen Lynch, D-Mass., has introduced a bill that would require analysts to get special court approval to search through telephone metadata.

As a senator, Obama wanted the executive branch to report to Congress how many American communications had been swept up during surveillance.

Feingold’s 2008 amendment, which Obama supported, would have also required the Defense Department and Justice Department to complete a joint audit of all incidentally collected American communications and provide the report to congressional intelligence committees. The amendment failed 35-63.

The Inspector General of the Intelligence Community told Senators Ron Wyden, D-Ore., and Mark Udall, D-Co. last year that it would be unfeasible to estimate how many American communications have been incidentally collected, and doing so would violate Americans’ privacy rights.

As a senator, Obama wanted to restrict the use of gag orders related to surveillance court orders.

Obama co-sponsored at least two measures that would have made it harder for the government to issue nondisclosure orders to businesses when compelling them to turn over customer data.

One 2007 bill would have required the government to demonstrate that disclosure could cause one of six specific harms: by either endangering someone, causing someone to avoid prosecution, encouraging the destruction of evidence, intimidating potential witnesses, interfering with diplomatic relations, or threatening national security. It would have also required the government to show that the gag order was “narrowly tailored” to address those specific dangers. Obama also supported a similar measure in 2005. Neither measure made it out of committee.

The Obama administration has thus far prevented companies from disclosing information about surveillance requests. Verizon’s surveillance court order included a gag order.

Meanwhile, Microsoft and Google have filed motions with the Foreign Intelligence Surveillance Court seeking permission to release aggregate data about directives they’ve received. Microsoft has said the Justice Department and the FBI had previously denied its requests to release more information. The Justice Department has asked for more time to consider lifting the gag orders.

As a senator, Obama wanted to give the accused a chance to challenge government surveillance.

Obama co-sponsored a 2007 measure that would have required the government to tell defendants before it used any evidence collected under the controversial section of the Patriot Act. (That section, known as 215, has served as the basis for the bulk phone records collection program.) Obama also supported an identical measure in 2005.

Both bills would have ensured that defendants had a chance to challenge the legalityof Patriot Act surveillance. The Supreme Court has since held that plaintiffs who cannot prove they have been monitored cannot challenge NSA surveillance programs.

Those particular bills did not make it out of committee. But another section of the Foreign Intelligence Surveillance Act requires that the government tell defendants before it uses evidence collected under that law.

Until recently, federal prosecutors would not tell defendants what kind of surveillance had been used.

The New York Times reported that in two separate bomb plot prosecutions, the government resisted efforts to reveal whether its surveillance relied on a traditional FISA order, or the 2008 law now known to authorize PRISM. As a result, defense attorneys had been unable to contest the legality of the surveillance. Sen. Dianne Feinstein, D-Calif., later said that in both cases, the government had relied on the 2008 law, though prosecutors now dispute that account.

On July 30, the Justice Department reversed its position in one bomb plot prosecution. The government disclosed that it had not gathered any evidence under the 2008 law now known to authorize sweeping surveillance.

But that’s not the only case in which the government has refused to detail its surveillance. When San Diego cab driver BasaalySaeedMoalin was charged with providing material support to terrorists based on surveillance evidence in Dec. 2010, his attorney, Joshua Dratel, tried to get the government’s wiretap application to the Foreign Intelligence Surveillance Court. The government refused, citing national security.

Dratel only learned that the government had used Moalin’s phone records as the basis for its wiretap application — collected under Section 215 of the Patriot Act — when FBI Deputy Director Sean Joyce cited the Moalin case as a success story for the bulk phone records collection program.

Reuters has also reported that a U.S. Drug Enforcement Administration unit uses evidence from surveillance to investigate Americans for drug-related crimes, and then directs DEA agents to “recreate” the investigations to cover up the original tip, so defendants won’t know they’ve been monitored.

As a senator, Obama wanted the attorney general to submit a public report giving aggregate data about how many people had been targeted for searches.

Under current law, the attorney general gives congressional intelligence committees a semiannual report with aggregate data on how many people have been targeted for surveillance. Obama co-sponsored a 2005 bill that would have made that report public. The bill didn’t make it out of committee.

Despite requests from Microsoft and Google, the Justice Department has not yet given companies approval to disclose aggregate data about surveillance directives.

As a senator, Obama wanted the government to declassify significant surveillance court opinions.

Currently, the attorney general also gives congressional intelligence committees “significant” surveillance court opinions, decisions and orders and summaries of any significant legal interpretations. The 2005 bill that Obama co-sponsored would have released those opinions to the public, allowing redactions for sensitive national security information.

Before Edward Snowden’s disclosures, the Obama Justice Department had fought Freedom of Information Act lawsuits seeking surveillance court opinions. On July 31, the Director of National Intelligence released a heavily redacted version of the FISA court’s “primary order” compelling telecoms to turn over metadata.

In response to a request from Yahoo, the government also says it is going to declassify court documents showing how Yahoo challenged a government directive to turn over user data. The Director of National Intelligence is still reviewing if there are other surveillance court opinions and other significant documents that may be released. Meanwhile, there are several bills in Congress that would compel the government to release secret surveillance court opinions.