I tread with some caution in discussing the case of Raymond Davis, the CIA agent facing charges of double murder in Pakistan and the threat of the death penalty. I add my plea to the voices urging the Pakistani government to ensure Davis does not hang.

But one thing I can state for certain: Davis (as we will call him for now) is not a diplomat and does not possess diplomatic immunity. There is some doubt as to who he really is, with the charges against him in Pakistan including one that he obtained documents using a false identity.

Watching Barack Obama's presidency has been a stream of bitter disappointments. His endorsement of Davis as "our diplomat" and invocation of the Vienna convention on diplomatic relations was, in its sheer dishonesty, as sad an Obama moment as any.

As a general rule, international treaties are written in very plain language and are very accessible. That is certainly true of the Vienna convention. Unfortunately I can see scant evidence that any journalists have bothered to read it.

Leaving aside staff of international organisations recognised by the host country as having diplomatic status (and there has been no claim yet that Davis was actually working for Unicef), in bilateral diplomatic relations the provision for diplomatic immunity is tightly limited to a very small number of people. That makes sense when you consider that if Davis did have diplomatic immunity, he would indeed be able to avoid detention and trial on a murder charge. The world community is not going to make that impunity readily available.

Full diplomatic immunity is enjoyed only by "diplomatic agents". Those are defined at article 1 (e) of the Vienna convention as "the head of the mission or a member of the diplomatic staff of the mission". Helpfully the diplomatic staff are further defined in the preceding article as "having diplomatic rank". Those ranks are an ascending series of concrete titles from third secretary through to ambassador or high commissioner. Davis did not have a diplomatic rank.

But there is a second category of "administrative and technical staff" of a mission. They enjoy a limited diplomatic immunity which, however, specifically excludes "acts performed outside the course of their duties". (Vienna convention article 37/2.) Frantic off-the-record briefing by the state department reflected widely in the media indicates that the US case is that Davis was a member of technical staff covered by this provision.

But in that case the US has to explain in the course of precisely which diplomatic duties Davis needed to carry a Glock handgun, a headband-mounted flashlight and a pocket telescope. The Vienna convention lists the legitimate duties of an embassy, and none of them need that kind of equipment.

It appears in any event unlikely that Davis ever was a member of the technical staff of the embassy or consulate. Under article 10 of the Vienna convention the host authorities must be formally informed – by diplomatic note – of the arrival and departures of such staff, and as embassies under article 11 are subject to agreed numerical limits, that in practice occurs when another member of staff is leaving. If this was not done Davis was not covered even in the course of his duties.

Pakistani senior ex-military sources tell me there is no note appointing Davis as embassy or consulate staff, and that appears to pass a commonsense test – if the note exists, why have the Americans not produced it?

Finally, possession of a diplomatic passport does not give you diplomatic status all over the world.

I hope this helps clarify a position that the US government, and the media it influences, have deliberately muddied. Sadly this whole episode reflects the US's continuing contempt for the basic fabric of international law. It sits with its refusal to sign up to the international criminal court so that US citizens may not be held accountable for war crimes, with its acknowledged overseas assassination programme, its one-sided extradition treaties and claims of extra-territorial jurisdiction over offences committed outside the US.

We hoped it might get better under Obama. It is not.

"We've got a very simple principle here that every country in the world that is party to the Vienna convention on diplomatic relations has upheld in the past and should uphold in the future, and that is, if our diplomats are in another country, then they are not subject to that country's local prosecution," Obama said in a press conference. "We expect Pakistan, that's a signatory and recognises Davis as a diplomat, to abide by the same convention ... I'm not going to discuss the specific exchanges that we've had [with the Pakistani government], but we've been very firm about this being a priority."