Two-term member for Longman Wyatt Roy, who lost his seat in the last federal election, recently ducked unexpected Islamic State gunfire in northern Iraq, SBS revealed last night to the nation’s bewilderment.

In a impassioned piece for The Australian published shortly after SBS’ scoop, Roy called on Australia to offer its support to the embattled Kurds. As to why he was there, he wrote:

“I was there to see a mate, get a feel for the environment, and talk to policymakers and industry leaders about their experience.”

A few hours later, and the former MP copped (verbal) flak from parliamentary figures for his unexpected travel itinerary, including from Foreign Minister Julie Bishop and Prime Minister Malcolm Turnbull. He has found some support, though, with several senior journalists who have gone to war zones saying they could hardly blame the young man for proactively wanting to see things for himself. Andrew Bolt has also called Bishop’s attack on Roy “spiteful”.

Here in the bunker however, we wondered: has Wyatt Roy broken the law?

We asked DFAT that question specifically, but the department referred us to Julie Bishop’s statement on Roy’s trip.

That statement reiterated the government’s advice for Australians to not travel to Iraq and notes that travel to Mosul, part of Iraqi Kurdistan under the control of Islamic State, is banned.

To figure out if Roy did anything wrong, one needs a bit of geography.

Roy has yet to reveal how he travelled to Iraq. However, he has been explicit on where in the country he travelled (and we’re taking his word for it that these are the only places he went. As Penny Wong said today, he could have gone to proscribed places and not reported it). Many parts of northern Iraq are currently held by the Peshmerga, the military force of Iraqi Kurdistan, which is an ally of Australia. The Australian government delivers weapons to the Peshmerga, and they receive military support from Coalition forces in the region. In Roy’s first-person account of his travels, he names two locations he visited: Sinjar and Lalish, the site of an important Yezidi temple. Sinjar has been held by the Kurds since November last year. SBS’ piece says they spoke to Roy from the capital of Iraqi Kurdistan, which is Erbil, not held by Islamic State.

The legislation on where Australians can and can’t go in Iraq is very clear, says Deakin University counter-terrorism expert Greg Barton, and Roy has not said he visited no-go zones.

“It is illegal for an Australian to be fighting with a foreign militia,” he told Crikey this morning. This doesn’t have to mean picking up a gun — it could be giving support, which is a bit of a grey area. Roy was certainly with a foreign militia. But nothing revealed yet suggests he was fighting with them. The burden of proof for this generally rests on the prosecution, not the defence — it would take evidence of Roy having fought with the Peshmerga for him to be in trouble.

Barton says that about 40 Australians have returned from Syria or Iraq with few issues because no proof existed of them having fought in the conflict (though others have been charged and/or investigated). There have been calls to exempt those who fight with the Kurdish forces from the Foreign Incursions Act, which makes it illegal for them to do so.

In 2014, the broad prohibition on joining a foreign militia was expanded, Barton says. If someone had been in areas held by Islamic State, the burden of proof would be flipped — that person would have to prove they weren’t working with Islamic State. These banned areas include Mosul, in northern Iraq, and Raqqa, in Syria.

By Roy’s account, he was more than several dozen kilometres away from these areas. “It doesn’t seem he like, knowingly or otherwise, broke the law,” said Barton.

Mind you, Barton says Roy took a huge risk, both legally and in safety terms. He offers the hypothetical of a life-or-death unexpected firefight, in which an Australian citizen might be forced to pick up a gun for self-defence. “If it’s a close-run thing about whether your group survives, you might play a role. You’d understand why someone would take part in a fight.” Though Barton says it’s quite possible that in a court of law, this would be taken into account in sentencing.

“It’s a tricky area, and morally fraught, but the current legal balance makes sense,” Barton added. “If you go off to do national service, there are checks and balances to make sure you do the right thing.” In more informal militas, Barton says, there are fewer checks to make sure even Australia’s allies do not engage in war crimes. And the laws are partly there to protect idealistic young Australians from themselves.

“Idealistic young Australians who do genuinely want to help sometimes don’t realise that in an area where kidnapping for ransom is rife, and high prices on Westerner’s heads, they can end up doing harm.”