Canada is going all-in when it comes to cyberwarfare.

The Trudeau government’s new national security legislation would let Canada’s electronic spy agency, the Communications Security Establishment, launch cyberattacks against foreign targets, including terrorist groups and even other countries.

The Liberals say the measure is necessary to protect Canada from evolving threats, and that any attacks would require government approval.

If passed, the legislation would not allow the CSE to target Canadians or any person in Canada.

The new powers follow recent warnings that cyberattacks are likely during the next federal election in 2019, and new military marching orders to start working on offensive cyber-capabilities.

The Liberals are also preserving the powers that had been previously given to Canada’s other spy agency, the Canadian Security Intelligence Service, to disrupt foreign threats.

The government says it is balancing the new powers with extra oversight, and creating a new intelligence commissioner to review government decisions when it comes to certain cyber and intelligence operations.