On 13 November, the British Attorney General wrote to Theresa May setting out his legal advice on the implications of the Irish backstop.

Geoffrey Cox argued that the Irish Protocol could trap the UK in the backstop permanently. The letter would play a central role in how the House of Commons perceived the Withdrawal Agreement.

It influenced Mrs May’s decision to pull the meaningful vote on the treaty on 10 December, and the subsequent trouncing of the Withdrawal Agreement on 15 January.

Now, the thrust of Theresa May’s mission to change the backstop is all about somehow reversing Geoffrey Cox’s legal advice.

"We’re going to need something legally binding that changes the Attorney General’s context and advice," says a London source. "That’s the territory."

Change the legal advice, and parliament will follow. That’s the plan, at least.

What was the original advice?

Theresa May had asked Cox to look at the impact of the Irish Protocol in conjunction with Articles 5 and 184 of the Withdrawal Agreement.

Article 5 commits the EU and UK to act in good faith, while Article 184 commits both sides to use their "best endeavours" to negotiate the future relationship as quickly as possible.

The backstop essentially requires that Northern Ireland remain aligned to the rules of the EU’s single market for goods, and for the UK as a whole to remain in a customs union with the EU, if that future relationship is still not concluded, or if the terms of that relationship do not remove the need for checks and controls on the Irish border.

The Protocol states that the objective of the backstop is "not to establish a permanent relationship" between Britain and the EU, and that its provisions "are therefore intended to apply only temporarily … unless and until" they are superseded by the new relationship.

However, the advice from Cox was that if agreement on the future relationship remained elusive, the Irish Protocol would endure "indefinitely".

"Despite statements in the protocol that it is not intended to be permanent," he wrote, "... in international law the protocol would endure indefinitely until a superseding agreement took its place".

This could be the case, he wrote, "even if the parties are still negotiating for many years later, and even if the parties believe that talks have clearly broken down and there is no prospect a future relationship agreement".

From that moment, the terminology around the backstop changed. It became a "trap", and was "hated" or "despised" or was "controversial".

That the fate of the Withdrawal Agreement and the aversion of a no-deal crisis rests on advice of one individual - albeit a man with significant legal and political influence - has caused bemusement in Dublin and Brussels.

Having been added to May's negotiation team, however, Geoffrey Cox, the member for Torridge and West Devon, is now a central protagonist in the Brexit finale.

How he converts a thicket of antagonisms towards the backstop into a sunny meadow of acquiesence is the abiding question.

At a broader level, Theresa May's strategy has been to use the Brady Amendment to coax and cajole the EU into changing the backstop.

That amendment stated that "alternative arrangements" should be found to replace the backstop. On 29 January, it was passed by 317 votes to 301. Mrs May has interpreted the vote as a clear mandate to change the backstop.

Despite the uncompromising messages from EU leaders at the December European Council and the letter by Donald Tusk and Jean-Claude Juncker that the Withdrawal Agreement would not be reopened, Mrs May has at least managed to kick start a process.

She has already had two meetings with Mr Juncker (one described as robust but constructive, the second described as constructive). Stephen Barclay, the Brexit secretary, and Mr Cox have met Michel Barnier twice, and will do so again next week. Officials from both sides have embarked on technical talks.

Central to Theresa May's strategy were three options: alternative arrangements, in the shape of the so-called Malthouse Compromise (a thoroughly debunked blend of technology, transition, and financial payments to the EU as a way of solving the border issue), a unilateral exit clause to the backstop, and an expiry date.

All three options have been resolutely rejected by Dublin and Brussels. That has meant that the meetings to date have taken on a surreal quality. Demands have been restated, and demands rejected. At least one meeting last week was described by an EU official as "a waste of time".

Some officials in Brussels and Dublin suspect this has all been about giving the impression progress is being made, with Mrs May all the time trying to reassure the hardliners of the European Research Group (ERG) that their demands for substantial changes - and not tweaks - are in hand.

One encounter that raised eyebrows was the lunch on 8 February between Mr Cox and Ireland's Attorney General Seamus Woulfe.

That the meeting took place the same day as the dinner between Leo Varadkar and Theresa May fuelled speculation in London that negotiations on the backstop were getting under way in earnest.

Government sources say the meeting made sense in the context of maintaining British-Irish relations post-Brexit. Woulfe had already met the Scottish and Welsh Attorneys General, so it would have been "weird" not to meet Britain’s senior law officer.

But in the current climate, the meeting posed some thorny challenges.

"While it had been made very clear they were counterparts in their respective government structures," says one senior Irish figure, "they’re actually not counterparts on the backstop issue. Seamus Woolfe is not the legal advisor to the EU. That was made clear. He wasn’t going to refuse to meet Geoffrey Cox. But again, it was largely a restatement of known positions. On our side it was not only a restatement of the EU position, but also that the dialogue has to be between London and Brussels, not Dublin."

Another source described an awkward tango in which Cox would gingerly bring up backstop issues, only to be rebuffed. "He was trying to have conversations with them but they had to keep saying, we can't have this conversation with you. We can't speculate on what might work or might not, because it's political."

