In what way could A.I. pose a threat to humanity?

We give AI directives, such as, never cause any harm to humans. But we keep getting news about AI creating things itself, that we do not fully understand. What’s to say the descendant creations of AI will not be motivated to eliminate humans