At the global consulting firm McKinsey & Company, the rule is sacrosanct: Never publicly disclose client advice. And for the most part, adherence to that rule has served the company well.

But in recent months, as government officials seek to assign blame for the opioid crisis that has strangled large parts of the nation, McKinsey’s advice is surfacing in ways that are deeply embarrassing for the influential firm, whose clients include many of the world’s most admired companies. One lawsuit stated that McKinsey advised a pharmaceutical company to “get more patients on higher doses of opioids” and study techniques “for keeping patients on opioids longer.”

And in a civil trial that wrapped up last week, Oklahoma joined two other states — Massachusetts and New Jersey — in showing that McKinsey offered advice to a drug company on how to increase opioid sales at a time when abuse of its pain medicine was widespread.

Although McKinsey is not a defendant, Oklahoma used McKinsey consulting records to help build its case against Johnson & Johnson and a subsidiary, Janssen Pharmaceuticals, for what the state said was irresponsible marketing of a fentanyl patch called Duragesic.