Prime Minister John Key has announced sweeping changes to the powers of the Government Communications Security Bureau.

Key said failure to do so would leave New Zealand's national security open to threat.

"As prime minister I am simply not willing to do that. To do nothing would be an easy course of action politically, but it would be an irresponsible one."

The changes would allow the GCSB to provide information assurance and cyber security advice and help to both public and private sector organisations, and allow it to assist other entities such as the New Zealand Security Intelligence Service, New Zealand Defence Force and Police while retaining its foreign intelligence gathering powers "broadly as is".

The change follows a top level report revealing widespread problems within the bureau and more than 80 cases where it may have spied on New Zealanders illegally.

The potential illegality was uncovered in the wake of revelations the GCSB spied on German internet entrepreneur Kim Dotcom illegally, apparently under the mistaken belief he was not a New Zealand citizen or resident.

A 2003 law change explicitly barred the GCSB from spying on Kiwis.

Key said the cases of potential illegality involved the GCSB assisting police and the Security Intelligence Service acting under warrants. It believed the law allowed it to do so.

But the legality of that has now been called into question.

The terrorism threat in New Zealand is low but people have tried to use our technology to build weapons of mass destruction, Key said.

Every day the Government Communications Security Bureau (GCSB) protected the country from a range of threats and ordinary New Zealanders had no need to be threatened by its activities, he said.

However, there were people in New Zealand who funded, or were involved in, terrorist attacks.

"There are people within our country who have links to offshore terrorist groups," the prime minister said.

That included cyber attacks and covert attempts to use science and technology for projects involving weapons of mass destruction, Key said.

"I cannot tell New Zealanders everything our intelligence agencies are doing, or what the details of their operations are," he said.

But Key said their work was vital.

He refused to say what the support was that the GCSB provided to the Defence Force, police and domestic spy service the Security Intelligence Service.

"I'm not going to go into the details of what they do," he said.

He also refused to say whether information on New Zealanders was passed on to foreign agencies.

Legislation to introduce changes to the law governing the GCSB would hopefully be passed by the end of the year and there would be public hearings, Key said.

It was not decided whether the changes would retrospectively affect the more than 80 New Zealanders believed to have been illegally spied on, he said, but GCSB would not be helping other agencies until the law was passed.

"It is now the responsible thing to do to clarify the legislation, to make it clear the GCSB can provide support to agencies which are undertaking their lawful duties.

Under the proposed law change, the GCSB would retain its three main functions, which were:

Information assurance and cyber security

Foreign intelligence

Co-operation assistance to other agencies.

Key said the existing legislation would be amended to make it clear the GCSB can use its powers when undertaking activities in all these areas "subject to controls and conditions".

"We intend to make it clear the GCSB can undertake activities on behalf of other named agencies where those agencies can lawfully undertake those activities.

"This includes the other agencies lawful investigations of New Zealanders."

Section 14, which prohibits activities involving New Zealanders will be retained "but will apply only to the foreign intelligence function of the GCSB and not to the other two functions".

"This will allow the GCSB to provide essential support to specified agencies and to undertake important work with both public and private sector New Zealanders in the area of information assurance and cyber security.

There would also be enhanced oversight arrangements, including a wider pool of candidates able to perform the role of inspector general of security and intelligence, meaning they do not have to be a retired high court judge; the inspector general's office would be more pro-active, rather than review focused, and able to launch its own inquiries more easily; extra staff and resources; legislation expanding the inspector general's work programme, and more transparency.

Key said current inspector general Paul Neazor is not planning to stand again for the new position.

The terrorism threat in New Zealand is low but people have tried to use our technology to build weapons of mass destruction, Key said.

Everyday GCSB protected the country from a range of threats and ordinary New Zealanders have no need to be threatened by its activites, he said.

However, there were people in New Zealand who funded, or were involved in, terrorist attacks.

"There are people within our country who have links to offshore terrorist groups."

That included cyber attacks and covert attempts to use science and technology for projects involving weapons of mass destruction, Key said.

"I cannot tell New Zealanders everything our intelligence agencies are doing, or what the details of their operations are."

But their work was vital, Key said.

He refused to say what the support was that the GCSB provided to the Defence Force, police and SIS."I'm not going to go into the details of what they do."

He also refused to say whether information on New Zealanders was passed on to foreign agencies.

Legislation to introduce the changes would hopefully be passed by the end of the year and there would be public hearings, Key said.

It was not decided whether the changes would retrospectively effect the more than 80 New Zealanders believed to have been illegally spied on.

But GCSB won't be helping other agencies until the law is passed.

Key also announced an inquiry into the leak of "the unauthorised disclosure" of cabinet secretary Rebecca Kitteridge's report on GCSB.

Details of the report were leaked to Fairfax Media in advance of its publication.

A former senior public servant, David Henry, would head the inquiry, Key announced.