David Cameron has called on the Guardian and other newspapers to show "social responsibility" in the reporting of the leaked NSA files to avoid high court injunctions or the use of D notices to prevent the publication of information that could damage national security.

In a statement to MPs on Monday about last week's European summit in Brussels, where he warned of the dangers of a "lah-di-dah, airy-fairy view" about the dangers of leaks, the prime minister said his preference was to talk to newspapers rather than resort to the courts. But he said it would be difficult to avoid acting if newspapers declined to heed government advice.

The prime minister issued the warning after the Tory MP Julian Smith quoted a report in Monday's edition of the Sun that said Britain's intelligence agencies believed details from the NSA files leaked by the US whistleblower Edward Snowden had hampered their work.

The Sun quoted a "top surveillance source" as saying that terrorists had "gone quiet" after the publication of details about NSA and GCHQ operations.

Cameron told MPs: "We have a free press, it's very important the press feels it is not pre-censored from what it writes and all the rest of it.

"The approach we have taken is to try to talk to the press and explain how damaging some of these things can be and that is why the Guardian did actually destroy some of the information and disks that they have. But they've now gone on and printed further material which is damaging.

"I don't want to have to use injunctions or D notices or the other tougher measures. I think it's much better to appeal to newspapers' sense of social responsibility. But if they don't demonstrate some social responsibility it would be very difficult for government to stand back and not to act."

The Guardian agreed to allow officials from GCHQ to oversee the destruction of hard drives in July, after the government threatened to use an injunction to block publication of information from the NSA files.

Alan Rusbridger, the editor-in-chief of the Guardian, said the destruction of the hard drives allowed the Guardian to continue reporting on the NSA files from its New York office.

The D-notice system is a voluntary code between government departments with responsibility for national security and the media. A notice can be issued to the media to prevent "inadvertent public disclosure of information that would compromise UK military and intelligence operations and methods".

Cameron had earlier indicated that the oversight of Britain's intelligence agencies may have to evolve in light of the revelations about the reach of new technology. He told MPs: "We have parliamentary scrutiny of our intelligence agencies through the intelligence and security committee and we have strengthened that oversight.

"Our agencies operate under the law and their work is overseen by intelligence commissioners. Of course as technology develops and as the threats we face evolve so we need to make sure that the scrutiny and the frameworks in place remain strong and effective."

Parliament's intelligence and security committee announced earlier this month that it is to scutinise the extent of mass surveillance in response to the concerns raised by the Snowden leaks.

The prime minister issued his warning to newspapers after Ed Miliband raised concerns about the reports last week that the US has monitored the mobile phone of the German chancellor Angela Merkel.

Miliband said: "I join the prime minister in his support for the work of our intelligence services. It is vital, it keeps us safe and, by its very nature, it goes unrecognised. I join the prime minister in applauding the men and women who work for our intelligence agencies.

"We can all understand the deep concerns that recent reports have caused in some European countries, especially Germany. As well as providing that support for intelligence services it is right that every country ensures proper oversight of those activities."

Julian Smith, who recently wrote to the Metropolitan police to assess whether the Guardian has broken the law in publishing details from the NSA files, asked the PM in the Commons: "Following the Sun's revelations this morning about the impact of the Snowden leaks, is it not time that any newspaper that may have crossed the line on national security comes forward and voluntarily works with the government to mitigate further risks to our citizens?"