A virtuous or morally-sound person, often such a character in a book or film. The term is a reference to the color of the cowboy hat stereotypically worn by the hero in Westerns (as opposed to the villain's black hat). The white hats are working to apprehend the masterminds behind the heist.
white hat
n. a good guy; a hero. (From Western movies where you could tell the good guys from the bad guys by the color of their hats: white for good, black for bad.) He seems like a white hat, but he’s a worm.