Fresh dirt has spilled at Goldman Sachs — and this time it has been caught on tape.

David Solomon, who took the helm of the Wall Street giant from Lloyd Blankfein last week, once blew off criticism of Goldman’s double-dealing in a big energy merger as a matter of “perception” — a cheeky dismissal that came despite a class-action lawsuit against the deal that eventually cost Goldman $20 million in fees.

That’s among the cringeworthy quotes that Carmen Segarra claims she secretly recorded behind closed doors for her new book “Noncompliant: A Lone Whistleblower Exposes the Giants of Wall Street.” The 340-page exposé expands on her previous claims that Goldman Sachs has long exploited an improperly cozy relationship with Wall Street regulators.

Segarra was a former bank examiner who looked into Goldman Sachs for the Federal Reserve Bank of New York, and claims she got fired in 2012 after making too much noise about Goldman’s alleged conflicts.

The New York Fed has often been blasted for its lackadaisical approach to overseeing banks leading up to the 2008 financial crisis. Its last president, William Dudley, was named in 2009 after spending 21 years at Goldman. But Segarra’s book claims that the problem persisted for years after the crisis, with regulators happy to act on the banks’ behalf.

“We want [Goldman] to feel pain, but not too much,” her boss — who goes by the pseudonym Connor O’Sullivan in the book — told her, Segarra claims.

Segarra says she took meticulous notes and recorded 46 hours of conversations with colleagues and bankers during her seven months at the New York Fed. Neither the bank nor the regulator has disputed that the tapes are real.

The central battle in the book pits Segarra against Goldman Sachs and allegedly sleepy regulators over energy giant Kinder Morgan’s 2012 deal to acquire rival El Paso Corp. for $21.1 billion. Not only did Goldman advise both sides of the deal, its lead banker advising El Paso, Steve Daniel, owned $340,000 in Kinder Morgan stock.

None of that mattered to Solomon, who was Goldman’s co-head of investment banking at the time, according to Segarra.

“A conflict is a perception, OK, of something that could affect the advice you’re giving, the judgment, et cetera,” Solomon said during a meeting with the New York Fed and other regulators that Segarra says she recorded.

“Our job … is to discuss those things and to work collectively with [clients] to decide whether or not those perceptions inhibit us,” Solomon added.

That was after Delaware Judge Leo Strine had called Goldman’s double-dealing “disturbing” and “tainted by disloyalty” as he reluctantly OK’d the deal — and despite El Paso shareholders filing a class-action suit against it, alleging the tie-up was designed to benefit Goldman Sachs.

Solomon’s approach backfired: Goldman lost out on $20 million it would have collected in fees from El Paso after the shareholders won a $110 million judgment.

In the memoir — which The Post first reported Segarra was writing in 2015 — she portrays the New York Fed as conflict-ridden, with regulators trading on inside information from bankers they’re supposed to keep in line.

When Segarra told one unnamed colleague that insider trading was illegal, he quipped, “Not if you don’t get caught,” according to the book.

Another boss, Michael Silva, pushed Segarra to gloss over the fact that Goldman didn’t have a written conflict-of-interest policy, she claims. Silva, who now works in private practice, declined to comment.

Jake Siewert, a Goldman spokesman, didn’t respond to a question asking for Solomon to comment on his words that were caught on tape.

“For decades we have had a dedicated team that reviews potential transactions to assess both potential conflicts and client sensitivities given the broad reach of our client franchise,” Siewert told The Post. “The firm takes that responsibility seriously, and the head of that group sits on our most senior leadership team.”

It’s the second time in a month that Solomon has been accused of playing fast and loose with ethics rules. Last month, The New York Times reported that Solomon urged former Goldman banker James Katzman to drop complaints he’d made in 2014 when Goldman traders tried to milk him for inside information, telling him that “the concerns he had raised simply reflected the way Wall Street worked.”

Goldman claims the exchange was a miscommunication, and nobody did anything wrong.

Segarra previously sued her former employer, but her case was dismissed partly on the grounds that she didn’t merit whistleblower protection.

“We continue to categorically reject Ms. Segarra’s allegations from her brief seven-month tenure as a junior examiner almost seven years ago,” Andrea Priest, a spokeswoman for the New York Fed, told The Post.

“The staff of the New York Fed work diligently and with the utmost integrity in the fulfillment of their responsibilities,” she added.

This isn’t the only time, however, that Goldman and the New York Fed have gotten too close for the government’s comfort.

In 2015, Goldman paid $50 million to settle accusations that former banker Rohit Bansal wined and dined a New York Fed analyst, Jason Gross, at Peter Luger Steak House in Brooklyn, and got secret examination documents in return. Bansal and Gross both got probation and paid fines.