As it’s expanded its operation to new cities, Uber has faced its fair share of pushback from regulators who questioned the ride-hailing service’s legality. Now, it appears we know how Uber managed to continue operation in cities where it wasn’t welcome on arrival.

The New York Times published a report Friday outlining a software tool, which used user data to identify and avoid law enforcement and city officials. The tool, dubbed “Greyball,” reportedly was used as part of a program called VTOS — short for “violation of terms of service,” according to documents provided to The Times by four current and former Uber employees.

A 2014 YouTube video posted by The Oregonian shows the feature in use, when Portland, Ore., code enforcement officer Erich England attempted to hail an UberX for a sting operation. Uber had recently extended its service to Portland without permission from city officials, who later deemed it illegal.

“This program denies 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,” Uber said of “Greyball” in a statement, via The Times.

When Uber enters a new market, it reportedly enlists a general manager to head the efforts and identify law enforcement officials using methods such as monitoring users who open and close the app within a certain distance of police stations. Once officials are tagged, anytime they try to call an Uber, they’re fed a fake version of the app that shows “ghost cars” driving around, and cancels the ride before it comes.

Approved for use by Uber’s legal team, “Greyball” originally was used as a way to protect drivers in places where they were targets of attacks from taxi workers. Since, the tool has been used to skirt officials in cities, such as Boston, Paris and Las Vegas, which some legal experts reportedly suggest could constitute a violation of the federal Computer Fraud and Abuse Act or obstruction of justice.

Thumbnail photo via Flickr/5chw4r7z