Uber has been using a tool called “Greyball” to identify authorities in markets where the ride-hailing service is curtailed or outright banned by regional rules. If the authorities try to hail a ride through Uber’s app, the company will show ghost cars, which aren’t really in the area, or show no cars in the area at all.

According to the New York Times’ Mike Isaac , who spoke to current and former Uber employees, Greyball tries to identify authorities through a number of vectors. Geofencing certain municipal offices and watching who frequently opens and closes the Uber app is an option. Or Uber can check if a credit card used to sign up for its service is linked to a police credit union.

In other cases, Uber has gone to greater lengths to identify potentially hostile enforcement officers from finding Uber rides. To prevent authorities from buying stacks of cheap phones and signing up for service through those, the New York Times writes, Uber employees “went to that city’s local electronics stores to look up device numbers of the cheapest mobile phones on sale, which were often the ones bought by city officials, whose budgets were not sizable.” If Uber was not able to determine whether a potential rider was a threat or not, the company would gather data from publicly available social media or seek out other information online.

The Times writes that Uber would use about a dozen signifiers to determine if a rider was a municipal employee or someone who could enforce restrictions on the company. The tool has been used in cities, countries, and regions where local rules blocked or impeded Uber’s service, including Portland, Boston, Las Vegas, Paris, Australia, South Korea, China, and Italy. Authorities have impounded Uber drivers’ cars and issued tickets, which costs the Oakland-based company money.

Greyball, the paper writes, is a smaller tool within a “violation of terms of service” (VTOS) program that tries to weed out people using the Uber app improperly. In a statement to the Times, Uber said Greyball was used to deny ride requests “to 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.”

The tool has indeed been used to help drivers avoid potential antagonists in cities and countries where Uber has been protested or drivers have been threatened.

Uber told the Times that the primary use of the tool today is to scramble location data on Uber cars to avoid detection by potential competitors like taxi and limousine companies.

Salle Yoo, Uber’s general counsel, apparently signed off on the use of the tool, although legal scholars speaking to the Times were unsure of its legality. Uber has a reputation for pushing boundaries; most recently, the company refused to apply for a permit to test its self-driving cars on California roads despite the state’s DMV insisting that it needed such a permit. Uber announced this week that it will apply for the testing permit after all.

Update: Ars contacted Uber for comment, and the company referred us to the same statement made to the New York Times.