Later that evening at Farmleigh House, May and Varadkar dined on organic salmon, fillet of beef, dauphinoise potato, green beans and parsnip puree.

May was accompanied by her chief of staff Gavin Barwell, her top negotiator Olly Robbins and principle private secretary Peter Hill. Varadkar was accompanied by the government secretary general Martin Fraser, chief advisor Brian Murphy, and second secretary general John Callinan.

The official pronouncement was that the meeting was "warm and productive." In reality, the previous two encounters had been so difficult that dinner was seen as an almost necessary change in setting in order to improve the atmosphere.

Nonetheless, on Brexit there was no real progress. May restated "known and firmly held positions" about what the House of Commons vote of 15 January meant. She was still insisting, according to one source, on the "the loose phrase of alternative arrangements, or the slightly more precise unilateral withdrawal right, or an end date [to the backstop] that she was keeping alive".

Anything agreed would have to be "legally binding".

Dublin believes May's maintaining of these elements was more to do with keeping different factions in her party on board, rather than a belief that some combination of the three was where the solution would be found.

For his part, the Taoiseach insisted that the Withdrawal Agreement could not be re-opened, and that London was better off looking at the (non-binding) Political Declaration as more fertile ground in massaging the backstop.

"She didn't disown that," says one senior figure. "She just repeated her view that she would need something legally binding. But she didn't rule it out either."

So, given that Brussels and Dublin were convinced that the restatement of the three options - alternative arrangements, a unilateral exit clause, and an expiry date - masked a more subtle or realistic set of demands, the mood ahead of Theresa May's visit to Brussels to meet Jean-Claude Juncker this week was a strange one.

The humiliating defeat inflicted on a motion put forward by Theresa May on 13 February had revived the EU's scepticism that she was in any way in control of parliament. The resignation of three Tory MPs just hours before she travelled to Brussels further undermined her authority.

"Given the point we're at in the process," said a senior Irish source, "there's nothing the EU side can do. Everyone is waiting to find out what the British think they want or need.

"Even if you knew that - and let's park for a moment whether or not it’s deliverable - what comfort or confidence can the British offer that it will hold the day in Westminster?"

However, by the time Mrs May arrived to meet Mr Juncker on Wednesday evening, there had been a shift in the British position.

Sources in London confirmed there was a "narrowing down" of the British demands, one that was being managed quietly. The Malthouse proposal was shelved, with officials surprised at how little fuss its demise provoked.

Talk of ditching the backstop, once the clarion call of both the ERG and the DUP, was long gone. Sources were now talking about "surgical" changes, with less emphasis, for the moment, on what legal form that would take, and more emphasis on how to deliver the objective of changing Geoffrey Cox’s legal advice.

"The main thing is that it delivers that objective," says one source. "It needs to be legally binding - but it can be surgical, it can be targeted. Nobody's talking about ripping up the backstop. That's gone."

At the end of the 90-minute meeting, Theresa May and Jean-Claude Juncker issued a carefully worded joint statement.

There would be a three-track process, largely designed to keep the process going, with comfort for both sides.

Officials would explore "guarantees" that would "once again" underline that the backstop was designed to be temporary. Both sides could be given "appropriate legal assurance".

As an antidote to any Irish nervousness about "guarantees" and "legal assurances", May and Juncker re-committed to "avoiding a hard border on the island of Ireland", with the prime minister acknowledging the letter sent by Tusk and Juncker on 14 January.

That was unequivocal in rejecting any notion of re-opening the treaty.

Alternative arrangements got a mention in terms of how they might "replace" the backstop. This had a ring of Brady, but it would only be looked at in the future, and not as any new part of the Withdrawal Agreement.

The third track was to look at the Political Declaration to see "whether additions or changes … can be made that are consistent with the EU and UK government positions and increase confidence in the focus and ambition of both sides in delivering the future partnership envisaged as soon as possible."

British officials were encouraged at the mention of guarantees; Irish sources were reassured at the prominence of the Tusk-Juncker red line on re-opening the text.

On Thursday, Michel Barnier briefed EU ambassadors in Brussels on the latest developments.

"The message was that the situation is still very much in flux in London," said one senior official present, "and that at this stage there is not much to add to the joint statement."

Barnier insisted that despite the agreement of a three-track process, there were no texts in the pipeline. The meetings he had held with Barclay and Cox were about sounding out the mood rather than proposing precise ideas.

So, what then are the prospects for the process and the guarantees delivering a breakthrough?

Opinion is divided. Many observers in Brussels and London believe a breakthrough by next Wednesday, the next deadline for the House of Commons to vote on the Withdrawal Agreement, is unlikely and that everything will have to unfold in March.

There is significant interest in a fresh attempt by former Labour minister Yvette Cooper, along with Conservative MP Oliver Letwin, to give the House of Commons the power to steer the process away from No Deal.

