New Zealand's intelligence agencies have been given the green light to spy on New Zealanders but there will still be plenty of debate about how and when they would be allowed to do that.
Under legislation introduced to Parliament giving the agencies an explicit mandate to spy on New Zealanders, one of the criteria is that it must be to "protect national security".
Much of the debate will be on the definition of national security, as laid out in the bill, with many arguing it is far too broad.
A review by Sir Michael Cullen and Dame Patsy Reddy found restrictions preventing the GCSB from intercepting private communications of New Zealanders was confusing in terms of complying with the law.
In some cases it stopped the agency from helping New Zealanders, for example, in trouble overseas.
The government will implement what it calls a "triple-lock" system to protect New Zealanders, including a "Type One" warrant to be signed off by the Attorney General and a Commissioner of Intelligence Warrants.
The minister responsible for the two agencies, Chris Finlayson, said the warrant had to be "necessary and proportionate", and they would also be reviewed by the Inspector General of Intelligence and Security, Cheryl Gwyn.
"So, she could come back no doubt and say in the circumstances 'I don't think a Type One warrant was justified' ... and it would be a very cavalier minister and a very cavalier Commissioner of Warrants who wouldn't take that information into account."
Labour Party leader Andrew Little agreed the spy agencies needed greater range of powers to deal with groups that posed a threat to New Zealand.
"People want to know that the government has agencies committed to ensuring our economic protection and our national security. We have to have that.
"It's the question of the powers that they have and the balance against citizens rights and that's always where the argument is. It's where the argument will be on this legislation," Mr Little said.
But he said his party still had concerns about various aspects of the legislation.
"There's still the issue about access to some of the government databases, even though the legislation says there will be no access to the police criminal database.
"There's issues about the intelligence and security committee, the question is whether the numbers proposed will still be big enough to achieve effective representation of all reasonable sized parties in parliament," Mr Little said.
"But there's enough there in the legislation to support it at its first reading and get it in front of a select committee and tease out those remaining issues."
However, the Green Party sees no compelling reason to support the bill. Green MP Kennedy Graham said his party did not believe the heightened national security concerns, as stated by the government, justified an extension of the agencies' powers.
Another area of activity covered by the bill is when either agency accesses personal information from other government agencies or private companies.
Dr Cullen described the current regime as "open slather" as the agencies had a Privacy Act exemption, meaning the operated under few checks and balances.
The new bill gives the agencies the explicit mandate to access personal information, but they are now subject to the broad principles of the Privacy Act.
Privacy Commissioner John Edwards said it was a significant improvement, as information-sharing agreements would have to be established before data was accessed.
"They will specify a whole lot of things like audit arrangements, well I would expect that, so there would be checks to see why there was access at a given point, and agents would be asked to justify that."
As Privacy Commissioner, Mr Edwards would be actively involved in that process.
The bill also laid out stricter procedures for the SIS when it is carrying out security clearances, after it was criticised for the way it was handling the information collected during the vetting process.
The legislation will have its first reading in Parliament on Thursday.