Employees are the beating heart of a company. Business owners who employ a dedicated staff know that they couldn’t operate without them -- even if computers are quickly replacing much of the workforce. And these days, it’s even harder to hold onto quality employees. Job hopping is the new norm among many millennial workers.

The median number of years a person stays with his or her current employer is 4.6 years -- a far cry from the era of decades-long loyalty to a single company. To combat this practice, it has become more popular for companies to offer huge perks, and there is even backlash if a company is reported to be too hard on its employees. Case in point: the New York Times article exposing the purported treatment of Amazon employees.

Related: Unhappy Workers Cost the U.S. Up to $550 Billion a Year (Infographic)

Types of sabotage -- and how to combat it

Over half of all Americans are not satisfied with their job.Some employees are so unsatisfied with their jobs that they become disgruntled, and that can lead to a certain type of employee sabotage. Employees that are angry with management or procedures can begin to slack in their efforts, resulting in sub-par service to customers.They can also intentionally disrupt the technology the company uses.

Other employees become saboteurs as spies for other companies; they have been head hunted by a competitor and are gathering information for that company’s benefit. This can be in violation of an employee’s contract, of course, but weeding out who has leaked what can be difficult. Regardless of the type of employee saboteur, some of the most damaging sabotage comes from employees.

1. Badmouthing the company online: According to a study from Weber Shandwick, about a third of executives know or admit to knowing of a fellow employee who badmouthed his or her company online. This type of sabotage is sometimes unintentional, as social media has made it all too easy for company employees to broadcast their opinions. However, some of it is intentional: Employees sometimes film themselves behaving badly at work, much of which takes place at fast food restaurants where the average employee age is low. These videos often feature employees tampering with food, which severely hurts a brand’s image.

With social media playing so big a part in our everyday lives, many companies use tools to monitor their reputation and examine search results, such as Google Alerts or the Fruition Online Reputation Manager. In addition, many have instituted social media policies to prevent their employees from tarnishing the brand’s reputation. Social media policies must not violate the National Labor Relations Act but can include guidelines for appropriate online behavior as a representative of the company. An employee that has violated the social media policy may be reprimanded, and a meeting should be scheduled to talk in person. The employee may need to attend a workshop on the social media policy to ensure he or she understands what is appropriate and what is not. For video footage, however, employees must often be terminated.

Related: Battling Brand Sabotage: The Angry Critic

2. Tampering with the system: In 1996, newly-fired Omega Engineering Corp. employee Timothy Lloyd set up a digital bomb that deleted all of the company’s programs and cost the company $10 million in sales and contracts.It is one of many horror stories about resentful IT employees that wreak havoc on computer systems as punishment.

According to Insider Threat: Protecting the Enterprise from Sabotage, Spying and Theft, three problems existed in the case of Lloyd: 1) He was the only person in charge of maintaining backup information for the programs; 2) Lloyd refused to train new employees; and 3) The out-processing of Lloyd was improperly handled.

Prevent this from occurring by implementing the two-person rule, in which no one person is responsible for crucial software, hardware or other systems. Also, deal with angry employees immediately and provide a thorough out-processing in which all access to systems is revoked.

3. Theft of intellectual property: A Symantec study in 2013 showed that half of employees who left or lost their jobs that year kept confidential corporate data. Furthermore, 40 percent planned to use it in their new job. It’s a disturbing figure, and one that is perhaps not entirely unavoidable, as employees learn their company’s procedures and carry it over to their next position.

Enforce non-disclosure agreements and / or non-compete clauses in employee contracts, and restrict access to sensitive data to only those employees who need it. If a new hire offers information about another company, resist the temptation. It sets a bad example and sets forth a corporate culture of hypocrisy.

The best prevention

It’s important to first hire the right people. This can involve a lengthier hiring process, but a company with employees that are happy and dedicated to their jobs is less likely to become a breeding ground for saboteurs. Disgruntled employees should be dealt with immediately. If they must be let go, proper exit interviews are a must. However, the best defense against sabotage is to first prevent it. Treat your employees well, and create a corporate culture in which every voice counts.

Related: How to Discipline and Fire Employees