Theresa May and Jeremy Corbyn are looking at the idea of forcing a future prime minister to secure the consent of Scotland, Wales, and Northern Ireland before they can alter the UK’s future relationship with the EU.

BuzzFeed News has learned that one option under consideration ahead of Thursday’s talks between the government and the Labour Party is to require any repeal of a permanent customs union to be agreed by the devolved assemblies in Scotland, Wales, and Northern Ireland, according to two Whitehall sources.

Downing Street would not comment on the idea other than to say it wasn’t discussed at the meeting yesterday. But a senior government source confirmed what they called a “devo lock” was being examined.

Parliament cannot bind its successors, but a lock would place a significant hurdle on a Brexit-supporting future prime minister to rip up a customs union deal agreed by the current House of Commons.

There is concern, especially on the Labour side, that anything they agree with May could easily be torn up by a hard Brexiteer prime minister such as Boris Johnson — and because of this they are keen to find mechanisms to safeguard any agreement the two leaders reach.