'Agitare la carota' is used in Italian as well with such a meaning.
And there is another very common expression with a slightly different meaning, 'usare il bastone e la carota', to use the carrot and the stick.
Looking into this, it seems to me we have a case of idioms seeming similar but in fact having slightly different meanings.
according to
Dizionari.corriere.it/
Usare il bastone e la carota
usare il bastone e la carota
Fig.: ricorrere alternativamente alle buone e alle cattive maniere per ottenere un dato fine, come si usa fare con gli asini che un po' vengono allettati con le carote e un po' vengono presi a bastonate quando le carote non bastano a vincere la loro cocciutaggine.
This seems more similar to the English expression:
To play good cop, bad cop.
"to dangle a carrot in front of someone"
is more about enticing someone with an offer. I would also add, the offer is not
necessarily unobtainable, though it is often used with that sense as well. I was told that '
Agitare la carota' is not common, and the significance is not obvious to a typical Italian. I found the phrase "
agitare l'esca " in another thread. Is this phrase more idiomatic and clear?