General safety with companion computers

Hello,

I work with a Pixhawk 2 in combination with a raspberry pi and i was running some experiments with offboard mode. I figured out that the companion computer is capable of switching flight modes. This means that i were to accidentally write some kind of loop that would spam a signal that would send the drone in an undesired flight mode that it would be impossible for us to get it out of that flight mode without triggering a failsafe. This can be very dangerous when running software in offboard mode. My question is if there is a possibility to set a companion computer to be some kind of slave controller to the RC using a switch of some sort.

Kind regards Gerjen