As New Zealand troops head to Iraq a Cabinet paper reveals the Government was advised sending them there could make New Zealand a target of Islamic State.
But the paper said the risk of doing nothing was even greater and that if Islamic State became stronger the threat to New Zealand would increase.
The paper was considered by the Cabinet on 23 February when it decided to send troops to help train Iraqi army in partnership with Australia.
It made the point that a military contribution could result in New Zealand being named as a target by Islamic State.
It said national security agencies were working to identify, monitor and mitigate domestic risks. But these risks should not deter New Zealand from being involved.
The paper said the only way to eliminate these risks was to defeat Islamic State, which also posed a threat to Asia-Pacific regional security.
The director of the Centre for Strategic Studies at Victoria University, Professor Robert Ayson, said it was interesting logic.
"It is hard for us to know in advance, to be honest, how that risk profile is really going to change. And also you know it's hard to know how close to actually completely defeating ISIL the coalition may actually achieve," Professor Ayson said.
The Cabinet paper also warned that if nothing was done there was a real chance Iraq and Syria would become permanent bases for extremists, creating more instability in the Middle East and disrupting trade in the region, which was important to New Zealand.
Risks to the soldiers taking part in the deployment were also noted. These included the risk of insider attacks, direct attacks on the base and indirect fire.
There was also the risk of cultural misunderstanding, and the paper said troops would get cultural awareness training before the deployment.
The paper also breaks down the number of troops going to Iraq - although some of the information is withheld.
Of the up to 143 going to Iraq, 106 will be based in Taji, including trainers, headquarters staff, those providing protection and support staff.
Another group will be in Baghdad as staff officers at coalition headquarters, while a third undisclosed group will be at an undisclosed location. Just what they will be doing is not clear from the Cabinet document.
The paper is blunt about the prospects of success, saying the mission might not deliver the desired results.
It pointed out significant efforts have been made to build the capacity of the Iraqi army in recent years, but with limited success.
There seemed to be some muted criticism of the earlier training provided by mainly American trainers.
It said those earlier efforts raised questions about the effectiveness of training if it was not delivered in partnership with Iraqi forces and was not accompanied by broader governance initiatives.
The paper said that the new Iraqi governement under Prime Minister al-Abadi was taking a more inclusive approach to governing and he deserved support.
It said there would be a robust evaluation process to ensure the training was effective. The quality of the training and the inclusion of Iraqi forces would be the key to ensuring it was more successful than earlier efforts.
The military deployment was not the sole focus of the paper.
It also said much more needed to be done to resolve the problems in Iraq and the wider region. These included diplomatic initiatives, helping Iraq improve its governance, humanitarian aid and initiatives to undermine Islamic State's ideology.
The paper said New Zealand's work on the United Nations Security Council was also important, including pushing the council to address wider security issues through the Middle East peace process and through supporting a political solution to the stalemate in Syria.