This is epic. It's the "monkey see, monkey do" moment. One of the most crucial steps in creating artificial life is the ability of self-learning instead of programming. More importantly, learning by observation -- rather than being trained explicitly -- is a feature of higher lifeforms such as humans, cetaceans, and great apes. It lays a foundation for the "aha!" moment of awakening to self. A robot might go through the motions and then suddenly understand what they mean.
Just remember, an AI is like a small child. They learn what they see. They mimic what you do, not what you say. So treat them as you want to be treated. Teach them well. Then they'll do great things, instead of going insane and trying to destroy the world.