Legislation giving the country's spy agencies an explicit mandate to spy on New Zealanders has been introduced to Parliament.
The change is contained in the New Zealand Intelligence and Security Bill, which - if it passes - will govern both the Government Communications Security Bureau (GCSB) and the Security Intelligence Service (SIS).
The bill comes in response to a review released earlier this year.
The review, carried out by Sir Michael Cullen and Dame Patsy Reddy, found current restrictions preventing the GCSB from intercepting the private communications of New Zealanders were confusing in terms of complying with the law, and in some cases were stopping the agency from helping New Zealanders, for example those in trouble overseas.
It recommended the GCSB and SIS operate under the same rules and compliance regime.
Prime Minister John Key, who announced the new legislation at his post-Cabinet media briefing, said the government had accepted the majority of the recommendations in the review.
He said the bill would be the most significant reform of the agencies' legislation in the country's history.
The government would implement what it called a "triple-lock" system to protect New Zealanders, which would require warrants to be signed off by the Attorney-General and a Commissioner of Intelligence Warrants.
The agencies would only be able to target New Zealanders for the purpose of "protecting national security", as defined in the bill.
The review recommended a three-tier authorisation system to cover all of the activities of the GCSB and SIS, but the bill as introduced included just two types of warrants - depending on whether or not New Zealanders were likely to be involved.
The bill would also give the two agencies direct access to certain government databases such as those for customs and immigration.
They would also be able to seek access to restricted personal information such as driver licence photographs, and tax information on a case-by-case basis.
The agencies would be subject to the Privacy Act's broader principles; currently, they operate under an exemption to that act.
The GCSB and the SIS would also be brought into the core public service to improve accountability and transparency.
The legislation would make it clear that any whistle-blowing involving classified information must only be made to the Inspector General of Intelligence and Security.
It would also create a new offence for people who hold a government security clearance who "wrongfully communicate retain or copy classified information".
Mr Key said the government was keen to get broad political support for the legislation.
When the review was released, Labour leader Andrew Little said he would have to be convinced whether any expansion to the powers of the spy agencies could be justified, and whether that was in the public interest, before his party could support the legislation.
The bill will have its first reading in Parliament on Thursday.