Massachusetts Attorney General Maura Healey, a Democrat, is among those who launched investigations last year into Facebook after revelations that the political consulting firm Cambridge Analytica improperly gained access to data from as many as 87 million users.
She turned to the courts in August to enforce the civil equivalent of a subpoena against Facebook after it refused to disclose the identities of 10,000 apps deemed suspicious in an internal investigation it launched in the scandal's wake.
Assistant Attorney General Sara Cable told Judge Brian Davis the records were needed to determine the extent that Facebook turned a "blind eye" to the misuse of users' data by app developers despite policies aimed at protecting their information.
"The information we are seeking is, 'Who are you policing?'" Cable said.
She said the question was pertinent given that Cambridge Analytica, which Republican President Donald Trump's campaign hired during the 2016 election, acquired the data from an app developer in violation of Facebook's policies.
According to court papers, Facebook's internal investigation led it to suspend 69,000 apps, mostly because their developers did not cooperate with the investigation. About 10,000 were identified as having potentially misused user info.
Felicia Ellsworth, a lawyer for Facebook, argued that many of the records were covered by attorney-client privilege, as the investigation was led by a law firm in anticipation of the onslaught of regulatory probes and litigation that followed.
"They did it to have a full and frank airing of legal risk," she said.
The argument prompted sharp questioning by Judge Brian Davis, who appeared sceptical of the possibility that Facebook would not have otherwise investigated app developers' practices in the wake of the scandal but for the threat of litigation.
"Everyone I think agrees Cambridge Analytica was an unhappy event," he said.
In July, Facebook agreed to pay a record $5 billion to resolve a Federal Trade Commission probe into its privacy practices.