Congress has just five weeks to decide the fate of key foreign intelligence surveillance powers — forcing a showdown between surveillance reformers and defenders. And now, a group of Republicans and Democrats have unveiled the strongest comprehensive reform proposal that we have seen yet.

The Safeguarding Americans’ Private Records Act of 2020, introduced by a bipartisan group of members including Sens. Wyden (D-Ore.) and Daines (R-Mont.), is a strong first step. The bill is a response to the spying abuses that seem to pile up by the day — the collection of over a billion call records, spying on a prominent Trump advisor based on flawed evidence, and use of extraordinary measures to prevent courts from judging the legality of the government’s practices.

There are many things to like about the bill.

For one, it makes many strong reforms to Section 215 of the Patriot Act — the infamous law that was used by the Bush and Obama administrations to collect the call records of nearly every single American. The bill puts a definitive end to the call record program, which was recently suspended by the NSA amid a cascade of reports revealing unauthorized record collections and legal violations. The bill also heightens the legal standard that the government must meet to collect records under Section 215 and rightly requires the government to purge those records within three years, with limited exceptions.

In addition to reforming Section 215, the bill also attempts to rein in other national security authorities that the government has abused. For example, it inserts a sunset into the Justice Department’s “National Security Letter” administrative subpoena authorities, which the government has often misused to collect information in non-terrorism cases and pressure companies to turn over information that the government should only be demanding with a court-ordered warrant in hand. Such a sunset will rightly prompt oversight by Congress and a debate over whether these provisions should be permitted to continue at all.

Moreover, the bill takes a first step towards ensuring that individuals trapped in the government’s surveillance regime can better exercise their constitutional rights. In particular, the bill requires the government to notify individuals in cases where information “obtained” or “derived” from Section 215 collection is used against them. It also defines the meaning of “derived” within The United States Foreign Intelligence Surveillance Court (FISA) to prevent the government from engaging in legal gymnastics and evading its notice obligations.

Finally, the bill takes an initial step towards reforming the secretive, one-sided intelligence court. The Carter Page debacle brought the deficiencies of the court into stark relief: despite numerous omissions and inaccuracies, the FISA court approved an initial application and three subsequent renewal applications targeting the Trump campaign advisor for surveillance. To help prevent these types of abuses in the future, the bill would enhance the power of amici curiae — “friends of the court” – whom the FISA currently appoint in a narrow number of novel and significant cases — to raise concerns in a larger subset of proceedings or to recommend a case review by a higher court. In addition, the bill would put in place several added transparency measures to give the public a better understanding of how the government is using the Patriot Act and other spying powers.

Despite these strong provisions, the proposed bill is far from perfect and members of Congress should address its gaps.

For one, the bill fails to fully protect the rights of defendants by ensuring they have access to FISA applications and orders in cases where intelligence information is used against them. If, like Carter Page, someone was improperly surveilled on the basis of government misstatements or omissions, they should have the ability to prove the government was wrong. Along the same lines, the bill does nothing to ensure that individuals who are spied on but never prosecuted are notified. Criminal statutes like the Wiretap Act have long required after-the-fact notice to surveillance targets, with provisions designed to protect ongoing investigations. There is no reason that a similar requirement should not exist in the intelligence context.

Second, Congress needs to place greater limits on the Patriot Act and other surveillance powers to strengthen First Amendment protections and ensure intelligence authorities are not abusing the laws to discriminate on the basis of race, ethnicity, national origin, or other protected characteristics.

Third, while the bill makes a notable effort to limit the types of records that can be obtained under Section 215 — prohibiting the collection of cell site location information, GPS information, and browsing history, among others — this language should be strengthened. Congress must make crystal clear that the government cannot use Section 215 to obtain other types of location information or sensitive records, like tax returns or medical records. Under Section 215, the government can obtain large quantities of records by merely showing that they are “relevant” to a terrorism or counterintelligence investigation. This standard is much weaker than the probable cause standard required by warrant. Thus, in cases where the government seeks these sensitive records, they should be required to meet a higher evidentiary threshold.

Finally, additional reforms are needed to fully empower the FISA court amici and tackle the deficiencies within the intelligence courts. Elements from a recent bill sponsored by Reps. Nunes (D-Calif.), Stewart (R-Utah), and other Republicans should be incorporated, including language requiring amici participation in proceedings targeting Americans, directing the amici to assess the sufficiency of evidence and increasing transparency over the court’s proceedings.

The clock is ticking — and it’s past time for Congress to pass these critical reforms.

This Open Editorial is by Neema Singh Guliani of the American Civil Liberties Union Senior Legislative Counsel