Elon Musk’s xAI has won a legal victory in its case against a former engineer who’d allegedly made off with their entire codebase.
A U.S. District Judge has issued a temporary restraining order that prohibits Xuechen Li from having any role or responsibility at OpenAI pertaining to generative AI. xAI had sued Li for allegedly taking trade secrets relating to its technologies before he left the company, and then taking up a job with OpenAI. xAI had said that the stolen trade secrets would enable OpenAI to create an AI system more powerful than ChatGPT.

Judge Rita F. Lin of the Northern District of California ordered Li to surrender all personal devices, cloud accounts, and digital repositories within three days for forensic review. The order also bars Li from performing any generative AI work at OpenAI or any competitor until investigators confirm that all stolen data has been deleted. A preliminary injunction hearing is set for October 7.
Last week, xAI sued Li for allegedly stealing its confidential technology and attempting to take it to OpenAI. The company said Li unexpectedly cashed out a large amount of his xAI stock and immediately resigned. He then allegedly copied confidential xAI information to his personal laptop and tried to cover his tracks by deleting his browser history and other logs.
Li completed his PhD in Computer Science at Stanford in 2024 and was among the first 20 employees at xAI. He had been working on developing and training Grok, xAI’s advanced AI model. In June 2025, Li sold $4.7 million worth of his xAI shares. Seeking more liquidity, he sold an additional $2 million of stock to xAI the following month.
xAI alleges that on July 25, 2025 — the same day Li received cash proceeds from the stock sale — he copied the company’s “confidential information” and “trade secrets” from his work-issued laptop to “non-xAI physical or online storage systems under his personal control.” The company claims Li took extensive measures to conceal his misconduct, including deleting browser history and system logs, renaming files, and compressing them before uploading them to his personal devices.
Three days later, Li resigned. He had already accepted an offer from OpenAI and was slated to begin work there on August 19. xAI says it discovered Li’s actions on August 11 during a routine review of logs from its security software designed to detect and prevent data exfiltration. That same day, xAI emailed Li, demanding he return and delete the data. At this point, Li reportedly hired a criminal attorney. During a meeting between xAI’s lawyers and Li’s attorneys, Li allegedly admitted to intentionally taking xAI’s files and covering his tracks. He allowed xAI to create copies of his personal laptops for examination, but the company says he has withheld passwords for critical accounts that could reveal the full scope of the theft.
Elon Musk had later said that Xuechen Li had stolen xAI’s entire codebase. xAI’s codebase would include all the code at the company that was used in building its many models, and likely many algorithmic tricks that xAI engineers would’ve come up with to set themselves apart from the competition. Musk alleges that Li intended to take all of these to OpenAI, and xAI in its lawsuit had said that this information could’ve been used to build models superior to ChatGPT. A judge seems to have agreed with his, and temporarily restrained Li from working with OpenAI in any manner.
And the way things are going, it’s likely that this won’t be the only case of its nature. AI Model companies are worth hundreds of billions of dollars, and most of their value lie in the code and weights that power their models. And protecting this code likely ought to be one of the biggest priorities — with researchers switching labs all the time, the risk of someone taking their code to a rival must be the one of their biggest existential risks.