What is the meaning of the idiom 'to go rogue'?

To go "rogue" means to make a large deviation from one's strict training. For example, in the United States agents like FBI, Secret Service etc. get special training and are indoctrinated to follow the rules of their profession. If an individual agent starts to behave contrary to the rules he or she has gone rogue.