Any policy of life or endowment insurance or any annuity contract may provide that the proceeds of or payments under it shall not be subject to transfer, anticipation, or commutation or encumbrance by any beneficiary other than the insured or the purchaser of the annuity, and shall not be subject to the claims of a creditor of any beneficiary or any legal process against the beneficiary.
R.I. Gen. Laws § 27-4-12