Deuteronomy 18:20 Catholic Public Domain Version (CPDV)

But if a prophet, having been corrupted by arrogance, chooses to speak, in my name, things which I did not instruct him to say, or to speak in the name of foreign gods, he shall be put to death.

Deuteronomy 18

Deuteronomy 18:17-22