Tesla (TSLA  ), already struggling to reach production quotas for its Model 3, now has a new problem to address: employee sabotage.

Between June 17 and June 18, Musk sent emails to his staff detailing the employee's "extensive and damaging sabotage." The saboteur, angry that he did not receive a coveted promotion, broke into Tesla's software system, changed the code for its manufacturing operating system under false usernames, and shared unauthorized data with third parties. Although Musk did not identify the culprit in the emails, court documents filed late Wednesday night show that Tesla is now suing Martin Tripp, a former technician at its Nevada Gigafactory, for unlawful hacking. Tesla also accused Tripp of making false and damaging statements to the media about Tesla. Tesla has not specified the amount of compensation it will seek.

Tripp for his part has claimed that he is not a saboteur, but a whistleblower drawing attention to Tesla's malfeasance. Tripp denied that he broke into Tesla's software, and denied that career disappointment motivated his actions. Tripp acknowledged providing information to the media, but said he only did so after he grew disturbed at Tesla's practices, which he alleged includes using punctured batteries in hundreds of Model 3s and lying to investors about the amount of raw-material waste it generates. Tesla has denied Tripp's allegations.

In filing the lawsuit, Tesla noted that it has "only begun to understand the full scope of Tripp's illegal activity." The company is investigating whether Tripp worked alone or conspired with others. Musk heavily implied in his email that the saboteur may have joined forces with a rival company, and urged employees to be vigilant for further signs of tampering. "As you know, there are a long list of organizations that want Tesla to die," Musk cautioned. "These include Wall Street short-sellers, who have already lost billions of dollars and stand to lose a lot more. Then there are the oil & gas companies, the wealthiest industry in the world - they don't love the idea of Tesla advancing the progress of solar power & electric cars...If they're willing to cheat so much about emissions, maybe they're willing to cheat in other ways?"

In another unusual occurrence, a factory fire occurred on Sunday night in the welding area of Tesla's electric vehicle plant in Fremont, California. The fire did not cause injuries or extensive damage, but did slow production for several hours, and caused a new Model 3 unit's sheet metal to weld together before it could be painted. While the origins of the fire are not known, Musk speculated in an email to employees that the fire might also have been an act of sabotage, quoting Intel CEO Andy Grove's words: "only the paranoid survive."

While it's not yet clear how much havoc Tripp actually wreaked, the news comes at a trying time for Tesla, which has been plagued by production problems, and recently cut 9% of its workforce as it tries to become profitable. But Musk seemed confident in a tweet on Wednesday: "...the actions of a few bad apples will not stop Tesla from reaching its goals."