Deuteronomy 18:20-22 NIV

20 But a prophet who presumes to speak in my name anything I have not commanded him to say, or a prophet who speaks in the name of other gods,1 must be put to death."2

References for Deuteronomy 18:20

21 You may say to yourselves, "How can we know when a message has not been spoken by the LORD?"
22 If what a prophet proclaims in the name of the LORD does not take place or come true,3 that is a message the LORD has not spoken.4 That prophet has spoken presumptuously.5 Do not be afraid of him.

References for Deuteronomy 18:22