Anyway to make part of the code Read-Only to the ai?

I am getting tired of having to redo formulas I don’t want touched becasue the AI randomly decides that the moon is waning so clearly the formula must be changed when asked about a part of the code that has nothing to do with the formula, only to find out a few hours later the thing has messed with formulas so i have to go in and fix it