"Respondeat superior" is one of the terms that employers hate to hear -- because it generally means liability issues. Employers are quite often liable for the damages caused by their negligent employees.
Fortunately, in a hostile work environment case, there are affirmative defenses that you can raise to counter employer liability for an employee's actions.
Did you try to prevent or correct the problem?
As an employer, you're expected to take steps to prevent hostile work environments from occurring. If they occur despite your best attempts to prevent them, you have the responsibility to take corrective action.
You essentially protect your company by having a strong, clear policy in opposition to anything that could create a hostile work environment. You also need to step in and address either evidence or complaints about hostility in the workplace. Documentation is important because you need to be able to show the steps that you took to end the problems.
Did the employee make use of chances to end the problem?
Fortunately, the responsibility for action doesn't entirely rest on employers. You can do everything in your power -- but still fail to stop a hostile work environment from forming when the victimized employee doesn't make use of the measures that you have in place for redress.
For example, if you offer an employee clear instructions on how to file a complaint against his or her harassers and the employee doesn't follow through, there's only so much action you can take without any information to go on.
Did the company aid the offender in any way?
If the harasser uses his or her position to damage the employee's position, either directly or through a constructive dismissal, the company could be effectively "assisting" the offender.
You can help prevent this from happening by enforcing clear policies in regards to discipline and documentation. In addition, consider having exit interviews performed by someone other than an employee's direct supervisor to help catch (and prevent) constructive dismissals.
While there's no foolproof way to avoid employment litigation, you can reduce your odds of being involved by making a concerted effort to prevent or end hostile environments.
Source: FindLaw, "Raising an Affirmative Defense to Constructive-Discharge Claims in Hostile-Work-Environment Cases," accessed Feb. 28, 2018