On Tuesday, a former employee at Tesla's Gigafactory filed a countersuit against the company. He alleges that Tesla is not living up to its mission to improve the environment and instead is generating "large quantities of waste and 'scrap' vehicle parts lying haphazardly on the ground inside the Gigafactory."

Tesla sued the former employee, named Martin Tripp, in June after he leaked internal documents to Business Insider.

Tesla also alleged that Tripp hacked into the company's manufacturing operating system, systematically transferred data off its network to third parties, and made false claims to the media regarding waste and quality issues at the company, all of which Tripp denies.

Tripp now alleges that Tesla made false statements about him around the time of the lawsuit.

Martin Tripp, a former process technician at Tesla who says he made $28 an hour, filed a countersuit against the company on Tuesday.

Tripp, 40, alleges that Tesla is not living up to its mission to improve the environment and instead is generating "large quantities of waste and 'scrap' vehicle parts lying haphazardly on the ground inside the Gigafactory," according to the counterclaim.

Tripp also alleges that Tesla consistently reused battery parts that had been discarded as waste. His filing says he "was even told by one colleague that the colleague, after seeing damaged products being reused, intentionally further damaged the parts to prevent them from being used in a Model 3."

More allegations from Tripp's counterclaim:

"In mid-May 2018, [Tesla's] Manufacturing Operating System ('MOS') showed that from January 1, 2018 to mid-May 2018, approximately $150,000,000 to $200,000,000 worth of battery module parts, including bandoliers and battery cells, had been categorized as 'Scrap.'"

Tripp also claims that punctured battery cells were reworked with glue and put back on the manufacturing line: "Based upon information and belief, no quality inspections were performed on these 'reworked' battery modules before they were returned to the manufacturing processing line. Mr. Tripp personally observed technicians perform this process on several battery modules."

Tripp claims that Tesla discontinued systems to track vehicle parts: "As a result, traceability is unknown for many vehicle-parts and/or materials which could have a drastic effect on determining where the part(s) were made, when, and by whom."

Tripp denies allegations that he hacked into Tesla's manufacturing operating system.

Tripp claims Tesla "published these false and defamatory statements out of malice and to retaliate against" him and "discredit him before the general public."

Earlier, Tripp leaked internal documents and other information to Business Insider.

A self-proclaimed former Tesla fanboy, Tripp claims that he tried bringing his concerns to his superiors and to Tesla CEO Elon Musk first but that nothing came of it.

Now Tripp is being sued by Tesla, which accuses him of hacking the company and transferring secret information to third parties.

Tesla also claimed it received a tip from a "friend" of Tripp who suggested Tripp might try to "shoot up" the Gigafactory. Law enforcement looked into it at the time and found no credible threat.

Tripp denies any violent intentions in his counterclaim and says Tesla declined to reveal the name of the "friend" who gave it the tip.

"Tesla has used strong-arm tactics and a defamatory smear campaign in an effort to bury the disconcerting information Martin Tripp learned as a Tesla employee and to discredit Mr. Tripp before the general public," Tripp's attorney, Robert D. Mitchell of Tiffany and Bosco, said in a statement to Business Insider.

"By filing its lawsuit against Mr. Tripp, Tesla has now forced the issues to the forefront, and Mr. Tripp looks forward to defending himself before a jury of his peers by showing that what he witnessed and repeatedly reported at Tesla is, in fact, true."

Tesla did not respond to requests for comment for this story.

What may happen when Tesla wants to sue you

Tripp's legal troubles with Tesla began on June 14 and 15, when the company's security team called him into meetings for questioning.

He tells Business Insider the first meeting lasted about six or seven hours. Tripp claims Tesla's team wanted to know how he allegedly ran queries into its manufacturing operating system, such as about Tesla's scrap waste and part prices, and why he'd do that.

Tripp says he told Tesla that he felt Musk was misleading investors about production numbers and that Tesla's security personnel laughed in response.

Tripp says he then took Tesla's team to an area where nonconforming battery parts were lying about. Some of those batteries were destined for rework, and he explained his fears about hurriedly reworked batteries going into "thermal runaway," a condition in which an overheating battery begins to destroy itself.

Tripp says he was eventually escorted out by security, at which point, he says, he found his car surrounded by further security in the Tesla parking lot.

Tesla security wouldn't leave until a truck came to escort Tripp out, he claims. The incident left him with the impression that he'd been let go from the company.

He was not.

The next day, Tripp says, Tesla's security team called him back for more questioning and then put him on "administrative leave."

Tripp recalls the second meeting with Tesla being shorter and less cordial than the first. Tesla's team asked similar questions and then started to ask stranger ones, Tripp claims. They wanted to know how he had allegedly managed to put a program into the MOS that ran queries into the system at the same time every day, searching for scrap costs.

According to Tripp, the security team told him it knew he had logged into nine computers and had the program running from three of them.

Tesla did not respond to request for comment on the meetings. In Tesla's complaint, Tesla alleges that in the meetings, Tripp admitted to writing software that hacked Tesla's MOS and to transferring "several gigabytes of confidential and proprietary Tesla data..." Tripp denies these accusations in his filing. He told Business Insider he didn't even know how to code.

"This ordeal, which, inter alia, implied that Mr. Tripp was a danger to those around him, was highly embarrassing and distressing to Mr. Tripp," Tripp claims in the filing.

Later, Musk wrote in a company-wide email that Tesla had a "saboteur" on its hands. Shortly after that, Tesla filed a lawsuit against Tripp.

In a now-public email exchange between Tripp and Musk, the Tesla CEO called Tripp a "horrible human being."

The company alleges that Tripp stole confidential data and exaggerated the numbers in that data to the media. Tesla also alleged that Tripp hacked into its MOS.

Tripp says his safety was jeopardized in the weeks that followed.

The counterclaim alleges that Tripp "has received numerous threats to his personal safety, which, upon information and belief, have been stirred by the foregoing false and defamatory statements published about him" by Tesla. It continues: "Mr. Tripp has even been followed and trailed on multiple occasions by unidentified individuals."

Claims and rumors

Rumors have flown around Tesla's factories about Tripp and the "saboteur."

An engineer at the Fremont, California, factory told Business Insider that the engineers thought it was crazy that any such "saboteur" could exist at all. In their opinion, this person would have to have been a professional hacker.

"The MOS configuration ... gets overwritten daily with an automatic push from a stash repository," the person said. "All changes on said stash are trackable and require approval from other members."

He added: "Pushing malicious software onto other people's computers would not be possible without their authorization unless [the person were] a professional hacker. To which then I would say, 'Why is [Tripp] working as a process technician?'"

In his counterclaim, Tripp maintains that the information he sent to Business Insider was accurate.

All of this comes at a critical time for Tesla. Analysts at Goldman Sachs say the company may have to raise money soon to maintain a comfortable cash position as it tries to scale its new Model 3 sedan amid production delays.

The company reports its second-quarter earnings on Wednesday.

If you are a Tesla employee or customer who has a story to share about a car or experience with the company, give me a shout at llopez@businessinsider.com.

Disclaimer: The author of this article is specifically named in the counterclaim, where Tripp alleges that statements Musk made on Twitter to @lopezlinette are false and defamatory.