Insurance policies usually offer "code protection" or something similar. If the customer didn't buy it, that is between the agent and the customer. If the AHJ requires a code upgrade it is out of your hands. This can bring up some interesting conundrums. If you didn't have the "code" rider, it might be cheaper not to put in a claim and get your house fixed under the table for cash.