A limited power for Customs to access electronic devices came after push-back from the Office of the Privacy Commissioner, Ministry of Justice and a Government support party.
The agency has also provided examples of when access to electronic devices preventing serious offending, including evidence of involvement in terrorism activities.
In one case, access to a device provided evidence that a passenger's reason for travel was the sexual grooming and abuse of a 13-year-old girl.
Customs Minister Nicky Wagner has announced that the Government has agreed to a series of proposals that will modernise the Customs and Excise Act, and a Bill will be drafted for introduction later this year.
When proposed changes were released by Customs in a discussion document last year, a particularly controversial area was about access to electronic devices.
Currently, when Customs examines a person's electronic device, the law does not specifically require the owner to provide a password or encryption key.
The agency says if people refuse, it can access the device by detaining it and sending it to electronic forensics staff. It is not an offence to fail to turn over a password or encryption key.
Customs' preferred option was to require passwords for electronic devices without meeting a threshold, such as suspicion of criminal activity.
Ms Wagner has confirmed it will likely get powers requiring a person to provide a password or access to their electronic devices - but a threshold such as suspicion of criminal activity will have to be met.
That compromise came after feedback from submitter's opposed to access without any threshold being met.
The Ministry of Justice noted that recent court decisions in the US, Canada and New Zealand had called for caution in framing search powers for electronic devices.
Internationally, case law recognises a fundamental difference between electronic devices and content and other items like bags or suitcases, the ministry submission stated.
Privacy Commissioner John Edwards submitted that the average person crossing the border today can carry information about much of their life with them on a cloud-connected device, including personal correspondence, and banking and medical records.
The Ministry of Business, Innovation and Employment (MBIE) supported the comments made by the Ministry of Justice and Privacy Commissioner.
Act leader David Seymour told the Government he could not support legislation that provided access to electronic devices without a threshold being met.
"Because I think it is generational. People who are over 50 or 60 think of a device as being a tool. Whereas people who are in their 20s and 30s, their whole life is on there, and it is so invasive the idea that somebody can go through it at random, at will.
"So have some thresholds in there was a compromise. I don't think it's possible to ban Customs officers from searching electronic devices entering the country. But to do it in a completely unfettered way I think would have been intolerable."
The Government has now agreed in principle that Customs needs to meet a statutory threshold before examining electronic devices, and has asked Customs to do further work on what this would look like in practice.
Customs has reported that, since 2013, only nine complaints have been made in relation to the examination of an electronic devices. In a year, it searches between 300 and 450 devices, belonging to between 48 and 72 individuals.