I am not sure what the point of such a document would be, but I cannot think of any reason it would be illegal. The reason I see no point is that as between the partners, if one partner commits sexual harassment, the other partners could sue the one partner for indemnity and contribution if the company had to pay damages to the victim, regardless of whether you all sign a document or not.
As between the victim and the company, on the other hand, such a document would have no effect. The victim would still have full rights to sue the partner and the company and the other partners, and collect from any or all of them. People cannot cancel a victim's right to sue all of them by agreeing among themselves who will be responsible.
Sexual harassment laws exist on both the state and federal level. The state laws are all very similar but not identical. Your question, however is really about indemnity agreements, which arise in many contexts, not just sexual harassment. There is no law that only applies to sexual harassment that applies to your main question.
As I said, signing the document will not change anything. If you commit harassment, you will be liable to the victim and so will your partners, no matter what you sign. You will also be liable to your partners if they wind up having to pay the victim, whether you sign a document or not. If one of your partners commits sexual harassment, you will be liable to the victim no matter what you and your partners sign, and you will be able to sue the other partner for what he or she did, even if you don't sign the paper.
The only kind of agreement that would have any force or effect in this situation would be if the business agreed to be responsible for all harassment claims, no matter who did it, and not to go after the responsible partner. But it doesn't sound like that has anything to do with the waiver you are talking about.