You may be able to legally wall yourself off from your spouse's debts, even in community property states, through a document known as a postnuptial agreement.
These court rulings and statutes vary in terms of the formality required of postnuptial agreements and their permissible scope, as well as with respect to other restrictions.
While postnuptial agreements are generally subject to the same notice and recording rules as premarital agreements, the rules for transmutation agreements are slightly different.