Governments of every type make mistakes, what distinguishes the good from the bad – and the free from the tyrannical – is the facility to learn from them. The legal manoeuvring in the case of Binyam Mohamed which emerged yesterday is thus deeply chilling. The torture of this British resident, who was last year released without charge by the US after years of alleged brutish caging which left him feeling "dead", is fast becoming established fact. The allegations that certain UK agents knew about this are also becoming firmer. But rather than confront these disturbing matters, the government has scrambled to conceal them at every stage – draping the "national security" blanket over American actions, British knowledge and, indeed, over the very motives for wanting to keep everything secret.

The "war on terror" is nowadays consigned to the rhetorical dustbin, but even as the Chilcot inquiry attempts to make retrospective sense of one of its messiest campaigns, the court of appeal has found itself called to active service on another of its gory fronts. While retired Foreign Office lawyers queue up to tell Chilcot that their advice on Iraq was ignored, their hardline successors have pushed their attempts to suppress the truth about torture all the way to the final judgment – and beyond.

Still in some sense his master's apprentice, the foreign secretary, David Miliband, yesterday turned in a Commons performance of such audacity that Tony Blair himself would have been proud. No matter that he had just been forced to release the previously censored views of a lower court that the UK knew that the Americans were stressing, shackling and subjugating Mr Mohamed in a manner that "would clearly have been in breach of the [anti-torture] undertakings given by the United Kingdom", Mr Miliband carried on as if he had won some form of victory – simply because the judges had given a nod to some familiar principles which govern the handling of intelligence. He claimed quite definitively that without recent American rulings the decision would have gone the other way. And in a truly Tonyesque twist he defied his accusers by proclaiming his innocence of a sin with which he was not charged, shrugging off the blame for keeping the public in the dark by pointing out that he had never attempted to restrict the information available for Mr Mohamed's defence.

After the country's top three appeal justices had circulated their views among interested parties – a custom designed to allow for the correcting of minor inaccuracies – the government's barrister launched an unusual bid to erase the most damning passage. He succeeded, too, although his victory was pyrrhic thanks to the leaking of his letter which – helpfully to the public, although not to his client – provides a singularly acute precis of exactly what he wanted struck out and why. The court was effectively about to rule, Mr Sumption revealed, that MI5 had treated basic rights with contempt and had lied to the parliamentary watchdog which provides its only oversight. In Mr Sumption's summary, a senior judge had initially found that there was such a "culture of suppression" within MI5 that it undermined any government assurances on its behalf.

This devastating verdict upon a secret intelligence agency – contained in the original paragraph 168 of the Master of the Rolls's judgment – was drastically watered down in the published judgment, though Lord Neuberger later admitted he may have been "over hasty" in submitting to Mr Sumption's critique of his original words. The court should now agree to the publication of the original paragraph so that the public can judge the three versions of it now in circulation. Parliament cannot claim to exercise effective oversight of MI5 if (as one of our most senior judges apparently believed) it has been "deliberately misled". This is a desperately serious state of affairs, whatever spin Mr Miliband puts on it.