Keir Starmer’s most senior legal adviser has intervened in the contentious decision over whether to ban UK arms sales to Israel, the Guardian has learned, as officials struggle to distinguish between “offensive” and “defensive” weapons. Sources say Richard Hermer, the attorney general, has told Foreign Office officials he will not approve a decision to ban some weapons sales until they can say for sure which could be used to break international humanitarian law. The legal wrangling at the top of government is understood to be the principal cause of the delay to the decision, which has become even more sensitive in recent weeks as the crisis in the Middle East escalates. A Foreign Office spokesperson would not comment on Hermer’s role but said: “This government is committed to upholding international law. We have made clear that we will not export items if they might be used to commit or facilitate a serious violation of international humanitarian law. “There is an ongoing review process to assess whether Israel is complying with international humanitarian law, which the foreign secretary initiated on day one in office. We will provide an update as soon as that review process has been completed.” David Lammy has launched a review into whether the UK should continue selling weapons to Israel as the country continues its assault on Gaza. The foreign secretary has talked about banning the sale of “offensive” weapons but allowing arms manufacturers to keep supplying “defensive” ones, saying that such a move would enable Israel to defend itself. Although the UK only exports about £18m worth of military equipment to Israel each year, the Israeli government is sensitive to any suggestion that Britain believes it to have breached international humanitarian law. Benjamin Netanyahu is already said to be upset by Lammy’s decision to drop the UK’s objection to the international criminal court issuing an arrest warrant against him. Now the Israeli prime minister is closely watching the outcome of Britain’s arms review. The decision has become even more significant in recent days after Israel launched airstrikes on Lebanon while Hezbollah carried out a drone and rocket attack against northern Israel, triggering fears of a broader Middle East conflict. Lammy was expected to announce the results of his review before MPs went away for their summer break. But the decision has been held up because senior members of the government are not certain they will be able to defend the distinction between offensive and defensive in court. Officials are going through each individual type of weapons system in an attempt to determine what purpose each has been used for. Hermer, an ally of the prime minister, Keir Starmer, since they were in legal practice, has told officials they need to be certain that any weapon that continues to be sold has not been used to breach international humanitarian law. Starmer is also understood to be taking an active role in the decision-making process, despite the review officially being carried out by the Foreign Office. Officials are keen to avoid a repeat of 2019, when the court of appeal ruled that British arms sales to Saudi Arabia were unlawful and that ministers had not given due consideration to whether they had been used to break human rights law in Yemen. Last week a group of human rights lawyers submitted a case to the high court accusing the government of acting irrationally by refusing to ban arms sales. As part of their claim they submitted more than 100 pages of witness testimony containing allegations that Palestinians had been tortured, left untreated in hospital and were unable to escape heavy bombardment. “International humanitarian law is vague but it does say we need to show we have considered every possibility,” said one person aware of the process. “That’s why the main hold-up here is legal, not diplomatic.” While the review goes on, the government appears to have stopped issuing new licences for weapons sales to Israel. Exporters applying for new licences are reportedly receiving messages from the Department for Business and Trade saying that applications are suspended until the review is complete. Despite this, the delay to the review has caused upset in some parts of the British government. Earlier this month a British diplomat in Dublin quit his job because ministers had not yet banned weapons sales to Israel. Mark Smith told the BBC he believed Israel was “perpetrating war crimes in plain sight”.