The phrase
"to wag the tail" means to manipulate or control someone or something in a subtle or indirect way, usually with the intention of getting what you want. It suggests having the power to influence others without them realizing it.
Full definition