Foreign security agents would have been free to intercept New Zealanders' cellphone calls under a bill paving the way for the Apec summit next year.
But the special-purpose legislation has been changed to stop that. However, it still lets the police commissioner sign off for foreign agents to carry weapons.
The government is pushing ahead with hosting Apec despite Covid-19 disrupting the preparations, and despite past summits attracting controversy for their cost and heavy-handed security.
The year-long series of events culminates in a summit of leaders from 21 Pacific rim countries in November 2021 in Auckland.
However, the Ministry of Foreign Affairs and Trade's advice to a parliamentary select committee last month shows the Asia-Pacific Economic Cooperation (APEC 2021) Bill paving the way was flawed.
"The bill initially enabled use of capabilities that could intercept and analyse private communications.
"However, further advice has been received that this is not needed to secure Apec 2021," MFAT told the select committee.
The committee had heard that New Zealand Police and foreign security forces would be deploying electronic devices that can jam radio signals to bombs and drones.
But Green MP Golriz Ghahraman said the draft bill went further than that.
"What came out under questioning from me, was that the devices were capable of and would be collecting much more data than that, and where they were able to collect data off a phone, for example, that would include both meta-data and in some cases actual text," she said.
"And we all know that all of our lives are on those devices now."
The special Apec surveillance powers were to have kicked in from July this year until late November next year, though the bill itself has been delayed due to the pandemic response.
Ghahraman said it was surprising to find such wide surveillance powers in a bill that had already passed its first reading in November 2019, when the Greens opposed it for allowing foreign agents to carry weapons.
"I think the reason it wasn't known is that officials were telling us what the purpose of the capability was - but if it's going further than the purpose, that's exactly what we need to know and stop, and be very clear in the Act that we don't want to cover."
It was "disappointing" that it was not clear what was being proposed.
"We know that often, even under search warrant regimes, authorities go much further than what's actually being sanctioned," Ghahraman said.
"So I was much more interested in how much further than what we think we're sanctioning, can they go."
Privacy Commissioner John Edwards said it was unintentional.
"To be fair to officials, they didn't mean to allow for an interception capability, but the drafting hadn't quite captured what they intended," he said.
He had pushed for judicial oversight of the extra powers.
"The proposals are disproportionate as they allow for the widespread interception of personal information of New Zealanders who are not suspected of being a security threat or of committing any offence," his submission to the select committee said.
"Foreign security agencies using ... [wireless electronic] technologies may not be subject to the same level of privacy protections as New Zealand law enforcement, and individuals are unlikely to be able to seek redress from them should their privacy be unjustifiably infringed."
The bill, now amended, retains the jamming powers for local and foreign security when authorised by the police commissioner.
"What they won't be allowed to do is intercept private communications between New Zealanders," Edwards said.
The changes do not introduce judicial oversight, but he was fine with that.
"I am much more comfortable about a police commissioner authorising, given that it's only for that technical purpose, and it won't allow the interception of phone calls and the like."
The police commissioner will also still be able to authorise foreign security agents to carry weapons, as is usual at Apec events.
But the MFAT supplementary advice said the draft bill ran the risk of giving the agents "a form of immunity for actions taken during the course of their duties".
So that has had to be changed, too.
The Council for Civil Liberties said the amendments were good, but mere tweaks.
"The bill is all focused on control and stopping people doing things," its spokesperson Thomas Beagle said.
"There needed to be more protection, explicitly in there, for people who want to be able to protest against some of these political leaders."
At Apec 1999, police threatened a Christchurch high school student with arrest and used a bus to block protests targeting China. An inquiry found police actions were overbearing and infringed on civil rights.
The new bill showed the country had learnt nothing two decades on, Beagle said.
"We don't want to have to have another inquiry after this Apec 2021. Obviously, we would want it to be safe, we don't want any sort of violence or anything like that done, but at the same time we want to make sure that people in New Zealand can exercise their right [to protest]."
The Law Society in its submission said the bill granted "significant coercive powers" to members of the armed forces and APEC security staff, including unusual support to police law enforcement, and this needed more checks and balances around it.
Auckland Mayor Phil Goff said the leaders' summit was 18 months away and he assumed it would proceed if pandemic-related delays were resolved by then.
Apec 2021 would help the economy recover.
"However, all of this will be subject to retaining controls necessary to protect Aucklanders and New Zealanders from the import of Covid-19 for as long as it remains a threat."
The hosting costs are largely being met by the New Zealand Government.
MFAT said the event would "showcase regional leadership, advance interests in the Asia-Pacific and create new business for New Zealand companies".