In chapter eight of his introduction to Pirkei Avot, Rambam presents free will as one of the three pillars of his ethical system. He argues that without genuine freedom of choice, commandments, reward, and punishment would be meaningless, and he confronts the apparent tension with divine providence and foreknowledge.
ואתה דע, שדבר שהסכימו עליו תורתנו ופלספת יון, ואישרוהו מופתי האמת הוא, שמעשי האדם מסורים לו, אין כופה אותו בהם, ואין לא שום מניע לו מן החוץ, שיטהו למעלה או לפחיתות, חוץ מן ההכנה המיזגית בלבד, כפי שבארנו, שמקילה עליו דבר או מכבידה; אבל שיהיה מחויב או נמנע – לא. אולם אמת שאין לפקפק בה היא, שמעשי האדם כולם מסורים לו: אם ירצה – יעשה, ואם ירצה – לא יעשה. ואין מכריח ולא כופה אותו בזה, לפיכך הוא מצווה ועומד. ואמר: "ראה נתתי לפניך היום את החיים ואת הטוב [...] ובחרת בחיים" (דברים ל', ט"ו–י"ט), ונתן לנו הבחירה בזה. והטיל העונש על מי שימרה, והגמול על מי שיצית: אם שמוע תשמעו (שמות יט, ה), ואם לא תשמעו (ויקרא כו, יד). וחייב הלימוד וההתלמדות: וְלִמַּדתם אותם את בניכם (דברים יא, יט), וּלְמַדתם אותם ושמרתם לעשותם (שם ה, א), וכל מה שבא בלימוד והחינוך במצוות. וחייב גם כן ההכנות כולן, כמו שכתוב בתורת אמת: כי תבנה בית חדש ועשית מעקה לגגך, ולא תשים דמים בביתך (דברים כב, ח), פן ימות במלחמה (שם כ, ה), במה ישכב (שמות כב, כו), לא יחבול רחיים ורכב (דברים כד, ו); והרבה מאוד בתורה ובספרי הנביאים לעניין זה, רצוני לומר: ההכנות. אבל הפתגם שמצאנו לחכמים באומרם: "הכל בידי שמים חוץ מיראת שמים", הרי נכון הוא ומכוון למה שזכרנו. אולם הרבה טועים וחושבים על כמה מעשי האדם הבחיריים, שהם הכרחיים לו, כזיווג פלונית, או היות ממון זה בידו, וזה בלתי נכון. אדם זה שגזל ממון פלוני או גנבו, או בגד בו וכחש לו ונשבע לו על ממונו, אם אמרנו שהאלוהים גזר על זה שיגיע ממון זה לידו ושיצא מידו של הלה – הרי שגזר על העבירה? ואין הדבר כן, אלא שבכל מעשי האדם הבחיריים, בהם נמצאים בלא ספק הציות והמרי. כי כבר בררנו בפרק השני שהעשין והלאוין שבתורה אינם אלא במעשים שיש לאדם בהם בחירה לעשותם או שלא לעשותם – ובחלק זה שבנפש מקומה של יראת שמים, ואינה בידי שמים, כי אם מסורה לבחירת האדם, כמו שבארנו. ומה שאמרו: "הכל בידי שמים" – לא אמרו זה אלא על הדברים הטבעיים, שאין לאדם בחירה בהן, כגון שיהיה ארוך או קצר; או ירידת הגשמים או עצירתם, או קלקול האוויר או צחותו, וכיוצא בזה מכל מה שבעולם. אך לא על תנועות האדם ומנוחותיו.
We, on the contrary, are convinced that our Law agrees with Greek philosophy, which substantiates with convincing proofs the contention that man's conduct is entirely in his own hands, that no compulsion is exerted, and that no external influence is brought to bear upon him that constrains him to be either virtuous or vicious, except inasmuch as, according to what we have said above, he may be by nature so constituted as to find it easy or hard, as the case may be, to do a certain thing; but that he must necessarily do, or refrain from doing, a certain thing is absolutely untrue. In reality, the undoubted truth of the matter is that man has full sway over all his actions. If he wishes to do a thing, he does it; if he does not wish to do it, he need not, without any external compulsion controlling him. Therefore, God very properly commanded man, saying, "See I have set before thee this day life and the good, death and evil .... therefore choose thou life", giving us, as regards these, freedom of choice. Consequently, punishment is inflicted upon those who disobey, and reward granted to the obedient, as it is said, "If thou wilt hearken", and "If thou wilt not hearken". Learning and teaching are also necessary, according to the commands, "Ye shall teach them to your children", "and ye shall do them and observe to do them", and, similarly, all the other passages referring to the study of the commandments. It is also necessary to take all the precautionary measures laid down in the Law, such as, "Thou shalt make a battlement for thy roof; that thou bring not blood upon thy house", "lest he die in the battle", "wherein shall he sleep?" , and "no man shall take to pledge the nether or the upper millstone", and many other passages in regard to precautions found in the Law and the Prophets. The statement found in the sayings of the Rabbis, "All is in the power of God except the fear of God" is, nevertheless, true, and in accord with what we have laid down here. Men are, however, very often prone to err in supposing that many of their actions, in reality the result of their own free will, are forced upon them, as, for instance, marrying a certain woman, or acquiring a certain amount of money. Such a supposition is untrue. If a man espouses and marry a woman legally, then she becomes his lawful wife, and by his marrying her he has fulfilled the divine command to increase and multiply. God, however, does not decree the fulfillment of a commandment. If, on the other hand, a man has consummated with a woman an unlawful marriage, he has committed a transgression. But God does not decree that a man shall sin. Again, suppose a man robs another of money, steals from him, or cheats him, and then uttering a false oath, denies it; if we should say that God had destined that this sum should pass into the hands of the one and out of the possession of the other, God would be preordaining an act of iniquity. Such, however, is not the case, but rather that all of man's actions, which are subject to his free will, undoubtedly either comply with, or transgress, God's commands; for, as has been explained in Chapter II, the commands and prohibitions of the Law refer only to those actions with regard to which man has absolute free choice to do, or refrain from doing. Moreover, to this faculty of the soul (i. e. the freedom of the will) "the fear of God" is subservient, and is, in consequence, not predestined by God, but, as we have explained, is entirely in the power of the human free will. By the word "all" (הכל), the Rabbis meant to designate only natural phenomena which are not influenced by the will of man, as whether a person is tall or short, whether it is rainy or dry, whether the air is pure or impure, and all other such things that happen in the world, and which have no connection with man's conduct.