When I first stood for Islington South and Finsbury – the Lib Dems’ number one target seat in the country in the post-Iraq election – Robin Cook came and spent a day campaigning with me. He told everyone he spoke to that I’d been on all the same marches against the war as him, so voting against me to register a protest against the war made no sense.

We talked a lot that day about how he’d felt undermined from within when it came to making a reality of his famous ‘ethical foreign policy’, especially when it came to ending the sale of arms to human rights abusers, just because they were our allies. And more in sorrow than anger, he spoke about what a predictable mess things had become in Iraq.

A few months later, he was gone. It was one of the saddest days of my political life, both because he was a giant of the movement and because I’d lost a mentor just after I’d found him. But I’ve never forgotten the lessons he taught me, and every time I’ve confronted a new foreign policy issue over the last four years, I find myself asking: “What would Robin do?”.

I believe there are three key principles and policies that flow from those lessons. First, you can’t play favourites when it comes to countries who are abusing human rights or breaching international law. As Robin himself said in 1999, we must never “turn a blind eye to how other governments behave and a deaf ear to the cries for help of their people”.

That’s why I’ve criticised this government’s bowing and scraping attitude to countries like Israel, China and Bahrain, and why any government I lead will instead use our position on the UN Security Council to call out all abuses from all countries on the biggest stage.

Second, you should never embark on a military intervention unless you’re clear about the mission, the exit strategy, what will happen in the aftermath, and have clear international backing for your actions. That’s the approach Robin took on Kosovo, East Timor and Sierra Leone, and why he felt ethically obliged to resign over Iraq.

It’s also why Labour would introduce a War Powers Act, so parliament can hold us to account on those tests before voting on any proposed intervention. And it’s why I would personally lead the revival and reform of the ‘Responsibility to Protect’ doctrine – a great achievement, but it has been appropriated by hawkish warmongers in the US and UK to justify illegal interventions and wars of regime change.

And third, we must make Britain – to use Robin’s phrase – “a force for good in the world”. We must never let other priorities, like trade, cloud our judgement and allow our government’s foreign policy to be devolved to foreign leaders who are clearly a force for bad, from Egypt’s Sisi and the Philippines’ Duterte to Donald Trump and Crown Prince Bin Salman.

Those priorities will stick with me if I’m Labour leader. But I’ll also seek to complete the job that Robin Cook never could, as he told me sorrowfully that day in 2005. As he said, he was stymied in his efforts to make his reforms to the arms export licensing regime work in practice, because of the pressure he was under to put other trade and security considerations first when it came to certain countries. And as we’ve seen from the last five years in Yemen, exactly the same problem persists today.

I previously agreed with shadow cabinet colleagues that we would legislate to reform the licensing regime by obliging the government to provide transparent evidence on the basis for its decisions and on the proposed end-use of each consignment, and that ministers should take independent advice from non-governmental experts before making their decisions.

But my concern about only going that far is that any future Tory government could just change the legislation again, and go back to their old ways. We need to make changes that will be effectively binding on every future government.

So, just as Gordon Brown did in 1997, when he made the Bank of England independent and gave it full control of interest rates, a decision no future government would ever dare reverse, I would achieve the same permanent reform of the arms export regime. I would legislate to take those decisions entirely out of the hands of politicians.

I would put them instead in the hands of a panel of independent legal experts who care only about compliance with international law, to be interviewed and appointed not by ministers, but by the cross-party Commons Committee on Arms Export Controls, and – like the Bank of England – required to explain publicly their decisions every month. And I’ll call it the Robin Cook Act.