The Cooper-Letwin amendment could pass on Wednesday, thus then holding the government to a new deadline to getting the Withdrawal Agreement through, or to seeking an extension of Article 50.

This would chime with the EU's own preference. If Theresa May's efforts to secure legally binding assurances bear fruit - and it's still a big if - then member states could provisionally approve the changes quickly, giving the House of Commons a narrow window to vote the deal through ahead of the European Council on 21 March.

EU leaders will not want to be in a position where they have to take a gamble on something that once again fails in Westminster. Under the above choreography, they would simply endorse something that had already been agreed, and would approve a short extension if needed.

"We need more clarity in the run up to the European Council," says one EU diplomat.

"Anything which can add to that clarity is helpful. Do we have a deal? Do we know what the deal will look like? If so what kind of extension [to Article 50] will that require? Or if there is no deal in sight, then will there be a request for an extension? In that case, EU leaders can decide."

But what is the nature of the gap that has to be bridged?

In his November letter, Geoffrey Cox focused on the idea that the negotiations would break down, thus leaving the UK stuck in the backstop, with the EU having little incentive to speed things up.

Does London still believe this to be the case, given the repeated assurances - including in the Tusk-Juncker letter of 14 January - that the backstop would "only apply temporarily, unless and until it is superseded by a subsequent agreement that ensures that a hard border is avoided", and that the EU would use its "best endeavours" to conclude such an agreement as quickly as possible?

British sources say the DUP will be in a position to agitate that if the backstop kicks in, there will be little incentive to solve the Northern Ireland conundrum, and the perception that it is solved by the backstop will take hold. A "re-balancing" of incentives is therefore required, says London.

Does the EU agree with Geoffrey Cox’s original legal advice?

Sources reflecting EU thinking say Cox's analysis was broadly right, but that the way the Irish Protocol is structured does not make the backstop "indefinite" by definition.

The notion that the EU would not deliver on its promises of "good faith" and "best endeavours" to conclude a free trade agreement is a political, and not legal, judgment.

Furthermore, the UK-wide backstop was a British demand that the EU reluctantly agreed to, but only on the condition that it represented a basis on which to develop the future relationship. So the UK-wide customs union was a British idea.

Equally, if the UK is concerned about the free trade negotiations failing, the EU also has that potential concern. That is why, according to the EU's logic, the backstop must remain as an insurance policy.

If the EU agreed to a unilateral exit clause or a time limit, sources continue, the UK could potentially then announce they were dropping the backstop, refusing to put in place a hard border, but then proposing cherry-picked access to the single market without friction at its borders.

This, say sources, would allow the UK to use Northern Ireland as leverage to put the EU in an impossible position.

Ultimately this is a tussle over who can be trusted the most.

London is saying, we need to re-balance the incentives for both sides to quickly conclude a trade agreement that will supersede the backstop; Brussels is saying, we need to make sure that that trade agreement does not involve progressive regulatory divergence (or if it does, the UK could decide that Northern Ireland remains aligned), and we need to weatherproof this arrangement against the whims of a future parliament.

British officials have cautioned against any immediate breakthrough, and are at pains to play down any significant progress when Mrs May joins other leaders at the EU-Arab League summit in Sharm El Sheikh on Sunday.

"We’ve got the process there," says one UK source. "There's the recognition of the timetable and the urgency. But there's no doubt there's still a noticeable gap on the substance."

Other senior sources believe that this is more about timing than substance, and that a breakthrough next week is entirely possible.

"They're looking for the shortest possible run in time for Geoffrey Cox to be able to change his mind on the legal advice," says one senior EU figure. "So they may publish something on Monday, have a quick vote on Wednesday, and the ERG won't have too much time to do an analysis."

The source suggests there could be a legally binding addendum to the Withdrawal Agreement, that would spell out the temporary nature of the backstop, but one which would not change the substance of it.

That would not be a problem for Dublin, the source suggests.

Irish officials remain wary of anything added to the treaty. "It depends on the detail," says a senior Irish figure.

"If it changes the substance, the answer is no - unless the changes are of no consequence. Given the nature of what they're looking for, it's hard to see how you can get it changed in a way that meets their needs that we wouldn't then say that has substantially altered or weakened the backstop.

"For now I would say there's a big gap there. There is no easy way to close it."

Either way, the benefit of giving such pivotal gravity to the opinion of Geoffrey Cox is that he has a particular aura for a certain category of Conservative MPs.

"He seems to be an important figure for his own party," says one EU diplomat. "Not for everybody, but for the more moderate Eurosceptic part. So he can play an important role. He seems to be willing to engage and is interested in why we have certain positions, so that in itself is okay, if maybe a bit late in the day."

Another senior EU official believes that anything offered to Theresa May will be a stronger version of the Tusk-Juncker letter of 14 January. "It will be combination of building on the letter," says the source.

"Cox could then explain it in his paedagogic style, for a Tory audience, and in a way that makes the explanation a bit more coloured than it would be in the text, so that he can sway enough people in the party."

We will find out by Wednesday. And on that date there will just be 30 days left until the no-deal deadline.