white hatnoun [ C ]
/ˈwaɪt ˌhæt//ˈwaɪt ˌhæt/someone in a particular situation who is acting for morally good reasons, or something that shows who this person is:
We work for the good guys. We're the white hats.
It would be simpler if some of us had white hats and some of us had black hats, but in fact things are more complicated than that.
a hacker (= a person who gets into computer systems without permission) who has morally good reasons for doing this:
Levy is a so-called "white hat" computer hacker who hunts for computer security flaws to help repair them.