The intelligence services have routinely been intercepting legally privileged communications between lawyers and their clients in sensitive security cases, according to internal MI5, MI6 and GCHQ documents.

The information obtained may even have been exploited unlawfully and used by the agencies in the fighting of court cases in which they themselves are involved, the Investigatory Powers Tribunal (IPT) has been told, resulting in miscarriages of justice.

Exchanges between lawyers and their clients enjoy a special protected status under the law.

The Conservative MP David Davis, a former shadow home secretary, said past practice was to delete such material immediately if it was ever picked up. Amnesty International said the government was gaining “an unfair advantage akin to playing poker in a hall of mirrors”.

Their comments come after 28 extracts of internal intelligence policies showing how legally privileged material is handled by security officials were released to lawyers pursuing a claim through the IPT. The tribunal considers complaints against MI5, MI6 and GCHQ.

The claim has been brought by two Libyans, Abdel-Hakim Belhaj and Sami Al Saadi, and their families after they were abducted in a joint MI6-CIA operation and sent back to be tortured by Colonel Muammar Gaddafi’s regime in 2004.

Belhaj has been given permission to sue the government for his mistreatment. Following revelations by the US whistleblower Edward Snowden, Belhaj’s lawyers feared their communications with their client could have been compromised by GCHQ’s mass surveillance of telephone and online communications.

Responses given by lawyers for the government at the IPT imply that there has already been one unidentified case, handled by MI5, where “the potential for tainting was identified” – suggesting that lawyers pursuing litigation may wrongfully have benefited from intercepts.

Until Thursday’s hearing, government lawyers had argued that releasing the internal intelligence agency guidance would compromise national security.

A claim that MI5, MI6 and GCHQ have been listening in to legally privileged communications between lawyers and their clients has forced the intelligence agencies to release extracts of internal policy documents. The 28 re-typed “exhibits”, attached underneath the government’s legal response, show guidelines in force at various times on how intelligence officers might use such sensitive material. The investigatory powers tribunal, which is considering the claim, hears complaints about the intelligence services and use of surveillance by other government bodies.

Dinah Rose QC, for Belhaj, said the documents also appeared to show that the agencies had hidden from the courts the fact that they held legally privileged material relating to security cases.

“There’s a real risk, if these matters are not fully explored, that confidence in our justice system could be undermined,” she told the tribunal. “These policies raise a strong prima facie case that there’s been abuse of process and that real injustices may have been done.

“Even the most recent policies do not adequately provide for proper information barriers [between] those handling litigation and those who received the intercepted legally privileged material.”

Among cases that may have been affected are highly sensitive hearings at the security immigration tribunal Siac, control order hearings and those who have brought claims following revelations by Snowden.

Rose said: “This [Belhaj] case is the tip of the iceberg. It raises questions about a large number of cases and about the integrity of judgments reached by courts in civil and criminal cases. We have a situation where the policies, on the face of it, appear to permit lawyers to be involved in practices that are unlawful and unethical.”

James Eadie QC, for the government, resisted calls from Belhaj’s lawyers for the original documents, showing the redactions, to be released. He said: “The claimants will have the content … the exact words used to the extent that they can be disclosed in open.”

The new chief of GCHQ, Robert Hannigan, sought earlier this week to justify the extent of surveillance powers by arguing that jihadis and criminals are becoming increasingly sophisticated in the way they exploit the internet.

One of the intelligence agency documents acknowledges: “Material subject to LPP is amongst the most sensitive sorts of information that may be obtained by the security service. The confidentiality of lawyer-client communications is fiercely guarded by the law and any departure from it in the national security context must be narrowly construed and strictly justified.”

The full hearing of Belhaj’s claim is due to be heard by the IPT in January.

Cori Crider, director at the legal charity Reprieve and US counsel for Belhaj, said: “It’s now clear the intelligence agencies have been eavesdropping on lawyer-client conversations for years. Today’s question is not whether, but how much, they have rigged the game in their favour in the ongoing court case over torture. The documents clearly show that MI5’s and GCHQ’s policies on snooping on lawyers have major loopholes. And MI6’s policies are so hopeless they appear to have been jotted down on the back of a beermat. This raises troubling implications for the whole British justice system. In how many cases has the government eavesdropped to give itself an unfair advantage in court?”

Davis, who attended the hearing, said: “Lawyer-client confidentiality is a foundation stone of our legal system, and historically has been absolutely respected by government agencies. In the past, when a bug or intercept on a criminal accidentally picked up a conversation with the criminal’s lawyer, the rule was that it was immediately deleted. Today’s hearing shows that is no longer the case.

“Each of the three main agencies are clearly keeping records of legal privileged material, and have explicit policies to handle it. In the case of MI5 that policy includes concealing from the court that they have the material, including the secret courts and security cleared special advocates paid by the state.

“This change has been carried out without changing the law or telling parliament. This is an enormous breach of defendants’ judicial rights. Indeed, one dreadful possible consequence is that it could lead to historic convictions being quashed in serious cases, including terrorism cases.”

Richard Stein, a partner at Leigh Day who represents the Belhaj family, said: “After many months’ resistance, the security services have now been forced to disclose the policies which they claim are in place to protect the confidential communications between lawyers and their clients. We can see why they were so reluctant to disclose them. They highlight how the security services instruct their staff to flout these important principles in a cavalier way. We hope the tribunal will tell the government in no uncertain terms that this conduct is completely unacceptable.”

Hugh Tomlinson QC, for Amnesty International, who are involved in the case, said: “The guidance [revealed in the documents] contemplates the systematic invasion by state agents of a right in English common law which is absolute.”

Rachel Logan, Amnesty UK’s legal adviser, said: “We now know that the government sees nothing wrong in routinely spying on the confidential communication between lawyers and clients. This clearly violates an age-old principle of English law : that the correspondence between a person and their lawyer is confidential. It could mean, amazingly, that the government uses information they have got from snooping on you, against you, in a case you have brought.”

Officials believe the documents set out safeguards to ensure legal privilege is respected by the intelligence agencies. The government says the Interception Code of Practice requires that an additional level of scrutiny should be applied in cases where that legally privileged communications might be intercepted.

The government said: “We do not comment on ongoing legal proceedings.”

Elizabeth Knight, legal director of the Open Rights groups, said: “We already know that Ripa [Regulation of Investigatory Powers Act] allows the security services to intercept all ‘external’ communications, breaching our right to privacy. By undermining journalistic and legal privilege, Ripa also threatens our rights to free speech and a fair trial. The government cannot keep defending these abuses. We need urgent reform of this broken law now. This disclosure demonstrates the need to introduce judicial authorisation.”