Uber appears to be in hot water again.
For the past three years, the ride-hailing startup has used a secret software tool that helped Uber drivers avoid local law enforcement in cities where the company routinely battled regulators, according to a report Friday by The New York Times.
The software, codenamed Greyball, was part of an internal program meant to pinpoint people who the company suspected of violating its terms of service. While the internal program and related software helped Uber drivers evade angry and often violent threats from competitors in certain countries, Uber learned that it could also be used to help its drivers avoid the scrutiny of authorities, the Times reported.
As part of the program, Uber was able to pinpoint potential law enforcement or regulators in cities like Paris, Boston, and Las Vegas that were attempting to catch Uber drivers they suspected of operating illegally.
Get Data Sheet, Fortune’s technology newsletter.
Uber has clashed with regulators in several U.S. cities who oppose the use of the UberX service that lets non-commercially approved people drive their own vehicles and basically function like traditional taxi drivers.
From the The New York Times:
Once a user was identified as law enforcement, Uber Greyballed him or her, tagging the user with a small piece of code that read Greyball followed by a string of numbers.
When a tagged officer called a car, Uber could scramble a set of ghost cars inside a fake version of the app for that person, or show no cars available at all. If a driver accidentally picked up an officer, Uber occasionally called the driver with instructions to end the ride.
An Uber spokesperson provided the following statement to Fortune: This program denies ride requests to fraudulent users who are violating our terms of service—whether that’s people aiming to physically harm drivers, competitors looking to disrupt our operations, or opponents who collude with officials on secret ‘stings’ meant to entrap drivers.”
For more about Uber, watch:
The Times reported that the program and software is controversial because it sits on the boundaries of what is legal. Peter Henning, a law professor at Wayne State University and The New York Times writer, said in the report that the Greyball tool “could be considered a violation of the federal Computer Fraud and Abuse Act, or possibly intentional obstruction of justice, depending on local laws and jurisdictions.”
The Upstate Transportation Association, a nonprofit representing the taxi industry and other transportation services in upstate New York, said in a statement on Friday, “There is reason to believe that Uber has used its anti-law enforcement technology in the Hudson Valley, where many illegal trips have already been reported.”
The latest news is another development in what has been a turbulent time for Uber in the past few weeks.
The San Francisco-based company recently came under fire for its rough-and-tumble work environment, allegations that its executives overlooked several instances of sexual harassment and workplace abuse, and a controversial video that showed Uber CEO Travis Kalanick arguing with a driver over pay rates, among other topics.