If you owe money or have filed for bankruptcy, you may be worried about creditors going after your retirement funds. Regardless of your financial situation, here is some essential information to know about both ERISA-qualified retirement accounts and non-ERISA accounts:

ERISA-qualified retirement accounts

Retirement accounts set up under the Employee Retirement Income Security Act (ERISA) of 1974 tend to be protected from seizure by creditors. ERISA covers most employer retirement plans, including 401(k) plans, pension plans, and some 403(b) plans. Even if you have accumulated millions of dollars in your retirement account and owe money or have filed for bankruptcy, creditors cannot access money in these ERISA-qualified plans.

“If there’s a creditor who is looking to get paid, under ERISA, there’s no cap on protected monies,” says Geno Cufone, senior vice president of retirement administration at Ascensus, an independent retirement plan provider.

There are some instances when money in an ERISA-qualified account may not be protected. If you are incarcerated and go to prison, the “state could garnish those funds to recompense the prison for some of their costs,” says Rich Paul, CFP®, president of Richard W. Paul and Associates, a retirement planning and registered investment advisory firm in Michigan.

Your retirement savings may also not be protected if the creditor is a former spouse or the IRS.

Non-ERISA accounts

Individual retirement accounts (IRAs), including Roth IRAs, are not protected under ERISA. Therefore, state laws determine whether or not the money in these accounts is protected from creditors. The only exception is in the case of bankruptcy.

The Bankruptcy Abuse Prevention and Consumer Protection Act (BAPCPA) of 2005 gives protection to IRAs up to $1 million (though money rolled over from an ERISA-qualified plan into an individual account may not be subject to these limits).

However, you can lose those protections and the account’s tax-qualified status if you use your IRA for a prohibited transaction, such as pledging it as security for a loan or borrowing from it.

Outside of bankruptcy, state laws determine what is protected. In Michigan, where Paul practices, the first $1 million in an IRA is protected from creditors , but inherited IRAs are not protected.

The rules around ERISA-qualified and non-qualified accounts can be confusing, so if you need help understanding your situation or dealing with creditors, you may want to consult an attorney or financial planner.

Susan Johnston has covered personal finance and business for publications including Bankrate.com, the Boston Globe, Entrepreneur.com, Learnvest.com, Mint.com, and USNews.com. Find out more at www.susan-johnston.com.

[amazon_link asins=’B072BTCMP6,0812925319,0812927427,0609809334′ template=’ProductCarousel’ store=’thinkglink-20′ marketplace=’US’ link_id=’683ae1df-deac-11e7-bf7a-6fa116f00892′]