Every week seems to bring headlines of another rich and powerful man brought low by revelations of long-hidden sexual misconduct. The societal reactions of the #MeToo and #TimesUp movements have been big news, at the forefront of a current events tsunami.

And what was the dam that’s been holding back this flood? Often, it’s lawyer-drafted confidentiality agreements. Time and again, the stories spill out despite the commonly used legal tool of a financial payoff with a promise of maximum secrecy. Movie mogul Harvey Weinstein, who maintains his innocence, has made frequent use of these.

Typically, and most dramatically in the case of adult-movie actress Stormy Daniels and President Donald Trump, the financially compensated party promises to keep quiet forever about a suit or a scandal, unless actually forced by court order to provide testimony.

Most people, and most lawyers in particular, have not pondered whether confidentiality agreements might be inherently unethical.

But more than a decade ago, professor Jon Bauer of the University of Connecticut School of Law made an intensive study of this. He concluded that secrecy agreements that impede disclosure of relevant evidence violate the legal code of ethics.

In “Buying Witness Silence: Evidence-Suppressing Settlements and Lawyers’ Ethics,” Bauer cited the early drafters of the ethics code. They viewed the litigation process as a truth-finding exercise requiring unfettered access to potential evidence.

A 1935 ABA ethics opinion, No. 131, held: “It is improper for an attorney … to influence persons, other than his clients or their employees, to refuse to give information to opposing counsel which may be useful or essential to opposing counsel in establishing the true facts and circumstances affecting the dispute. … All persons who know anything about the facts in controversy are, in simple truth, the law’s witnesses.”

That rule is alive and well in the ABA model rules, and Connecticut’s Professional Responsibility Rule 3.4, which at subsection (6) states that a lawyer shall not request a person other than a client to refrain from voluntarily giving relevant information to another party.

The only exception is if the person is a client or client’s employee whose interests would not be affected by the gag.

As Bauer noted in his article, published in the Oregon Law Review in 2008, lawyers are also officers of the court and are not permitted under Rule 8.4 to engage in conduct that is “prejudicial to the administration of justice.”

To the extent lawyers’ secret settlements keep relevant evidence hidden, Bauer wrote, they undermine “the integrity of adversarial adjudication.”

Under the rules of evidence, “prior bad acts” are generally excluded, but there are a host of exceptions that allow evidence of patterns of behavior when relevant. These include serial sexual abuse.

State ethics boards are starting to agree with Bauer. There have been opinions in the past several years by the Chicago bar ethics committee and the Indiana state ethics committee endorsing Bauer’s argument that lawyers should think long and hard before making nondisclosure agreements.

Another sign of the changing attitudes is buried in the new federal tax bill, which now prohibits businesses from writing off—as a cost of doing business—the money paid as settlements in sexual misconduct cases with confidentiality provisions.

“It’s an interesting incentive,” said Bauer in an interview. “But when push comes to shove, the prospect of not being able to take it as a tax deduction won’t prevent people and companies from entering into secrecy agreements, if they think it’s in their interest.”

Bauer became interested in the ethical issue of secrecy provisions after a client of his legal clinic brought the issue into real-life focus.

Machine operator Felicia Martinez (a pseudonym) was abruptly fired for speaking Spanish in her English-only workplace and brought a federal discrimination claim. Her case concluded with a pretrial settlement and confidentiality provision.

If Martinez spoke of her case to others, she’d be liable to repay half the settlement amount.

Months after the settlement, she came to Bauer, distraught.

A co-worker with a similar discrimination claim wanted a witness statement from Martinez to help in pursuing a workplace discrimination claim.

But due to the settlement terms, Martinez had to refuse, at least until she was subpoenaed. The co-worker never pursued her claim, and Bauer could not keep from wondering whether the secrecy clause had prevented the co-worker from mounting a separate, meritorious case.

In some cases, it’s the repetitive nature of the wrongdoing that is at the heart of the scandal, and that is when secrecy agreements have proved particularly pernicious, Bauer noted.

“When you think of the victims of pedophile priests in Boston and other places, many of them settled with confidentiality agreements,” he said. “Later, when they heard of other allegations against the same priests, they were not able to come forward and share highly relevant information with the people who had been victimized the same way.” People with new claims often would not know who to contact.

“They could, in theory, take a deposition of the person, but first they would have to decide to file suit, which you need to do before you can take a deposition,” Bauer noted. “It may be hard to get a lawyer to take their case if the lawyer is not able to establish that there have been prior similar complaints.”

And that is where the ethics issue comes in. If a meritorious case never gets off the ground due to a lawyer’s confidentiality agreement, the agreement itself may well conflict with the rules of legal ethics.