That’s the part I don’t think will be allowed fully occur, as once you lose control over the robot by allowing it to essentially think and be creative by itself (with no kill switch or boundaries) dangers can occur. Hollywood may have a penchant for going over the top in films but quite a few robot orientated movies make good points of the negatives which could occur if robots are given unchecked self learning abilities.
Human’s can be bad enough but are (to an extent for some) guided by emotions and the value of life, just look at the extent some go to for protecting other species, yet would the species return the favour or in that matter would robots?