We may be about to see the biggest Anglo-Irish row since the early 1980s. In the next few weeks don’t be surprised if Tory MPs and “sources close to the government” turn up the heat on the taoiseach, Leo Varadkar, branding him bloody-minded and reckless over insisting on a legal “backstop” to prevent a post-Brexit hard border in Ireland.

For Theresa May the backstop is a slowly closing trap, crushing her hopes of a Brexit deal between hard Brexiter opposition to staying in a customs union and DUP resistance to a special deal for Northern Ireland. Her survival strategy will involve pressuring Varadkar to drop the idea of a comprehensive, “all-weather” border backstop as the price of a Brexit deal, briefing sympathetic journalists, and ramping up the diplomatic pressure. What many UK politicians don’t understand is that Varadkar, like May, is politically boxed in. He has everything to lose by accepting less than Britain’s December commitments to no hard border, which he described as “bulletproof”.

Those who think that May will escape the trap by facing down the DUP need to look at her strategy. She has gone out of her way – most recently in Belfast – to condemn the EU’s backstop solution for Northern Ireland as an attack on the constitutional integrity of the UK. She is using this “threat to the union” argument to drag her party towards an “unpalatable, but at worst temporary” form of customs union.

In any case, facing down the DUP may soon be illegal. In July, the government bowed to backbench pressure to accept amendments to the trade bill designed to limit customs cooperation with the EU. Amid the parliamentary drama, little attention was given to the fourth of these, an amendment that needs little gloss: “It shall be unlawful for Her Majesty’s government to enter into arrangements under which Northern Ireland forms part of a separate customs territory to Great Britain.”

We are reaching the limits of compromise. This is all the more frustrating in Dublin because London no longer seriously disputes the “how” or “what” of a border solution; the UK white paper recognises that the answer will be a version of the EU’s protocol that keeps Northern Ireland in the customs union and much of the single market rules. But May now has to ask Varadkar to take the political risk on where and when a backstop applies. If the trade bill becomes law, she can only offer a Northern Ireland regulatory backstop, covering the rules that account for around 70% of cross-border checks. The remaining 30% of essential checks could only be removed, legally, through a customs deal for the UK as a whole.

Is Britain ready to sign up to permanent membership of a customs union (by whatever name), as defined by the EU? That’s not what May says, for now at least. Varadkar is unlikely to announce to the Dáil that he has accepted a watered-down guarantee on the border because he trusts that the UK will, despite its government’s stated policy and deep Tory opposition, stay in an EU customs union – for ever.

Could there be a compromise? There is increasing diplomatic chatter about a backstop to the backstop, where the whole UK stays in a customs union “unless and until” a final, soft-enough deal is done. Chris Giles of the Financial Times suggests an ingenious “sharing the pain” deal, where only Northern Ireland gets fully frictionless trade with the EU, to encourage the UK to come to a swift decision on a de facto customs union during the transition. Either requires May to compromise.

For Irish politicians and voters, the alternative means taking a risk with instability not just in Northern Ireland, but in the Republic too. The Irish state’s increasingly confident sense of liberal, European identity depends in part on an enduring settlement in Northern Ireland. Varadkar is the first Irish leader to talk unselfconsciously about “Ireland” in contrast to “Northern Ireland”. The Good Friday agreement made that possible, allowing the Republic to lay some powerful ghosts to rest and move on, without betraying those in the North who will always see themselves as Irish. It was a political settlement for all-Ireland, approved by referendums north and south of the border. No one in the Republic wants to drag the country that Ireland has become back into a bitter, unwinnable debate about identity and borders, consuming political energy and dividing opinion for years ahead. That looks too much like Brexit.

• Paul McGrade provides senior counsel at Lexington Communications. Previously, he worked at the Foreign Office, the European Commission in Brussels and the Cabinet Office as an advisor on EU treaty negotiations