A month ago, I, along with several of my colleagues from the UK in a Changing Europe programme, other academics, and politicians from both the Leave and Remain campaign, signed a letter to the Daily Telegraph calling on the government to guarantee the rights of EU citizens currently living in the UK:

We would urge the Government, opposition parties and every candidate standing to be the next Conservative Party leader – and hence Prime Minister – to make an unequivocal statement that EU migrants currently living in the UK are welcome here, and that changes would apply only to new migrants. A clear commitment to protect the status of EU migrants was made by the official Vote Leave campaign – and it must be honoured.

While this view appears to have wide public support (80 percent plus in a British Future poll) and political backing across the spectrum (the Government did not oppose a non-binding motion from the Labour Party on these lines) the official position remains that the status of EU nationals post-Brexit will depend on the withdrawal negotiations, and in particular agreement on the status of UK nationals resident in other EU countries (unless of course we remain in the EEA with free movement as now, which does not seem politically feasible at present). So this issue looks likely to be a continuing topic of debate for the foreseeable future.

The purpose of this blog is not to discuss the rights and wrongs of the government’s position. My view is that it is highly probable that, one way or another, a political agreement in principle will be reached rapidly – it is not in anyone’s interests to make this particular issue central to the negotiations. I do not think any serious UK politician – and certainly no-one in any key government role – wants to be in a position where they are threatening to deport large numbers of law-abiding EU nationals.

But that does not mean that achieving the politically (as well as economically and morally) desirable outcome will be easy. The practical issues involved are formidable. In the Spectator, Fraser Nelson writes that the Prime Minister can

end the uncertainty in a sentence and say, as every other mainstream party has been able to say, that anyone here legally will be allowed to stay legally.

This is complete nonsense. The Prime Minister can indeed, and should indeed, say that “anyone here legally will be allowed to stay legally”. But that will not end the uncertainty – far from it. Let’s unpick what that sentence means:

anyone here legally

The issues with this are obvious. The first, and easiest, is “when”? June 23 2016? The date we actually leave? Or some time in between? June 23 would avert some of the obvious problems with announcing a date and then have people coming to establish a permanent right of residence before Brexit. But making this retrospective will make the administration even more nightmarish, for the reasons described below.

But, whatever cut-off date is chose, the genuinely problematic issue is to identify who was “here legally” on that date. The Spanish school party on their way into the British Museum this afternoon are “here legally.” Equally, the Polish shopkeeper who’s lived here ten years but is back in Krakow this month to visit her parents isn’t. But, obviously, we mean the latter, but not the former.

So presumably we mean people who were “resident” here on the cut-off date, regardless of whether they were in the country. But again, what does this mean? The whole point of freedom of movement within the EU is that your right of residence is automatic. You don’t have register. The Cabinet Office guidance published to reassure EU nationals is commendably clear

EU nationals continue to have a right to reside in the UK in accordance with EU law. EU nationals do not need to register for any documentation in order to enjoy their free movement rights and responsibilities.

So there is no legal or practical obligation on EU nationals to register their residence - not before the referendum, and not now. And we don’t record UK or other EU citizens entering or leaving the country. We don’t stamp passports. We don’t have a population register. So how are we going to determine who was living here legally on the cut off date? If that date is indeed to be June 23, 2016, it’s already too late – we simply don’t have any way of knowing. Leaving that aside, however, there are two broad approaches here:

The first would be to adopt the same type of approach the Home Office normally uses in establishing continuous residence of non-EU citizens - with the pretty major disadvantage that the latter have visas and entry and exit stamps in their passports, while EU nationals won’t. But people could submit payslips, tax returns, electricity bills, and so on to show that they were here – and for more than just a tourist visit- at some point in some particular period. To describe the likely outcome of this process as a bureaucratic nightmare is an understatement. The Home Office is understaffed for its current tasks and this is getting worse. There is simply no way that it could cope with having to examine, on a case by case basis, the documentation of up to 3 million people. There would be huge delays. Tens of thousands of people would be wrongly rejected and would have to appeal, making things worse. At the same time to be remotely practicable the checks would have to be very light touch, making the system wide open to fraud.

The second, originally (I think) suggested by me, would be to use the National Insurance number system; the vast majority of EU nationals who live here for any length of time register for a NINo. Anyone who had registered before the cut-off date would be automatically entitled to indefinite leave to remain. This would be relatively light-touch. But it wouldn’t be unproblematic. First, there is – as noted above – no legal requirement to register for a NINo if you’re not working or claiming benefits. So there would have to be an alternative route as well for people who had, for whatever reason, never registered. Second and more substantively, giving indefinite leave to remain to any EU national who registered for a NINo before a particular date would encompass a group much wider than simply EU nationals resident here on that date; it would cover hundreds of thousands, perhaps millions of people who are no longer in the country, and a considerable number who were only here for a brief period and have little or no ongoing connection to the UK.

But the key point is that either way there will have to be definitions, criteria, rules, guidance and a bureaucratic process. All this will have to be set out properly in laws and regulations. And that in turn means that – by definition – some people will meet them and some won’t. There will be grey areas and hard cases. People who were here for several years but not quite at the right time; people who don’t have or never had documents. The homeless, the destitute, the mentally ill. Children born here whose parents don’t qualify. And so on. All the things that happen in the current immigration system, multiplied many times over. Given that we are talking about 3 million people, the number of such cases will be in the tens, perhaps hundreds of thousands.

Nor does the complexity end there. We’ve only dealt with half of the sentence .What does “stay legally” mean? Obviously, it must mean a right to permanent legal residence. But at the moment that comes with very significant additional rights – in particular, the right to be joined by family members, EU citizens or not. Again, it’s easy to think of borderline cases. What about the Latvian who arrived here three years ago but whose husband and children stayed home, planning to join her when he finished his studies? At the moment, those rights aren’t in question. Similarly, what about the Briton and his Polish fiancé, planning next year’s wedding? Of course it is possible to draw rules that would allow in those deserving-sounding cases – but however they are drawn, there will be almost equally deserving ones the other side of the line.

This only scratches the surface. I’ve dealt here primarily with the bureaucratic and administrative practicalities, not the legal issues, likely to be equally complex. Nor do I claim I know what the right answers here. There aren’t any ideal options – just less bad ones. But anybody who thinks that with the best will in the world this will be an easy issue to resolve is living in a fantasy world. This mess is – as some of us warned – an inevitable consequence of Brexit. Blaming it simply on the Prime Minister’s supposed stubbornness is displacement activity.

Given all this, what should we - and the government - be doing now in order to minimise the uncertainty and make the process as smooth as possible. I can think of two things that could usefully happen now:

First, the government should set up a consultative group, with representative of EU nationals living here, immigration lawyers and employers, to look in detail at the practicalities of how any system might work. This could identify some of the broad groups into which the potentially eligible might fall, and what process would work best for them.

Second, it should try to get a grip on the size and nature of the issue. It could survey a random sample of EU nationals who have registered for NINos in the last ten years (and match that with the data it already holds on their tax and benefit records). How many are still in the UK? How many have already acquired UK citizenship? How many have married a UK citizen and/or have UK-born children? How many would actually want to take up UK citizenship and/or leave to remain? At the moment we have at best a vague idea of the answer to any of these questions

None of this would in any way prejudice the government’s negotiating position. But if the government genuinely wants to reassure EU citizens resident in the UK, and to reduce if not eliminate the uncertainty currently hanging over their status, it needs to start now.