So long as the AI within them is "three laws strong", (possible "computer" viruses aside).
Isaac Asimov explored the subject many years ago in his writings including I, Robot (you can watch the 2004 movie if you can't find a print copy; it's kinda true to the idea) and his Foundation series. He's far from the only science or science fiction writer to tackle the subject.
It depends on how they become smarter. A true A.I. would have free will to thin k whatever they want so there would be both malevolent and benevolent robots.