דבר ברור ומפורש בתורה שהיא מצוה עומדת לעולם ולעולמי עולמים אין לה לא שינוי ולא גרעון ולא תוספת שנאמר את כל הדבר אשר אנכי מצוה אתכם אותו תשמרון לעשות לא תוסף עליו ולא תגרע ממנו. ונאמר והנגלות לנו ולבנינו עד עולם לעשות את כל דברי התורה הזאת. הא למדת שכל דברי תורה מצווין אנו לעשותן עד עולם. וכן הוא אומר חוקת עולם לדורותיכם. ונאמר לא בשמים היא. הא למדת שאין נביא רשאי לחדש דבר מעתה. לפיכך אם יעמוד איש בין מן האומות בין מישראל ויעשה אות ומופת ויאמר שה' שלחו להוסיף מצוה או לגרוע מצוה או לפרש במצוה מן המצות פירוש שלא שמענו ממשה. או שאמר שאותן המצות שנצטוו בהן ישראל אינן לעולם ולדורי דורות אלא מצות לפי זמן היו. הרי זה נביא שקר שהרי בא להכחיש נבואתו של משה. ומיתתו בחנק על שהזיד לדבר בשם ה' אשר לא צוהו. שהוא ברוך שמו צוה למשה שהמצוה הזאת לנו ולבנינו עד עולם ולא איש אל ויכזב:
It is a clear [idea] in the Torah that it (the Torah) is a [conglomeration] of commandment[s] that were established to last forever. It is not [meant] to have any changes, deletions, or additions, as it says (Devarim 13:1), "Everything I command you, be careful to do it. You shall neither add to it, nor subtract from it." It also says (Devarim 29:28), " But the revealed things are for us and our children forever: that we must fulfill all the words of this Torah." This is to teach us that all of the words of the Torah are commands for us to perform, forever. It also says (Vayikra 23:14), "An eternal statute throughout your generations."
It also says (Devarim 30:12), "It is not in heaven." This teaches us that the prophet does not have permission to [reveal a] new [law that was not revealed previously.] Therefore, if a prophet arises from among the men of Israel or from among the nations and performs signs and wonders and then says that G-D sent him to add a commandment, to delete a commandment, to explain one of the existing commandments in a way that was not heard from Moshe, or he says the commandments that Israel were commanded to follow were not meant for the generations, but only for a specific time, this [person] is a false prophet because he is coming to contradict the prophecy of Moshe! His death penalty is strangulation because he [falsely claimed] to be speaking in the name of G-D, but he was not really commanded [by G-D.] For, [G-D] commanded Moshe that this testament (the Torah) was for us and our children for eternity and [G-D] is not like a man, who lies.
The Rambam here is introducing us to the idea that once the Torah was given to Moshe, that is the final draft of the Torah. G-D was working on the Torah and was "tweaking it" until he finally gave it to Moshe and the Jews at Mount Sinai. However, once G-D gave the Torah, that was it. There was no more alterations, G-D wanted the Torah that was handed over to be the final draft. Any further alterations were unnecessary. Therefore, if a prophet comes and says, "G-D wanted to tweak the Torah a little more," we call him or her a liar. The reason is because the Torah was given and it is "no longer in heaven!" Man was given the perfect code.
How do we know this code was perfect and no future alterations are necessary? For starters, it was given to us by G-D. If G-D is perfect and omniscient then the code he gave us must apply for all time.
This brings me to an interesting and very important discussion, does G-D know the future and if he does, how can there be free will?
This has been a personal struggle for me and I believe I have a decent explanation. However, first let me state the dilemma clearly. The problem is this: If G-D knows what a person will do, then how does that person have free will to perform that action? Is the person not forced into performing that action because G-D already knows it will occur?
There are three main sources to discuss if you are interested in the rationalist approach to G-D's foreknowledge. The statements made by Rabbi Akiva, the Rambam and the Ralbag. Let's start with Rabbi Akiva.
It states in the name of Rabbi Akiva in Pirkei Avos (Ethics of our fathers, 3:15), "All is foreseen, and freedom of choice is granted." This does not help us understand anything. It is a simple statement that allows us to say that we have freedom of choice, but G-D knows everything. It seems like a contradiction, but it isn't and we must take Rabbi Akiva's word for it. This is a very unsatisfying answer.
The Rambam gives us a little more, but not much. He bases his opinion on his approach to divine attributes (found in The Guide section 1 chapters 51-68). Basically, the Rambam says G-D's foreknowledge does not remove our freedom from our choices (See The Guide section 3 chapter 20). The reason for this is because we don't understand the idea of G-D Knowing something. G-D does not have features that are knowable. We do not have the ability to understand any attributes of G-D, therefore, we can not understand why His knowledge of events does not contradict our free will, but it does not. This answer is more detailed than Rabbi Akiva's, but it is still very unsatisfying.
The Ralbag's answer is intriguing, because he has such a unique approach to G-D's foreknowledge. He explains (In section 3 of The Wars of The Lord) that G-D does not know the future, because the future has not yet occurred, but G-D knows all of the possible outcomes based on different decisions that a person can make.
All three of these answers are difficult to take. Rabbi Akiva does not give any explanations as to why or how his statement is believable. The Rambam gives an explanation that would disallow any type of logic in Judaism, because if we can't really understand anything about G-D how can we truly understand what he said or passed down to us? Finally, the Ralbags approach would take away too much power from G-D. For, if G-D does not know the future, how can His Torah be relevant for all generations and unchangeable, like the Rambam says it is (Granted the Ralbag goes on to explain this difficulty, but the answers are still unsatisfying)?
I think the following approach makes the most sense. All of these previous approaches either lacked a way of explaining something or were the best effort for the thinking of their time. However, if we understand that space and time are finite and G-D exists outside of the finite universe, then we can understand that G-D knows everything that has occurred and everything that will occur. It is similar to watching a movie for the second time, just because I know what is going to happen in the movie, does that make the choices of the person in the movie any less of a choice? Also, it must be that G-D knows all future events in order for the Rambam's approach to be valid, because, as I stated earlier, if G-D did not know the future how could the Torah be unalterable? Obviously, the Torah would need to adjust as reality changed. However, with our approach, using a superficial understanding of space and time, we can somewhat understand how G-D's knowledge of the future works.