claim last week that stories about GCHQ's mass surveillance programmes had been "a gift to terrorists", and that there was no need for more rigorous oversight.

The MI5's chief's views were shared by Sir Malcolm Rifkind, the chair of the intelligence services committee, which is supposed to provide parliamentary scutiny of the agencies.

Macdonald said Rifkind, who was in charge of GCHQ when he was foreign secretary, was "badly compromised" and appeared too close to the organisations he was supposed to be holding to acccount.

The laywer added that the disclosures from the whistleblower Edward Snowden had revealed "the sickly character" of the UK's current scrutiny regime, which needed an overhaul.

In his sharpest remarks, Macdonald said: "Worst of all has been the argument, heavily deployed in recent days, including by Sirthe daylight with protestations of apparent fealty towards the security services is a very poor substitute for grown-up scrutiny.

"Co-option is not a uniquely British problem, but it surely is underlined when, amazingly, the ISC is chaired by Sir Malcolm Rifkind – who was once himself responsible for MI6 as foreign secretary."

Macdonald made clear he has no truck with those who believe the state could do without intelligence agencies, and he said transparency had to have its limits. He described the "Julian Assange philosophy" of full disclosure of state secrets and documents as "a childish stamp of the feet".

But he added that the trust the public had in the agencies was in danger of being eroded unless the weaknesses in the laws and in the scrutiny regimes were addressed,