I think the best that we can do is to observe people over time and slowly build trust or distrust.
Work interactions I guess could be treated as a repeated game with imperfect information. We have to try to refine our priors iteratively.
The way I did it was to be well-intentioned, honest and open with everybody in the beginning and close up as needed. I would determine if somebody was ill-intentioned based on how they reacted to my feedback and based on their general behavior. Do they tend to talk people behind their back? Do they consistently silo information? Do they offer constructive advice? Do they focus on the actual work rather than on attention-seeking? etc.
But indeed the task is not easy and things will never be perfectly clear.