Are assets in an HSA protected from bankruptcy (any type), similar to how assets in a 401(k) or pension plan are protected?

Each state establishes their own regulations for bankruptcy, and unless there is a federal exemption, the assets are subject to the laws governing the state where the accountholder resides and files for bankruptcy protection. There is no federal protection or exemption for HSA assets.