Facebook has hired Stroz Friedberg, the cybersecurity firm that worked with Yahoo and Sony after they were hacked, to conduct a comprehensive audit of Cambridge Analytica, the consultancy used by President Trump during his 2016 election campaign.

“Cambridge Analytica has agreed to comply and afford the firm complete access to their servers and systems,” said Facebook in a statement. Its announcement came as Facebook’s chief executive Mark Zuckerberg faced calls in the US and Europe to explain how the consultancy gained access to data on 50 million of the social network’s users.

Last night, the UK’s Information Commissioner Elizabeth Denham said that she would be applying to the court for a warrant to inspect Cambridge Analytica’s servers.

Facebook’s shares fell more than 7% yesterday, wiping around $40bn off its market value, as investors worried that new legislation could damage the company’s lucrative advertising business. “The lid is being opened on the black box of Facebook’s data practices, and the picture is not pretty,” said Frank Pasquale, a University of Maryland law professor.

The scrutiny presents a new threat to Facebook’s reputation, which is already under attack over Russians’ use of Facebook tools to sway American voters with ‘fake news’ posts before and after the US election.

Last Friday, Facebook said it had learned in 2015 that a Cambridge University psychology professor had lied to the company and violated its policies by passing data to Cambridge Analytica from a psychology testing app he had built. Facebook said it suspended the firms and researchers involved. It also said the data had been misused, but not stolen because users gave permission.

Cambridge Analytica said it strongly denied claims of wrongdoing, in a statement on its website.

In its statement today, Facebook added: “We are moving aggressively to determine the accuracy of these claims. We remain committed to vigorously enforcing our policies to protect people’s information.

“We also want to be clear that today when developers create apps that ask for certain information from people, we conduct a robust review to identify potential policy violations and to assess whether the app has a legitimate use for the data. We actually reject a significant number of apps through this process.”

Last night, Channel 4 News broadcast the results of an undercover investigation in which senior executives at Cambridge Analytica were secretly filmed saying they could entrap politicians in compromising situations with bribes and Ukrainian sex workers.

The company’s chief executive Alexander Nix said the British firm secretly campaigns in elections across the world. This included “operating through a web of shadowy front companies, or by using sub-contractors,” said Channel 4.

In one exchange, when asked about digging up material on political opponents, Nix said they could “send some girls around to the candidate’s house”, adding that Ukrainian girls “are very beautiful, I find that works very well”.

In a statement last night, Cambridge Analytica accused Channel 4 of entrapment, with Nix commenting: “In playing along with this line of conversation, and partly to spare our ‘client’ from embarrassment, we entertained a series of ludicrous hypothetical scenarios.

“I am aware how this looks, but it is simply not the case. I must emphatically state that Cambridge Analytica does not condone or engage in entrapment, bribes or so-called ‘honeytraps’, and nor does it use untrue material for any purpose.

“I deeply regret my role in the meeting and I have already apologised to staff. I should have recognised where the prospective client was taking our conversations and ended the relationship sooner.”