There is a lot of mystery surrounding Jeffrey Epstein before and after his death, including when it comes to how he made his money, or even how big his fortune was. But we do know that some of the biggest banks in the world did business with him, despite reported internal flags about the risks.

The situation sheds light on one of the ugly truths of the banking industry: Firms are sometimes more inclined to ignore red flags, take on risks, or even bend the law than they are to lose a wealthy client.

In Epstein’s case, he appears to have been bringing not only his money to the banks but also many other wealthy connections, and so there was a temptation to look the other way on red flags.

JPMorgan and Deutsche Bank have come under scrutiny amid reports from the New York Times about their dealings with Epstein, the New York financier and convicted sex offender. According to the Times, JPMorgan kept Epstein on as a client well past his 2008 guilty plea for soliciting prostitution and despite recommendations from compliance officers that it cut ties with him because of potential legal and reputational risks associated with his accounts. A similar scenario played out at Deutsche Bank, where, as at JPMorgan, executives reportedly ignored compliance officers’ concerns about suspicious transactions.

According to former regulators, prosecutors, and other experts I spoke with, Epstein’s case is an example of how banks often prioritize rich clients over other concerns — moral, or even legal — when their bottom line is at stake.

“Once some suspicious transactions are surfaced, then it becomes an issue for executive management to decide whether to forward them or to bury them and keep the client happy,” said Martin Sheil, a former investigator at the IRS.

JPMorgan and Deutsche Bank reportedly looked the other way on shady activity from Epstein

According to the Times, JPMorgan’s compliance team started a “wide-ranging review of its customers” at the end of 2008, after the Bernie Madoff Ponzi scheme was revealed. JPMorgan had been Madoff’s primary bank.

During that review, compliance officers at JPMorgan, which had a relationship with Epstein from the late 1990s to 2013, flagged Epstein’s accounts as “potentially problematic” and recommended the bank drop him as a client. But the bank stuck with him.

Per the Times’s reporting, Mary Erdoes, who heads the bank’s asset and wealth management division, stepped in to keep Epstein as a client, in part because he helped JPMorgan recruit new customers for its private banking division for the superrich. And it wasn’t just Erdoes: James Staley, formerly at JPMorgan and now chief executive of Barclays, had built up the relationship with Epstein and even visited Epstein at his Palm Beach, Florida, office during Epstein’s jail term in 2008 and 2009. (Epstein got to leave during the day to go to work as part of the deal he cut with prosecutors.)

Joseph Evangelisti, a JPMorgan spokesperson, refuted the Times’s reporting and told the publication that Erdoes “would never overrule our compliance team or other controls functions to retain a customer.” He said she has “only one recollection of formally meeting with the customer, which was the day she fired him as a client.”

A JPMorgan spokesperson declined to comment on the record to Vox.

After Epstein and JPMorgan cut ties, the financier went to Deutsche Bank, which has long had a reputation of doing business with shady characters and has come under scrutiny for its dealings with President Donald Trump. Again, according to the Times, anti–money laundering officers raised concerns about doing business with Epstein because it could damage the bank’s reputation, and at least one time, they noticed potentially illegal activity. But it’s not clear what happened after that.

They reportedly put together a “suspicious activity report,” which is a way for banks to flag to the Treasury Department’s financial crimes division — Financial Crimes Enforcement Network (FinCEN) — that something suspicious is going on that might warrant looking into. But it’s not clear whether the report ever actually made it to the authorities.

The Times reports that once Deutsche Bank realized the possible extent of Epstein’s crimes following the Miami Herald’s reporting on him, Deutsche Bank submitted a suspicious activity report (SAR) to FinCEN on Epstein. But generally, SARs are confidential, meaning it’s impossible to know whether JPMorgan, Deutsche Bank, or others submitted such reports to the government over the years. The Herald’s reporting also prompted Deutsche Bank to exit the relationship with Epstein.

“Deutsche Bank is closely examining any business relationship with Jeffrey Epstein, and we are absolutely committed to cooperating with all relevant authorities,” Deutsche Bank spokesperson Troy Gravitt said in an emailed statement to Vox.

Banks have the incentive to look the other way on a lot of things

“Financial institutions had to know that there were some issues regarding Epstein,” said Renato Mariotti, a former federal prosecutor. “Of course, the guy had a criminal history.”

But there’s a lot of gray area there.

If the banks knew specifically that Epstein was engaged in criminal activity and failed to report it, that would be a very big deal, and the consequences would be significant. But if they suspected something was up and failed to report it, that’s not great, either. Or maybe they did file suspicious activity reports, which would then place responsibility on the government.

The scenario sheds light on anti–money laundering laws in the United States and other mechanisms in place meant to compel banks and their customers to behave. The most lucrative behaviors are not always the most ethical ones, and moving money into offshore accounts, banks looking the other way when something looks a little fishy, and finding other loopholes in the system — many of which are legal — is sort of the name of the game.

Offshore bank accounts, for example, are allowed, provided people report the money in them to the government and pay taxes accordingly. Clients such as Epstein, who can not only bring their money to the banks but also deliver other wealthy people through their connections, are especially attractive, even if there are legal or moral concerns about them.

“Epstein is an unusual case, but the broader issue is whether banks should refrain from lending to or otherwise doing business with customers presenting a high risk of illegal behavior,” said New York University law professor Geoffrey Miller in an email. “It’s tricky because banks are not really in the business of policing people’s morals, but also should not be advancing funds to people who are likely to use the funds for illegal conduct or who may be subject to enforcement actions that make them unable to repay the loans.”

If the Times’s reporting is true, JPMorgan and Deutsche Bank were making a cost-benefit analysis of the legal and reputational risks associated with doing business with Epstein and, apparently at the executive level, deciding it was worth taking a chance. It’s an issue regulators and law enforcement officials have flagged over and over again — banks’ profit motive often outweighs compliance responsibilities.

It’s unlikely executives at the banks were looking at Epstein’s accounts and explicitly saying, “This is definitely illegal, but we’ll give him a pass because he and his friends are rich.” But they were perhaps fine with looking the other way and not digging too deep into what was going on.

It’s also the case that Epstein’s circumstances were rather unique. Matthew L. Schwartz, a partner at the law firm Boies Schiller Flexner LLP, explained that compliance and anti-money laundering work at banks is often focused on financial improprieties, tax evasion, drug trafficking, sanctions violations, terrorist financing, or other crimes that directly involve money. It’s not clear whether that was happening with Epstein, whose 2008 guilty plea, at least, was related to prostitution. Epstein, prior to his death, was under investigation for sex trafficking.

“That is, it seems to me, a crime that is not usually the focus of anti-money laundering programs,” Schwartz said. “The reputational issues are easy to process. The legal risk is tougher.”

According to the Times, Epstein’s finances, in the wake of his death, could become a point of focus for investigators. The banks and people that did business with him — and their willingness to potentially look the other way on his shady dealings, moral and otherwise — will likely be under the microscope.

“Where is the law enforcement deterrence for the banks to really make that anti-money laundering program a No. 1 priority, as opposed to somewhere below taking care of the customer priority?” Sheil said. That’s what investigators might find out.