Legal advice given to MPs warns that British spy agency is 'using gaps in regulation to commit serious crime with impunity'

GCHQ's mass surveillance spying programmes are probably illegal and have been signed off by ministers in breach of human rights and surveillance laws, according to a hard-hitting legal opinion that has been provided to MPs.

The advice warns that Britain's principal surveillance law is too vague and is almost certainly being interpreted to allow the agency to conduct surveillance that flouts privacy safeguards set out in the European convention on human rights (ECHR).

The inadequacies, it says, have created a situation where GCHQ staff are potentially able to rely "on the gaps in the current statutory framework to commit serious crime with impunity".

At its most extreme, the advice raises issues about the possible vulnerability of staff at GCHQ if it could be proved that intelligence used for US drone strikes against "non-combatants" had been passed on or supplied by the British before being used in a missile attack.

"An individual involved in passing that information is likely to be an accessory to murder. It is well arguable, on a variety of different bases, that the government is obliged to take reasonable steps to investigate that possibility," the advice says.

The opinion suggests the UK should consider publishing a memorandum of understanding with any country with which it intends to share intelligence.

This would clarify what the intelligence can be used for under British law, and how the data will be stored and destroyed.

The legal advice has been sent to the 46 members of the all-party parliamentary group on drones, which is chaired by the Labour MP, Tom Watson.

Following disclosures over mass surveillance provided by the whistleblower Edward Snowden, the committee began looking at how intelligence is transferred from UK agencies to those in the US, such as the National Security Agency and CIA.

In a 32-page opinion, the leading public law barrister Jemima Stratford QC raises a series of concerns about the legality and proportionality of GCHQ's work, and the lack of safeguards for protecting privacy.

It makes clear the Regulation of Investigatory Powers Act 2000 (Ripa), the British law used to sanction much of GCHQ's activity, has been left behind by advances in technology. The advice warns:

• Ripa does not allow mass interception of contents of communications between two people in the UK, even if messages are routed via a transatlantic cable.

• The interception of bulk metadata – such as phone numbers and email addresses – is a "disproportionate interference" with article 8 of the ECHR.

• The current framework for the retention, use and destruction of metadata is inadequate and likely to be unlawful.

• If the government knows it is transferring data that may be used for drone strikes against non-combatants in countries such as Yemen and Pakistan, that is probably unlawful.

• The power given to ministers to sanction GCHQ's interception of messages abroad "is very probably unlawful".

The advice says Ripa "provides too wide a discretion" to the foreign secretary, William Hague, and "provides almost no meaningful restraint on the exercise of executive discretion in respect of external communications".

Such surveillance may also be a breach of the ECHR, it adds.

"We consider the mass interception of external contents and communications data is unlawful. The indiscriminate interception of data, solely by reference to the request of the executive, is a disproportionate interference with the private life of the individuals concerned."

Last June, Snowden leaked thousands of files about the surveillance activities of GCHQ and its US counterpart the NSA.

One of the key revelations focussed on Operation Tempora, a GCHQ programme that harvests vast amounts of information by tapping into the undersea cables that carry internet and phone traffic passing in and out of the UK. GCHQ and Hague, have repeatedly insisted the agency acts in accordance with the law.

Last year, Hague told MPs: "It has been suggested GCHQ uses our partnership with the US to get around UK law, obtaining information that they cannot legally obtain in the UK. I wish to be absolutely clear that this accusation is baseless."

However, the legal advice poses awkward new questions about the framework GCHQ operates within, the role of ministers and the legality of transferring bulk data to other spy agencies.

The advice makes clear Ripa does not allow GCHQ to conduct mass surveillance on communications between people in the UK, even if the data has briefly left British shores because the call or email has travelled to an internet server overseas.

GCHQ can seek a warrant allowing it to spy on a named person or premises in the UK – but Ripa was not intended to permit untargeted fishing expeditions in the UK.

The advice also takes issue with Ripa's distinction between metadata and content of messages; when Ripa was passed this was analogous to the difference between the address on an envelope and the letter within it.

Under Ripa, GCHQ is allowed to gather and store metadata with few restrictions, but requires more exacting ministerial approval to read the content of messages.

However, the advice notes that "the significance of that boundary has been eroded by the realities of modern internet usage" because metadata can allow you to build up a much more complete picture of an individual's private life.

"The distinction between contents and communications data has become increasingly artificial. Many of the most 'important' aspects of an individual's online 'private life' can be accessed via their communications data or 'metadata'."

The advice concludes: "In short, the rules concerning communications data are too uncertain and do not provide sufficient clarity to be in accordance with the law … we consider the mass interception of communications via a transatlantic cable to be unlawful, and that these conclusions would apply even if some or all of the interception is taking place outside UK territorial waters."

Leaving decisions about whether data can be shared with agencies abroad to the "unfettered discretion" of ministers is also a probable breach of the convention, the advice warns.

"First, the transfer of private data is a significant interference with an individual's article 8 rights. That interference will only be lawful when proportionate.

"Secondly, the ECHR has held on more than one occasion that surveillance, and the use of surveillance data, is an area in which governments must conduct themselves in a transparent and 'predictable' manner. The current framework is uncertain: it relies on the discretion of one individual.

"Thirdly, on a pragmatic level,there is a real possibility that the NSA might function as GCHQ's unofficial 'backup' service. If GCHQ is not entitled to hold onto data itself, it might transfer it to the NSA. In time, and if relevant, that data might be transferred back to GCHQ. Without strong guidelines and scrutiny, the two services might support each other to (in effect) circumvent the requirements of their domestic legislation."

The opinion adds: "If GCHQ transfers communications data to other governments it does so without any statutory restrictions. Such transfers are a disproportionate interference with the article 8 rights of the individuals concerned. There are no restrictions, checks or restraints on the transfer of that data."

The opinion notes that the UK has not adopted the doctrine of "anticipatory self-defence" in the same way as the US to provide legal cover for drone strikes in countries where it is not involved in an international armed conflict.

"Accordingly, in our view, if GCHQ transferred data to the NSA in the knowledge that it would or might be used for targeting drone strikes, that transfer is probably unlawful," the advice states.

"The transferor would be an accessory to murder for the purposes of domestic law … We consider that, pursuant to the transfer, the agent is likely to become an accessory to murder."

Watson said he would be submitting the legal opinion to the parliamentary intelligence and security committee, which is undertaking an inquiry into mass surveillance.

"MPs now have strong independent advice questioning the legality of major UK intelligence programmes," he said.

"If ministers are prepared to allow GCHQ staff to be potential accessories to murder, they must be very clear that they are responsible for allowing it. We have seen a step change in mass covert surveillance and intelligence gathering, underpinned on dubious legal grounds and with virtually no parliamentary oversight.

"The leadership of all the main parties should stop turning a blind eye to a programme that has far-reaching consequences around the globe."