Two years after campaigning to pull back the controversial aspects of the previous government’s anti-terrorism reforms, the Liberal government is finally following through with its pledge.

Bill C-59, tabled by Public Safety Minister Ralph Goodale on Tuesday, makes wide-ranging changes to Canada’s national security framework — adding significant and expansive new oversight for intelligence collection and surveillance; putting new limits on government surveillance; and codifying the powers of Canada’s signals intelligence service.

The most significant change to the bill will create new powers that will allow the Canadian Security Intelligence Service (CSIS) to analyze and exploit datasets with information obtained on Canadians and foreign citizens. The new law will give clear directions for how CSIS can use advanced technology to analyze data, without worrying so much about the courts.

Previously, CSIS had few legal guidelines on how it could use intelligence collected in the course of its investigations — an issue highlighted when a federal court spanked the spy agency for running an advanced data analytics program for more than a decade with few constraints or limitations.

Under this law CSIS has the authority to analyze and decrypt intelligence they’ve obtained through a warrant or collected from open sources — which could include “phonebook” information, but also social media profiles and information available online. This regime is subject to approval from within CSIS, by an independent intelligence commissioner, and by the courts.

This new power is likely a boon for the Operational Data Analysis Centre, which can pour through huge sums of intelligence to try and establish links or connections.

While CSIS will have some updated powers to process its raw intelligence, much of C-59 will actually walk back powers given to it under C-51, introduced by the previous Harper government — which has become a scourge amongst privacy advocates and lawyers.

Here’s what the bill does to the powers laid out in C-51.

Disruption powers

C-51: Allows CSIS to take whatever measures to reduce a threat to the security of Canada, so long as they’re “reasonable and proportional” and they don’t cause bodily harm or interfere with the course of justice. CSIS won’t need a warrant to do so, unless it believes they will contravene Canadians’ constitutional rights — in which case, a warrant is required.

What the Liberals promised: “We will … guarantee that all Canadian Security Intelligence Service warrants respect the Charter of Rights and Freedoms.”

C-59: Provides a new list of ways in which CSIS is allowed to disrupt a threat, including deleting communications, fabricating information, making or interrupting financial transactions, interfering with travel, or impersonating another person. Those new powers will be able to “limit a right or freedom” guaranteed by the constitution, but only if a judge is satisfied it is a reasonable limit.

Terrorism propaganda

C-51: The legislation imposed a broad new criminal prohibition on terrorism propaganda — meaning that anyone found guilty of instructing someone to carry out a terror attack, regardless of whether it happens, could face life in jail.

What the Liberals promised: “We will … narrow overly broad definitions, such as defining ‘terrorist propaganda’ more clearly.”

C-59: The new law requires that someone must directly counsel another person to carry out a terrorism act, and clarifies that “propaganda” must be a writing, image, or recording. The penalty is now a maximum of five years in prison.

Peace bonds

C-51: The legislation significantly lowered the legal requirement necessary to arrest someone suspected of a terrorism offence and subject them to a peace bond — an agreement that could restrict their movement, or set conditions on their internet access.

What the Liberals promised: Nothing on peace bonds appeared in the Liberal platform, but the party had expressed worry over the fact that the bonds didn’t do enough to stop Aaron Driver, a Winnipeg man who had attempted to join the Islamic State, from detonating a small bomb in the back of a taxi near Toronto.

C-59: The bill will make it harder for prosecutors to obtain a peace bond, requiring that the Crown prove that a peace bond would be “necessary” to prevent terrorist activity, as opposed to it being simply “likely.”

Perhaps what is notable in the legislation is what isn’t present.

There is, for example, no changes to the powers enshrined in C-51 that allow police to preventatively detain someone who they suspect will commit a terrorism offence, nor are there significant new limitations on how CSIS can share intelligence with other departments or governments, or vice versa.

On the other hand, Goodale appears to have abandoned plans to write in a litany of new powers into the legislation.

For months, VICE News and others have reported that the government was considering broad new powers to allow national security agencies to obtain Canadians’ data without a warrant, crack and hack cellphones, force companies to decrypt communications, and mandate interception powers for telecommunications providers.

None of those powers appear in the legislation, perhaps due to the overwhelmingly negative responses to those ideas.

In the end, it seems the best advice came from their own back yard. A report prepared by the House of Commons national security committee recommended many of the changes that wound up in the bill.

The new legislation is getting tempered praise from the staunchest critics of C-51.

University of Ottawa law professor Craig Forcese, one of the country’s main national security law academics, wrote on Twitter that the bill “bears hallmarks of careful deliberation, puzzling through problems,” calling it a “totally different world from hell that was C-51 process.”

Open Media wrote on Tuesday that: “This legislation is a positive step forward, but does not fully address the fundamental privacy concerns expressed by Canadians.” They went on that C-59 does not address “the use of invasive mass surveillance devices such as Stingrays, or legislative protections for encrypted communication technologies which are critical to our digital and economic security.”

The B.C. Civil Liberties Association wrote in a press release that they welcome “important and long-needed ‘fixes’ but remains disappointed that so much of Bill C-51 is still intact.”