PURLOINED documents, duplicitous employees and conflicted loyalties. The race to dominate the field of self-driving cars is in its early stages, but is already full of intrigue. On May 3rd a packed courtroom watched lawyers tussle during a hearing on a lawsuit that could affect the future of autonomous-vehicle technology.

On one side is Waymo, the self-driving car unit owned by Google’s parent company, Alphabet. It has accused Uber, a ride-hailing firm, of using stolen technology to develop its autonomous-driving capabilities. The origin of the dispute was a deal last summer when Uber spent $680m to buy Otto, a self-driving lorry firm. Anthony Levandowski, who had worked at Alphabet for ten years and played a big role in its self-driving efforts, had co-founded the startup, which was just seven months old when Uber bought it.

Before leaving Alphabet to start Otto, Waymo claims, Mr Levandowski illegally downloaded around 14,000 computer files that contained proprietary information about its lidar technology. Lidar uses lasers to scan a vehicle’s surroundings and is essential for many self-driving systems. Mr Levandowski has not directly addressed many of Waymo’s allegations. He has invoked the Fifth Amendment to avoid making statements that could be self-incriminating. The government could choose to bring criminal charges in the months ahead, and Mr Levandowski has hired his own civil and criminal defence lawyers.

Uber, for its part, has firmly rejected the allegations, and says that its lidar is different from Waymo’s. It had been working on autonomous cars well before it bought Otto, it points out. But the very fact of the lawsuit comes at a bad time for Uber, which is under fire for having a rough-and-tumble culture that values winning at all costs. The lawsuit may also have hurt Uber’s ability to recruit employees to help develop its autonomous efforts. Because of it, no one knows which technologies the firm will be able to use.

As a result, the outcome could affect the landscape for autonomous-vehicle technology. Alphabet has been working on self-driving cars since 2009 but now faces lots of competition. It has watched established carmakers and younger rivals accelerate their efforts. Uber has been scrambling to develop autonomous capabilities lest another company come up with a cheaper ride-hailing service using self-driving cars. A federal judge was expected to decide whether to grant Waymo’s request for an injunction as The Economist went to press. Such an outcome could bar Uber from using its lidar technology until the case goes to trial in October.

As well as revealing cut-throat competition over self-driving car technology, the case draws attention to how intertwined rivals often are in Silicon Valley. Alphabet is one of Uber’s largest shareholders. Its venture-capital arm, Google Ventures, made a $250m investment in Uber in 2013. Until last year David Drummond, Alphabet’s chief legal officer, sat on Uber’s board.

Firms allow star employees to develop complex loyalties, too. It has emerged in legal documents that at Alphabet, Mr Levandowski had two self-driving startups on the side. Alphabet dealt with this by quietly buying the firms for a reported total of $50m, presumably wanting to keep him and to stop rivals acquiring his startups.

Uber last month demoted Mr Levandowski so that he no longer leads the company’s autonomous initiatives. The future of ferrying things and people about will rely on self-driving technology. Uber’s acquisition of Otto seemed a far-sighted bet not long ago. But now it looks like Uber’s riskiest decision yet.