A spirit of Arabian folklore, as traditionally depicted imprisoned within a bottle or oil lamp, and capable of granting wishes when summoned; figuratively, an agent of power or change which is or may be released from containment.
Recorded from the mid 17th century (denoting a guardian or protective spirit), the word comes via French from Latin base of genius. Génie was adopted in the current sense by the 18th-century French translators of The Arabian Nights' Entertainments, because of its resemblance in form and sense to Arabic jinnī jinn.
let the genie out of the bottle let loose or lose control of an unpredictable force, start an uncontrollable chain of events. Sometimes in the form, you can't put the genie back in the bottle.