Their program used a secretive tool called Greyball to collect data from Uber's app, along with other information-collecting techniques, to deliberately evade officials. Greyball worked by tagging known officials and serving up fake versions of the app populated with ghost cars, sources told The New York Times. When a code inspector working for the the city of Portland, Oregon tried to catch Uber in a sting operation, the company 'Greyballed' his phone, pretending to send cars and cancelling the fake rides.

The Greyball tool was originally used under an umbrella program called Violation of Terms of Service (VTOS) which Uber used to identify people it thought were abusing or improperly targeting its service. The company started VTOS in 2014 and continues to use it, mostly outside the US.

In a statement provided to The New York Times, Uber said, "[The VTOS] 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."

When Uber began moving into a new city, they appointed a general manager to spot enforcement officers. They used a few methods to do this: One was to draw a digital perimeter ("geofence") around authorities' offices and monitored which nearby account users kept opening and closing the app, which could indicate a city agency worker checking the app for enforcement purposes. Other methods were more mundane, like seeing whether a user's credit card information was tied to an institution like a police credit union or even just looking up folks' connections on social media.

But neither side stopped there. When enforcement officials bought dozens of cellphones to create different accounts, Uber employees went to that city's electronics stores to check device numbers of the cheapest phones -- the models most likely bought by cash-strapped city agencies. If a driver picked up a suspected officer by accident, Uber called them to give specific instructions to end the ride.

In short, Uber created a tool and processes to tag investigators checking up on them along with a playbook to extend the cat-and-mouse game and stymie investigations. And according to The New York Times' sources, even some internal members of Uber's team were uncertain whether it was ethical or even legal. While 'Greyballing' was first used in new cities to muddle the locations of UberX drivers to fight local taxi competition, Uber engineers soon saw those tactics' potential use in evading law enforcement. Soon, they made a playbook and passed it along to general managers in a dozen countries.

Update: Tonight, Recode reports that Ed Baker, Uber's VP of product & growth, is leaving the company. Just last fall he was called a "rising star" within the company, but in an email told staffers he wanted to apply his experience to the public sector. According to Recode, reporters were recently emailed complaints about Baker's behavior at an Uber event, and a copy of the message went to Ariana Huffington, who is part of an investigation into sexism and harassment within the company.