In Kabbalah this kind of thing is called a Golem. You make one by saying the letters of the Hebrew alphabet in just the right sequence. The oral Torah says that the thing that got Joseph in trouble with his brothers was that he reported to Jacob that they had made a Golem.
My understanding was writing the name of G-d in the golem’s forehead (72 letters in the proper sequence). The story goes that on the first day, he called his maker ‘master’. On the 2nd day, ‘brother’, and on the third, ‘servant’.