A former British spy who prepared a dossier about alleged links between President Donald Trump and Russia is to give evidence in a US libel case.
Lawyers for Christopher Steele had argued that the lengthy pre-trial questioning session could put potential intelligence sources at great risk.
Gavin Millar QC claimed that the planned seven-hour examination amounted to an oppressive "fishing expedition".
He asked a High Court judge in London to set aside or vary an order she made in November for the examination to go ahead.
In a ruling made public on Wednesday, Senior Master Fontaine said that Mr Steele did have relevant evidence to give in the proceedings in Florida and that the order did not breach his human rights.
But she agreed that the original request from the US court at the behest of the plaintiffs went beyond what was required and that the order should be varied to offer further protection to Mr Steele.
The US litigation involves a defamation claim brought by Russian businessman Aleksej Gubarev against BuzzFeed Inc over its publication of the dossier.
The dossier consists of a number of memoranda produced by Mr Steele, who left the Foreign and Commonwealth Office in 2009, or his company Orbis Business Intelligence Ltd.
Lawyers for Mr Gubarev, who is also suing Mr Steele for libel in the UK, told the High Court that the scope of the questioning had been narrowed and would not seek to expose sources.
Senior Master Fontaine said it was an "unusual, and probably unique, case".
Mr Steele was "in many respects in the same position as a whistle-blower" because of the actions taken by him after the 2016 presidential election in sending part of the dossier to Senator John McCain and a senior government national security official, and in briefing sections of the US media, she added.
She considered that seven hours was an appropriate time for the examination and said that Mr Steele would have the protection of his own legal advisers to ensure that the hearing should involve questioning only on the "now very limited" topics permitted.
The judge said it was not known who provided the dossier to BuzzFeed but Mr Steele's evidence was that he was "horrified and remains horrified" that it was published at all, let alone without substantial redactions.
She added: "He considers that this may have compromised the sources of his intelligence, putting their lives, their families and their livelihoods at risk.
"He says that for former Crown servants with the experience and background of the directors of Orbis, such publication of such raw intelligence reports in this way is simply unthinkable."
The judge said that she had done her best to balance the interests of Mr Steele with the requirements of the Florida court against the background of very unusual circumstances.