The dirty secret about debanking — now a priority of the Trump administration — is that Congress laid the groundwork for it to happen.

Laws designed to catch criminals, monitor financial activity and guard financial stability have created a web of incentives that encourage banks to cut off anyone whose financial activity strays from the norm.

One of the most common experiences in debanking is a sense of confusion. People report being told their account has been closed, but the bank won’t say why.

This silent treatment often has to do with confidentiality laws. However, these are not laws meant to protect the financial privacy of customers. Rather, this confidentiality is to prevent citizens from finding out they are under criminal investigation. For example, reports filed under the Bank Secrecy Act are restricted so heavily that banks cannot share the details of the reports or even admit that a report exists.

This confidentiality also extends to regulatory investigations. To be fair, Congress did well to establish protections for this information by prohibiting regulators from sharing supervisory materials with the general public. The problem, as described by the Wharton School’s Peter Conti-Brown, is when the Federal Reserve “asserted a legal theory” that these materials belong to the government “even when [they are] produced by the banks and even when the banks themselves are eager to disclose [them].”

The Federal Reserve’s theory is backward. Banks should have the ultimate say over how this information is shared if it pertains to their own operations. That is especially the case if that information is the reason for an account closure.

Reputational risk regulation — the practice of federal regulators deciding how and with whom a bank should do business — is similarly backwards. Most people want their bank to have a strong reputation, but it should not be the government’s job to define what constitutes a “good” or “bad” reputation. For better or worse, that job should be left to banks and banks alone.

It’s time to untangle this web and create a freer financial system for customers and bankers, alike.

The good news is that regulators recently began taking reputational risk regulation out of their toolkits and President Trump later called for the practice to end. Yet only Congress has the power to create a lasting solution. To that end, Sen. Tim Scott (R‑S.C.) and Rep. Andy Barr (R‑Ky.) introduced the FIRM Act last year to put an end to reputational risk regulation once and for all.

Even then, the fight does not end there. Congress must also reform the Bank Secrecy Act. This 55-year-old regime has increasingly deputized banks as law enforcement investigators, forcing them to scrutinize every transaction for possible wrongdoing. In effect, customers who stray from the norm can quickly find themselves debanked.

Those confidential reports filed under the Bank Secrecy Act are essentially red flags on a customer. Once a customer is reported around three times, a bank will close the account.

It would be one thing if these reports were filed for cases of something truly heinous, such as terrorism or human trafficking. Yet the data paint a different story. The vast majority of reports filed under the Bank Secrecy Act are for two things: First, a customer made a cash transaction of $10,000 or more. Second, a customer made a cash transaction near $10,000.

That’s not a mistake. Congress actually made it illegal to avoid the $10,000 threshold, so now reports also have to be filed if someone gets close to it.

Although most people would likely shrug off such activity, banks must treat it as a red flag nonetheless. Getting too many of these red flags will ultimately result in the closure of the account.

But customers don’t have to be left in the dark when these closures happen. Ultimately, Congress got us into this mess, and Congress has the power to introduce transparency, end reputational risk regulation, and reform the Bank Secrecy Act. Doing so would help put debanking in the past — saving countless Americans from uncertainty and frustration.