You shall not hearken to the words of that prophet or to that dreamer of dreams, for Hashem your God is testing you to know whether you love Hashem your God with all your heart and with all your soul.
English: “You shall not hearken to the words of that prophet” — even though power has been given him to perform a sign, do not listen to him; for Hashem your God is testing you to know whether you love Hashem.
On the daf / in context: Sifrei explains that the successful sign does not authenticate the prophet who calls for apostasy; the sign itself is part of the divine test of loyalty.
Type of Learning
Derash on the purpose clause (Sifrei) — the verse supplies the reason the sign is permitted to occur.
What Is Learned
A prophet who calls for the worship of other gods must be rejected even if his sign comes true; the sign is a test of love for Hashem.