The inquiry into the Covid-19 privacy leak will be headed by Michael Heron QC, with three weeks to report back.
The State Service Commission was brought in over the weekend after revelations of a major breach - the names, addresses and location of the 18 people in quarantine last week after testing positive for Covid-19.
RNZ and two other media outlets have reported seeing those details. If found to be a malicious and deliberate leak, criminal charges could result.
A range of agencies could come under scrutiny: health, police, defence force, customs, aviation security are all involved in the government response; there's also the 'All of Government Group', headed by former police commissioner Mike Bush, which operates as a unit within the Department of Prime Minister and Cabinet. The facilities being used for managed isolation and quarantine would also have access to that information.
Under the terms of reference finalised this afternoon, the inquiry will look at "who or what caused the disclosure of the information, identifying what, if anything might have prevented this from happening and what, if any, improvements might prevent this from happening in the future", said State Services Minister Chris Hipkins.
In her post-Cabinet conference this afternoon, Prime Minister Jacinda Ardern said there were no political motivations behind the inquiry.
"When we have leaks of a political nature, we don't take those kinds of steps but when this is someone's personal health information, we do need to take that seriously - I don't think there's any politics in that," she said.
"We do need to make sure that people can have an assurance that when they're dealing with health authorities or if they're dealing with our quarantine facilities that their information is being properly looked after."
Heron will use the powers of the State Services Commissioner under the State Sector Act 1988 and the Inquiries Act 2013.
"That will give Mr Heron the power to, if necessary, require the production of documents, summons witnesses and question parties under oath," Ardern said.
There were a "number of potential theories" about how the leak happened, Hipkins said, but he would not speculate at this point.
"Our primary concern is to find out exactly what happened ... we will get to the bottom of how this data came into the public domain.
"I think we're likely to get close - if we can't find out exactly what happened that would be disappointing."
He said media outlets had acted very responsibily by saying they would not contact any of the people whose names and other details have been leaked, and it was not known whether the information was leaked in a hard copy or electronic format.
It was unlikely to have been an accidental breach, however.
"I don't think that information tends to be accidentally sent to multiple media outlets at the same time," Hipkins said.
Hipkins was asked whether the media outlets who had reported seeing the leaked information would be be forced to hand over any material to the inquiry.
That "would up to the investigator", he said.
"Michael Heron QC has been involved in these processes before ... everyone would understand the significant threshold that one would have to cross before they were to compel media to provide information."
New Zealanders had a right to expect that information would be kept confidential, he said.
Officials involved had already "looked at all of the people who might hold this information, all of the ways this information is stored, to ensure that any immediate steps that can be taken to better protect it have been taken", he said, and was a reason the inquiry would be done with urgency.
The inquiry has a three-week deadline, having been asked to report back at the end of the month.
Heron is a former Solicitor-General, who has carried out a number of high profile reviews, including into how convicted Czech drug smuggler Karel Sroubek was granted residency; the fatal 2010 Anzac Day Defence Force crash; and Cycling New Zealand's high performance programme.
He was also appointed by Speaker of the House Trevor Mallard to investigate a leak of then-opposition leader Simon Bridges' expenses to the media in 2018.