Back in 2015, when they were the distant third party in Ottawa, the Trudeau Liberals made a calculated gamble. They supported, in spite of the gale of criticism directed at them, the Harper government's anti-terrorism bill, a.k.a. Bill C-51, a.k.a. one of the worst bills ever tabled in Parliament.

C-51 was overbroad, vague and written as if the Charter of Rights and Freedoms were some inconsequential bylaw. One clause allowed CSIS agents to seek a warrant, in a secret hearing, to violate the Charter in order to "reduce" a terror threat. The bill did not define "reduce," other than to prohibit killing, injuring or sexually assaulting a suspect. And it provided for zero accountability after the fact.

It was an irresponsible amount of unfettered power to hand to CSIS. The Harper government, though, never deigned to justify its thinking. Instead, it used Bill C-51 as a partisan wedge. At one hearing of the Conservative-dominated public safety committee in 2015, Conservative MPs rudely mocked witnesses who expressed concern about an erosion of civil liberties under Bill C-51.

Story continues below advertisement

Watch: Trudeau says new security bill balances safety with rights

Opinion: Liberals' bold Bill C-59 would redraw the national security landscape

"Are you fundamentally opposed to taking terrorists off the street?" one Tory MP asked.

Justin Trudeau recognized Bill C-51 for the trap that it was, so the Liberals voted for the law. But they promised, if elected, to bring it into line with the Charter. Bill C-51 became law in June, 2015. Five months later, Mr. Trudeau's Liberals won a majority.

This week, the Trudeau government finally tabled its promised reform of C-51. It took a lot longer than promised, but the wait has been worth it.

Bill C-59, An Act respecting national security matters, is the law the Harper government should have passed in the first place. Where C-51 was partisan and unprofessional, C-59 is a serious effort to craft a law that balances the need for a modern, data-based security apparatus with the rights and liberties of Canadians.

It reaffirms the primacy of the Charter of Rights and Freedoms. It defines what CSIS can and cannot do to reduce a threat. It narrows the reach of Criminal Code clauses about "promoting" terrorism that were too broad and which risked making political speech a crime. It better protects Canadians' privacy when government departments share information.

Story continues below advertisement

It also finally gives Canadians the right to know whether their name is on the no-fly list – something the United States did two years ago – and some modicum of recourse when someone is included in error.

Above all, the Liberal bill creates multiple layers of accountability.

The centrepiece is the proposed National Security and Intelligence Review Agency, an independent review and complaints body that covers CSIS, the RCMP and the Communications Security Establishment (CSE), Canada's signals intelligence agency. NSIRA will have broad access to information and the power to subpoena witnesses, and its annual report will have to be tabled in Parliament.

NSIRA's work would complement the Parliamentary security and intelligence committee, another Liberal election pledge. This committee, long promised and finally being set up, will play the critical role of letting elected officials with security clearance ask questions about the doings of Canada's spy agencies.

As well, C-59 would create an independent "intelligence commissioner" – a retired superior court judge "with the capacity to act judicially" who would have to approve in advance any security or data-collection activities that might interfere with the rights or privacy of Canadians.

The Liberals' proposed law also addresses the issue of "datasets" – organized subsets of bulk data obtained by the CSE and CSIS from the Internet, telecommunications and other sources.

Story continues below advertisement

Our spies aren't allowed to monitor Canadians' private communications, but they can and do monitor foreign ones, scooping up incidental Canadian data in the process. Bill C-59 lays out clear guidelines on how datasets that include Canadians' information are to be handled, who can look at them, and which ones have to be destroyed because they are too intrusive.

The Liberal bill also gives the CSE a new power to use cyber weapons to "degrade, disrupt, influence, respond to or interfere with foreign individuals, states, organizations or terrorist groups to further the government's international affairs, defence, or security objectives."

Allowing the limited retention of datasets pertaining to Canadians, and giving the CSE offensive cyber capabilities, are two major, unexpected developments that deserve careful examination. Bill C-59 needs to better define the limits of these new powers. There are a few other problematic areas of the law that need to be clarified, too. And there's always the issue of whether government will properly fund these new accountability offices.

But overall, the Liberal bill is well done. The most extraordinary thing about it is that it gives CSIS as much latitude to move quickly in the event of an imminent threat as the Harper bill did, without trampling on Charter rights. Security and rights can indeed co-exist, however uneasily, if the proper measures are in place, and the will is there to try.

If improvements to Bill C-59 are needed, critics will be able to raise them during hearings of the public safety committee in the fall. And this time, they will be able to do so without being churlishly accused of being pro-terrorist.