US spy-boss James Clapper has once again emerged from the shadows to insist that America's global-spanning web surveillance programme is lawful and only targets foreigners.

On Friday, director of national intelligence James Clapper said the NSA's clandestine PRISM project - which taps up internet giants for private emails, chat logs and other data on their users - was misunderstood and needed to fight terrorism. The following day he said those who had leaked details of PRISM that week were "reckless".

And in an attempt to quell public anger over allegations that the government had deep access to servers operated by nine of the internet's biggest companies, Clapper ordered the release of a dossier entitled: "Facts on the collection of intelligence pursuant to section 702 of the Foreign Intelligence Surveillance Act."

Although it omitted some classified information for fear of giving enemies a "playbook" on how American spies carry out operations, it provides a detailed rebuttal of claims that intelligence agencies have a backdoor into firms such as Google, Facebook and Microsoft, a move that would allow them to spy on American citizens.

Spooks were alleged to have access to pictures, videos, instant chat messages and emails, enabling them to pry deep into the lives of ordinary people as well as terrorist suspects.

But the dossier, released by the Director of National Intelligence's office, claimed: "PRISM is not an undisclosed collection or data mining programme. It is an internal government computer system used to facilitate the government’s statutorily authorized collection of foreign intelligence information from electronic communication service providers under court supervision, as authorised by Section 702 of the Foreign Intelligence Surveillance Act."

According to the director, the US government cannot use PRISM - which is underpinned by the aforementioned US Foreign Intelligence Surveillance Act - to harvest data on American citizens (of which there are 313 million). Instead it can only be used on foreign "targets" located outside the US (of which there are 6.6 billion).

Rather than leaving their backdoors open for spies to walk in whenever they want, internet companies only give agents access to their data when "lawfully required to do so", according to the director's denials.

The spymaster also insisted that any use of PRISM or similar methods is reviewed and overseen by the "executive, legislative and judicial" branches of government. The US Congress reauthorised the use of Section 702 in December 2012, and there are regular inspections of the use of PRISM by people at the very top of the government, we're told.

In a canned statement, Clapper said: "The surveillance activities published in The Guardian and The Washington Post are lawful and conducted under authorities widely known and discussed, and fully debated and authorized by Congress. Their purpose is to obtain foreign intelligence information, including information necessary to thwart terrorist and cyber attacks against the United States and its allies.

"Our ability to discuss these activities is limited by our need to protect intelligence sources and methods. Disclosing information about the specific methods the government uses to collect communications can obviously give our enemies a 'playbook' of how to avoid detection. Nonetheless, Section 702 has proven vital to keeping the nation and our allies safe. It continues to be one of our most important tools for the protection of the nation’s security."

Meanwhile, it emerged last week that a secret US court issued an order requiring mobile network Verizon to hand over the metadata on millions of US citizens' phone calls, although no actual phone recordings were obtained. ®