Tesla is going after an employee for alleged sabotage and industrial espionage. But the dismissed technician says he’s a whistleblower trying to bring the company’s misconduct to light.

Martin Tripp worked as a process at Tesla’s Gigafactory in Nevada from October of last year until he was fired on Wednesday. According to the company’s allegations, Tripp stole records of its intellectual property and installed damaging software on its computers that would continue to wreak havoc long after he was kicked out.

Declaring that “a few bad apples will not stop Tesla from reaching its goals,” CEO Elon Musk directed his legal department to file a civil complaint against Tripp in federal court. According to the suit filed by electric vehicle manufacturer, Tripp “admitted to writing software that hacked Tesla’s manufacturing operating system (‘MOS’) and to transferring several gigabytes of Tesla data to outside entities” and “ wrote computer code to periodically export Tesla’s data off its network and into the hands of third parties.”

Ars Technica reports that Tripp admitted to his actions when confronted by internal investigators. But Tripp paints a different picture. “I am being singled out for being a whistleblower,” he told CNN. “I didn’t hack into system. The data I was collecting was so severe, I had to go to the media.” The dismissed employee alleges that Tesla installed damaged batteries in new Model 3 cars delivered to customers, has misrepresented the number of vehicles it’s made, and has been improperly storing potentially hazardous scrap material.

According to Tripp, as a process technician, he didn’t have access to the systems that Tesla says he corrupted. But Tesla portrays Tripp as a disgruntled former employee with poor job performance who expressed anger at being reassigned instead of getting the promotion he was after. For his part, Tripp denies the allegations. But with the matter now being brought to court, the truth of the matter may yet come to light.