In its single annual public appearance, the Government Communications Security Bureau (GCSB) has mounted a strong defence against claims of indiscriminate data collection.
Investigative journalist Nicky Hager claims the agency is carrying out mass surveillance on Pacific countries.
He says New Zealanders' private communications is caught up in that, and handed over to the United States.
The acting head of the electronic spy agency, Una Jagose, and the head of the Security Intelligence Service (SIS), Rebecca Kitteridge, appeared before Parliament's Intelligence and Security Committee this morning.
Ms Jagose said that while she was still very new to the job, she was satisfied the agency's actions were legal, and that it operated within very tight legal boundaries.
She and Ms Kitteridge also told MPs that there was very robust oversight by the Inspector General of Security and Intelligence, who could investigate every aspect of their operations, at any time.
Ms Jagose acknowledged there was a tension between public transparency, and the secrecy necessary for the agency to carry out its work.
But she said she wanted to assure the public the agency was not carrying out mass, unwarranted surveillance, or targeting the private communications of New Zealanders.
When she heard the phrase mass collection, or mass surveillance, she thought of "some indiscriminate, for no purpose, not necessary, collection of information for collection's sake," Ms Jagose said.
"And we do not do that."
She said all data collection had to be covered by a warrant, which had several checks and balances.
Ms Jagose said sometimes it was hard to know whether a New Zealander was involved by a cellphone number or email address, saying that isilgirl.co.nz may not be a New Zealander, but isilboy.com may be.
She said if New Zealanders' information was collected it must be destroyed.
New Zealand is part of a spy network, the Five Eyes, with the United States, Australia, the United Kingdom and Canada.
Ms Jagose told MPs while the GCSB did share information and training with Five Eyes members, they did not collect data on their behalf, or share all collected data with other members.
'And we obtain a lot more benefit for New Zealand than we give to that partnership because we're able to work with other specialists who know about the best way to do things."
Ms Kitteridge said the SIS did get requests for information from Five Eyes partners, which was not always provided.
"It's our role to think very carefully about how we share information with both New Zealand agencies ... and also whether we would share information internationally, beyond Five Eyes as well."
She gave the example where the SIS identified someone who was a security concern who was a citizen of another country, and then whether they'd contact the agency in that country to inform them.
"But we always go through some real consideration about how we share information and it does depend on issues such as their human rights record ... and sometimes we won't.
"Some information is only appropriate for New Zealand eyes only, it's not appropriate for others."