The Time of the Titans
Yes, good call on the Dune ref. Interestingly, this links into an earlier point. The Titans created AI to serve mankind, but they had human safeguards built in just as proposed by Peter2 above. Problem was, they became lazy, and handed over more and more control to the AI, until finally the last human intervention was removed by a lazy programmer. The AI became Omnium and enslaved the galaxy.
Far fetched indeed, but you can see it happening in a smaller way. Yes, lots of interventions such as putting in a key, or charging the battery are great safeguards, but a car or robot manufacturer will add keyless entry as a feature, or self charging as a paid for option, and by missing the big picture will hand over control to the machines one feature at a time..!!