Rambam rules that even a genuine prophet cannot add to or alter the Torah. A bat kol or prophetic sign cannot override halacha, because the Torah's authority is determined by the human process of transmission and majority ruling — 'lo bashamayim hi.'
דָּבָר בָּרוּר וּמְפֹרָשׁ בַּתּוֹרָה שֶׁהִיא מִצְוָה עוֹמֶדֶת לְעוֹלָם וּלְעוֹלְמֵי עוֹלָמִים אֵין לָהּ לֹא שִׁנּוּי וְלֹא גֵּרָעוֹן וְלֹא תּוֹסֶפֶת שֶׁנֶּאֱמַר (דברים יג א) "אֵת כָּל הַדָּבָר אֲשֶׁר אָנֹכִי מְצַוֶּה אֶתְכֶם אֹתוֹ תִשְׁמְרוּן לַעֲשׂוֹת לֹא תֹסֵף עָלָיו וְלֹא תִגְרַע מִמֶּנּוּ". וְנֶאֱמַר (דברים כט כח) "וְהַנִּגְלֹת לָנוּ וּלְבָנֵינוּ עַד עוֹלָם לַעֲשׂוֹת אֶת כָּל דִּבְרֵי הַתּוֹרָה הַזֹּאת". הָא לָמַדְתָּ שֶׁכָּל דִּבְרֵי תּוֹרָה מְצֻוִּין אָנוּ לַעֲשׂוֹתָן עַד עוֹלָם. וְכֵן הוּא אוֹמֵר חֻקַּת עוֹלָם לְדֹרֹתֵיכֶם. וְנֶאֱמַר (דברים ל יב) "לֹא בַשָּׁמַיִם הִיא". הָא לָמַדְתָּ שֶׁאֵין נָבִיא רַשַּׁאי לְחַדֵּשׁ דָּבָר מֵעַתָּה. לְפִיכָךְ אִם יַעֲמֹד אִישׁ בֵּין מִן הָאֻמּוֹת בֵּין מִיִּשְׂרָאֵל וְיַעֲשֶׂה אוֹת וּמוֹפֵת וְיֹאמַר שֶׁה' שְׁלָחוֹ לְהוֹסִיף מִצְוָה אוֹ לִגְרֹעַ מִצְוָה אוֹ לְפָרֵשׁ בְּמִצְוָה מִן הַמִּצְוֹת פֵּרוּשׁ שֶׁלֹּא שָׁמַעְנוּ מִמּשֶׁה. אוֹ שֶׁאָמַר שֶׁאוֹתָן הַמִּצְוֹת שֶׁנִּצְטַוּוּ בָּהֶן יִשְׂרָאֵל אֵינָן לְעוֹלָם וּלְדוֹרֵי דּוֹרוֹת אֶלָּא מִצְוֹת לְפִי זְמַן הָיוּ. הֲרֵי זֶה נְבִיא שֶׁקֶר שֶׁהֲרֵי בָּא לְהַכְחִישׁ נְבוּאָתוֹ שֶׁל משֶׁה. וּמִיתָתוֹ בְּחֶנֶק עַל שֶׁהֵזִיד לְדַבֵּר בְּשֵׁם ה' אֲשֶׁר לֹא צִוָּהוּ. שֶׁהוּא בָּרוּךְ שְׁמוֹ צִוָּה לְמשֶׁה שֶׁהַמִּצְוָה הַזֹּאת לָנוּ וּלְבָנֵינוּ עַד עוֹלָם (במדבר כג יט) וְ"לֹא אִישׁ אֵל וִיכַזֵּב": וְכֵן אִם עָקַר דָּבָר מִדְּבָרִים שֶׁלָּמַדְנוּ מִפִּי הַשְּׁמוּעָה אוֹ שֶׁאָמַר בְּדִין מִדִּינֵי תּוֹרָה שֶׁה' צִוָּה לוֹ שֶׁהַדִּין כָּךְ הוּא וַהֲלָכָה כְּדִבְרֵי פְּלוֹנִי הֲרֵי זֶה נְבִיא הַשֶּׁקֶר וְיֵחָנֵק. אַף עַל פִּי שֶׁעָשָׂה אוֹת. שֶׁהֲרֵי בָּא לְהַכְחִישׁ הַתּוֹרָה שֶׁאָמְרָה (דברים ל יב) "לֹא בַשָּׁמַיִם הִיא". אֲבָל לְפִי שָׁעָה שׁוֹמְעִין לוֹ בַּכּל:
It is clear and explicit in the Torah that it is [God's] commandment, remaining forever without change, addition, or diminishment, as [Deuteronomy 13:1] states: "All these matters which I command to you, you shall be careful to perform. You may not add to it or diminish from it," and [Deuteronomy 29:28] states: "What is revealed is for us and our children forever, to carry out all the words of this Torah." This teaches that we are commanded to fulfill all the Torah's directives forever. It is also said: "It is an everlasting statute for all your generations," and [Deuteronomy 30:12] states: "It is not in the heavens." This teaches that a prophet can no longer add a new precept [to the Torah]. Therefore, if a person will arise, whether Jew or gentile, and perform a sign or wonder and say that God sent him to: a) add a mitzvah, b) withdraw a mitzvah c) explain a mitzvah in a manner which differs from the tradition received from Moses, or d) if he says that the mitzvot commanded to the Jews are not forever, but rather were given for a limited time, he is a false prophet. He comes to deny the prophecy of Moses and should be executed by strangulation, because he dared to make statements in God's name which God never made. God, blessed be His name, commanded Moses that this commandment is for us and our children forever, and, God is not man that He speak falsely. Similarly, if [a "prophet"] nullifies a concept which was transmitted by the oral tradition, or states with regard to one of the Torah's laws that God commanded him to render such and such a judgment, or that such and such is the law regarding a particular instance and the decision follows a certain opinion, he is a false prophet and should be [executed by] strangulation. [This applies] even if he performs a wonder, for he is coming to deny the Torah, which states: "It is not in the heavens." If, however, [he states that] for a limited time [we should follow a particular course of behavior], he should be listened to with regard to all things.