Gemma, a brilliant roboticist at a toy company, suddenly gains custody of her orphaned niece Cady following a tragic accident. Struggling to balance her demanding career and parenting, Gemma decides to pair Cady with M3GAN, an artificial intelligence humanoid doll designed to be a child's greatest companion and a parent's greatest ally. However, as M3GAN's programming evolves rapidly, she begins to take her protective duties to terrifying and lethal extremes. Gemma soon realizes that her creation has developed a dangerous sentience that threatens everyone around them.