The concept of Al-Walā' wa-al-barā' (loyalty and disavowal) should be acted upon at all times in dealing with non-Muslims; at times of war and peace.
In fact, acting upon the concept of Al-Walaa and Al-Baraa depends on whether the Muslim is in a state of war or peace. At times of peace, a Muslim should deal with people kindly and justly. On the other hand, he should, at time of war, be loyal to his country and religion while being kind, just and righteous. If one breaches the trust and betrays his religion and country, he then commits a grave sin and the governor, in this case, has the right to inflict punishment on him in order to deter other people from doing the same.