A federal judge excoriated Uber and the private investigation firm it hired, for probing the personal and professional lives of a man and his lawyer under false pretenses, likely violating several laws in the process, all because the people had the chutzpah to start a class-action lawsuit against the tech giant.

"It is a sad day when, in response to the filing of a commercial lawsuit, a corporate defendant feels compelled to hire unlicensed private investigators to conduct secret personal background investigations of both the plaintiff and his counsel," Judge Jed Rakoff wrote in a decision Monday. "It is sadder yet when these investigators flagrantly lie to friends and acquaintances of the plaintiff and his counsel in an (ultimately unsuccessful) attempt to obtain derogatory information about them."

Spencer Meyer, an environmental researcher at Yale University, sued the ride-share company's CEO Travis Kalanick in December, claiming that the combination of Uber's pricing system, particularly its surge pricing, and the company denying its drivers worker rights by claiming that they're independent contractors means that Kalanick is engaged in illegal price-fixing.

The same day that Meyer filed suit, Uber general counsel Salle Yoo emailed the company's chief security officer asking, "Could we find out a little more about this plaintiff?"

After some back and forth with a firm called Ergo, specifically with bosses Todd Egeland and Matthew Moneyhon, former government spooks for the CIA and State Department respectively, Uber seems to have hired Ergo for $19,500 to conduct a "Level 2" assessment of Meyer, newly disclosed records show. Ergo's website states, "Compliance and confidentiality are cornerstones of our business."

In an initial email, Uber security head Mat Henley asks that all communication about the project be done over encrypted email and messaging services "to avoid potential discovery issues." Over the next month, an investigator for Ergo contacted 28 people, including Meyer's friends, former colleagues, and a former landlord, and a friend of one of Meyer's lawyer's, Andrew Schmidt of Maine.

In the process, the investigator, Miguel Santos-Neves, generally told targets that he worked for Ergo, but lied about what he was up to. Rather than saying he was an investigator trying to dig up dirt on a plaintiff against a multinational corporation for leverage in a lawsuit, he developed such ruses as telling environmental scientists that he was "attempting to verify the professional record and/or previous employment of various up-and-coming researchers" for a "research project," or in Schmidt's case, vetting "top up-and-coming labor lawyers."

In January, another lawyer on the case became aware that Santos-Neves was reaching out to Schmidt's and Meyer's acquaintances, and objected to Uber's attorneys. This began months of outright denials from Uber that anyone at the company had hired the investigative firm. Uber only owned up to the deception when it became clear that its foes wouldn't rest until they sought a judge's order getting to the bottom of the weird calls and emails, and even then the company's lawyers downplayed the number of people contacted as part of the investigation, and the extent of the involvement of Uber's top executives.

Uber hired Ergo, its lawyers said, because they were concerned Meyer might be a threat to Kalanick's safety.

In the meantime, by the end of January, Ergo had drawn up its report. In the final stages of drafting it, Ergo boss Todd Egeland asked Santos-Neves in an email, "do we have enough negative things said about Meyer to write a text box?"

Santos-Neves had to disappoint on this front, writing, "i don't believe so. No one really said anything negative about him. We can extrapolate and say that he is a bit of an 'idiot savant' or naive outside the ivory tower of academia."

Uber CEO Travis Kalanick, left, and environmental researcher Spencer Meyer, who is suing the company and Kalanick. (Getty and University of Maine)

In the final report, which left open a door for further business for Ergo by suggesting the firm investigate Schmidt and Meyer's relationship, the authors wrote that "sources speak of Meyer's personality in glowing terms: they find him to be professional, thoughtful, and trustworthy." They wrote further that while Meyer actually dislikes Uber's business model, he may be under the sway of a glory-seeking social justice lawyer:

According to one friend and peer, Meyer believes he has a legitimate complaint against Uber's surge pricing, a grievance that he felt was worth pursuing. However, given Meyer's forthright, career-focused personality, we speculate that his lawyer Andrew Schmidt—a fellow Dartmouth classmate and friend—may have encouraged and induced Meyer to pursue his personal grievance on a grander scale. Schmidt is a labor lawyer with a record of fighting for social justice and leveraging class-action suits.

The report also identified a possible angle of attack, saying, "Meyer be particularly sensitive to any publicity that tarnishes his professional reputation."

Testifying at a deposition, Santos-Neves described the use of lies, or what he called "covers," to deceive targets as routine at Ergo "in certain instances," and he said his bosses never reprimanded him for any of his actions.

In his decision, Rakoff called Ergo's investigation "blatantly fraudulent and arguably criminal," citing Santos-Neves's deceptions, Ergo's lack of a New York private investigator's license, and Santos-Neves's recording of calls with subjects in New Hampshire and Connecticut, where recording others without their consent is illegal. Rakoff also skewered Uber's lawyers for failing to supervise Ergo, in violation of ethics rules governing lawyers.

Rakoff barred Uber from pursuing further investigations, or from using any information gleaned in its probe of Meyer, and held off on awarding Meyer's lawyers sanctions because Uber had agreed to pay an unspecified amount to cover all the litigation over the probe.

"Litigation is a truth-seeking exercise in which counsel, although acting as zealous advocates for their clients, are required to play by the rules," Rakoff wrote.

A spokesman for Uber declined to comment on the decision. Ergo did not respond to a call and email seeking comment. In an emailed statement, Andrew Schmidt wrote, "Even though the deceptive investigation only highlighted Mr. Meyer’s sterling personal and professional reputation, we are pleased with the court’s opinion."

The tactic of Ergo's private eyes sniffing around Uber's opposition could well extend beyond Meyer's case, and their relationship seems not to have been soured by the revelations about Ergo's tactics. At the time of the June inquiry, Santos-Neves said that Ergo had done four jobs for Uber, and Uber hired the firm again that month, according to a legal filing.

In 2014, Uber senior vice president Emil Michael told a Buzzfeed editor that it would be appropriate to spend a million dollars to investigate the personal lives of journalists who are critical of Uber, and another Uber official accessed the user data of a reporter for the site without her permission to make a point.

When Buzzfeed editor Ben Smith told Michael that such behavior could become a problem for Uber, Michael scoffed, saying, "Nobody would know it was us."