The Home Secretary has won a top judge's permission to use secret court hearings to defend a damages claim brought by IRA mole Martin McGartland.
Mr McGartland, together with his partner and carer Joanne Asher, are suing MI5 for breach of contract and negligence in his aftercare following a shooting by the IRA which left him unable to work.
A former agent of the Royal Ulster Constabulary Special Branch, Mr McGartland claims the security services failed to provide care for post-traumatic stress disorder and access to disability benefits.
Mr Justice Mitting, sitting in London, said today the case included a claim by Mr McGartland and his partner that "their protection was mishandled".
The judge said "sensitive material" relating to protection and the training of security service "handlers" arose in the case.
He declared that Home Secretary Theresa May could use "closed material proceedings" (CMPs) in the interests of national security.
The judge said the declaration under Section 6 of the Justice and Security Act 2013 was "in the interests of the fair and effective administration of justice".
Mr McGartland blames "years of neglect" by MI5 for leaving him traumatised and unable to work because of his secret life.
The west Belfast man's best-selling book about his experiences, 50 Dead Men Walking, has been made into a film.
The ruling means Mr McGartland, 42, and his lawyers will not be able to hear parts of the case or to see "sensitive material".
Special advocates will be appointed to protect his interests.
Powers to hold secret hearings were introduced in July 2013 so that trials using CMPs can take place in civil courts without damaging national security.
Mr McGartland's lawyers have described such procedures as "a serious aberration from the tradition of open justice".
They contend Mr McGartland's claim for damages for personal injury does not pose a risk to national security and will not expose any aspect of his undercover work as an informant against the IRA.
At a two-day hearing last month, Government lawyers told the court that an assurance of "secrecy forever" lies at the heart of the relationship between the British Security Service and its agents.
Mr McGartland is suing against the background of the IRA uncovering, in 1991, the fact that he was an informant and he escaped from a kidnap by throwing himself through a third-floor window.
He had a second escape in 1999 when an IRA hit team tracked him down to his "safe" home in Whitley Bay, North Tyneside, where he was ambushed and shot seven times, leaving him with debilitating post-traumatic stress disorder.
During a confrontation with an IRA gunman, Mr McGartland put his hands over the gun barrel and sustained injuries to prevent his attacker firing into his upper body or head
A key problem confronting Mr McGartland's compensation claim is the Home Secretary's decision "neither to confirm nor deny" (NCND) that he is a former agent - despite the high-profile publicity about his alleged activities and narrow escapes from death.
His lawyers have complained that, because of NCND, there has been no response to Mr McGartland's specific allegations that the Security Service withdrew funding for medical treatment, was negligent in the changing of "handlers" and broke promises with regard to financial payments, the installation of a phone line and access to state benefits.
His legal team has argued that the NCND policy is absurd and unlawful as public statements naming Mr McGartland as an agent have already been made by official bodies including Crown authorities, the police, MPs and the Bloody Sunday Inquiry.
James Eadie QC, for the Home Secretary, said in a written statement before the court: "An assurance of 'secrecy forever' lies at the heart of the relationship between the Security Service and its agents.
"The strict maintenance of the NCND principle is one of the most important means by which the Security Service makes good that assurance."
Today Mr Justice Mitting said in his ruling that, despite the legal effort devoted to the NCND question, "the most difficult issue to be resolved will be how to deal with the detail of the claimant's case against his claimed handlers".
In an ordinary damages claim, disputes are resolved by a direct confrontation between the claimant and witnesses, said the judge.
"If that is not possible, a decision will have to be made as to whether or not such an issue can be justly determined at all. And if so, how.
"These difficult issues are best dealt with under the umbrella of Section 6... when both sides' case has been fully deployed."
Mr McGartland's solicitor, Nogah Ofer, said relying on secret evidence in a civil claim for damages "represents a slippery slope towards ever-increasing secrecy undermining fair and equal access to the courts".
She said: "Hiding behind 'neither confirm nor deny' is absurd when there has been official public confirmation for over a decade of Mr McGartland's role, including acknowledgement that he has given valuable service to the country."
A Home Office spokesman said later there would be no comment on today's ruling because of a policy "not to comment on ongoing legal cases".