Halachaהלכה

Automated Processes Running on Shabbat

Jewish law permits setting certain mechanical or automated processes in motion before Shabbat so long as they operate without direct human intervention on Shabbat itself. The sources explore the boundaries of this permission, examining distinctions between permitted autonomous systems and forbidden forms of labor, with applications to modern technology.

והיא נגמרת מאליה בשבת

8 sources · verified

Opens as a working sheet — explore, annotate, and export.

Source 1 · Tanach
Verified

Exodus 20:10 — The Fourth Commandment

Exodus 20:10

The Torah commands rest on Shabbat for 'you, your son, your daughter, your slave, your maidservant, your animal, and the stranger in your gates.' The scope of who or what must rest is the foundational text for all discussions of whether tools, workers, or agents under one's control must also cease from labor.

וְי֨וֹם֙ הַשְּׁבִיעִ֔֜י שַׁבָּ֖֣ת ׀ לַיהֹוָ֣ה אֱלֹהֶ֑֗יךָ לֹֽ֣א־תַעֲשֶׂ֣֨ה כׇל־מְלָאכָ֜֡ה אַתָּ֣ה ׀ וּבִנְךָ֣͏ֽ־וּ֠בִתֶּ֗ךָ עַבְדְּךָ֤֨ וַאֲמָֽתְךָ֜֙ וּבְהֶמְתֶּ֔֗ךָ וְגֵרְךָ֖֙ אֲשֶׁ֥֣ר בִּשְׁעָרֶֽ֔יךָ׃

but the seventh day is a sabbath of the ETERNAL your God: you shall not do any work—you, your son or daughter, your male or female slave, or your cattle, or the stranger who is within your settlements.

Source 2 · Tanach
Verified

Deuteronomy 5:14 — Shabbat Rest Extended

Deuteronomy 5:14

The Deuteronomy version of the Ten Commandments specifies rest so that 'your ox and your donkey may rest,' emphasizing rest for one's instruments and dependents, which became the basis for the concept of 'shevitat keilim' — the rest of one's tools — directly relevant to automated agents.

וְי֨וֹם֙ הַשְּׁבִיעִ֔֜י שַׁבָּ֖֣ת ׀ לַיהֹוָ֣ה אֱלֹהֶ֑֗יךָ לֹ֣א תַעֲשֶׂ֣ה כׇל־מְלָאכָ֡ה אַתָּ֣ה וּבִנְךָֽ־וּבִתֶּ֣ךָ וְעַבְדְּךָֽ־וַ֠אֲמָתֶ֠ךָ וְשׁוֹרְךָ֨ וַחֲמֹֽרְךָ֜ וְכׇל־בְּהֶמְתֶּ֗ךָ וְגֵֽרְךָ֙ אֲשֶׁ֣ר בִּשְׁעָרֶ֔יךָ לְמַ֗עַן יָנ֛וּחַ עַבְדְּךָ֥ וַאֲמָתְךָ֖ כָּמֽ֑וֹךָ׃

but the seventh day is a sabbath of the ETERNAL your God; you shall not do any work—you, your son or your daughter, your male or female slave, your ox or your donkey, or any of your cattle, or the stranger in your settlements, so that your male and female slave may rest as you do.

Source 3 · Chazal
Verified

Talmud Bavli, Shabbat — Trapping and Automated Mechanisms

Shabbat 18a

The Gemara permits setting traps before Shabbat that catch animals on Shabbat itself, and discusses how a Jew may set a process in motion before Shabbat that produces melacha automatically, establishing the paradigm for pre-Shabbat activation of ongoing processes.

תָּנוּ רַבָּנַן: פּוֹתְקִין מַיִם לַגִּינָּה עֶרֶב שַׁבָּת עִם חֲשֵׁיכָה וּמִתְמַלֵּאת וְהוֹלֶכֶת כׇּל הַיּוֹם כּוּלּוֹ, וּמַנִּיחִין מוּגְמָר תַּחַת הַכֵּלִים עֶרֶב שַׁבָּת וּמִתְגַּמְּרִין וְהוֹלְכִין כׇּל הַיּוֹם כּוּלּוֹ, וּמַנִּיחִין גׇּפְרִית תַּחַת הַכֵּלִים עֶרֶב שַׁבָּת עִם חֲשֵׁיכָה וּמִתְגַּפְּרִין וְהוֹלְכִין כׇּל הַשַּׁבָּת כּוּלָּהּ, וּמַנִּיחִין קִילוֹר עַל גַּבֵּי הָעַיִן וְאִיסְפְּלָנִית עַל גַּבֵּי מַכָּה עֶרֶב שַׁבָּת עִם חֲשֵׁיכָה וּמִתְרַפֵּאת וְהוֹלֶכֶת כׇּל הַיּוֹם כּוּלּוֹ. אֲבָל אֵין נוֹתְנִין חִטִּין לְתוֹךְ הָרֵיחַיִם שֶׁל מַיִם אֶלָּא בִּכְדֵי שֶׁיִּטָּחֲנוּ מִבְּעוֹד יוֹם. מַאי טַעְמָא? אָמַר רַבָּה: מִפְּנֵי שֶׁמַּשְׁמַעַת קוֹל. אָמַר לֵיהּ רַב יוֹסֵף: וְלֵימָא מָר מִשּׁוּם שְׁבִיתַת כֵּלִים! דְּתַנְיָא: ״וּבְכֹל אֲשֶׁר אָמַרְתִּי אֲלֵיכֶם תִּשָּׁמֵרוּ״ — לְרַבּוֹת שְׁבִיתַת כֵּלִים. אֶלָּא אָמַר רַב יוֹסֵף: מִשּׁוּם שְׁבִיתַת כֵּלִים. וְהַשְׁתָּא דְּאָמְרַתְּ לְבֵית הִלֵּל אִית לְהוּ שְׁבִיתַת כֵּלִים דְּאוֹרָיְיתָא, גׇּפְרִית וּמוּגְמָר מַאי טַעְמָא שָׁרוּ? מִשּׁוּם דְּלָא קָעָבֵיד מַעֲשֶׂה. אוּנִּין שֶׁל פִּשְׁתָּן מַאי טַעְמָא שָׁרוּ — מִשּׁוּם דְּלָא עָבֵיד מַעֲשֶׂה, וּמֵינָח נַיְיחָא. מְצוּדַת חַיָּה וְעוֹף וְדָגִים דְּקָא עָבֵיד מַעֲשֶׂה, מַאי טַעְמָא שָׁרוּ? הָתָם נָמֵי בְּלֶחִי וְקוּקְרֵי דְּלָא קָעָבֵיד מַעֲשֶׂה.

The Sages taught in a Tosefta: One may open a canal that passes adjacent to a garden on Shabbat eve at nightfall, so that water will flow into a garden and the garden continuously fills with water all day long on Shabbat. Similarly, one may place incense, perfumed herbs placed on coals to produce a fragrance, on coals beneath the clothes on Shabbat eve and the clothes may be continuously perfumed all day long. And, similarly, one may place sulfur beneath the silver vessels on Shabbat eve at nightfall for the purpose of coloring the vessels, and they may be continuously exposed to sulfur all day long. And one may place an eye salve [kilor] on the eye and a bandage [ispelanit] smeared with cream on a wound on Shabbat eve at nightfall, and the wound may continuously heal all day long on Shabbat. However, one may not place wheat kernels into the water mill unless he does so in a way so that they will be ground while it is still day on Friday and not on Shabbat. The Gemara asks: What is the reason that the baraita prohibited a mill and permitted other prohibited labor? Rabba said: Because it makes noise and the public will hear the mill grinding on Shabbat. Although no prohibited labor is being performed, doing so displays contempt for Shabbat. Therefore, the Sages prohibited it. Rav Yosef said to Rabba: And let the Master say a better reason, due to the obligation to ensure the resting of utensils. Even the utensils of a Jewish person may not be used for prohibited labor on Shabbat. As it was taught in halakhic midrash, the Mekhilta: That which is stated: “And in all that I said to you, take heed” (Exodus 23:13), is an allusion to matters mentioned in the Oral Torah. It comes to include the resting of utensils on Shabbat. Rather, Rav Yosef said: The reason for the prohibition of the mill on Shabbat is due to the resting of utensils. Since the obligation of resting utensils on Shabbat was mentioned, the Gemara says: Now that you said that Beit Hillel also hold that resting utensils on Shabbat is required by Torah law, with regard to sulfur and incense on coals that are placed under silver vessels and clothes, respectively, what is the reason that the Sages permitted this on Shabbat? Isn’t that performed on Shabbat in utensils? The Gemara answers: Because the utensil itself does not perform an action when the incense or sulfur is burning. With regard to the bundles of flax, what is the reason that they permitted placing them in the oven on Shabbat eve at nightfall to dry, even though the oven is performing a prohibited labor on Shabbat? Because it does not perform an action; rather, on the contrary, it sits idle in its place and the prohibited labor occurs on its own. However, with regard to traps of an animal, and a bird, and a fish, which perform a bona fide action of trapping, what is the reason that they permitted spreading them on Shabbat eve at nightfall? The Gemara explains: There too, it is referring to a fish hook and nets [kokrei], which perform no action. They stand in place, and the fish comes to them and is trapped. Indeed, a trap that performs an action is prohibited.

Source 4 · Chazal
Verified

Mishnah Shabbat — Setting Processes in Motion

Mishnah Shabbat 1:8-1:10

The Mishnah enumerates actions forbidden before Shabbat because they cause melacha to occur on Shabbat (e.g., soaking wool in dye, setting flax to soak). This gives the classic legal framework of 'marit ayin' and 'shevitat keilim' that later authorities apply to any automated system.

אָמַר רַבָּן שִׁמְעוֹן בֶּן גַּמְלִיאֵל, נוֹהֲגִין הָיוּ בֵּית אַבָּא שֶׁהָיוּ נוֹתְנִין כְּלֵי לָבָן לְכוֹבֵס נָכְרִי שְׁלשָׁה יָמִים קֹדֶם לַשַּׁבָּת. וְשָׁוִין אֵלּוּ וָאֵלּוּ, שֶׁטּוֹעֲנִין קוֹרוֹת בֵּית הַבַּד וְעִגּוּלֵי הַגָּת: אֵין צוֹלִין בָּשָׂר, בָּצָל, וּבֵיצָה, אֶלָּא כְּדֵי שֶׁיִּצּוֹלוּ מִבְּעוֹד יוֹם. אֵין נוֹתְנִין פַּת לַתַּנּוּר עִם חֲשֵׁכָה, וְלֹא חֲרָרָה עַל גַּבֵּי גֶחָלִים, אֶלָּא כְּדֵי שֶׁיִּקְרְמוּ פָנֶיהָ מִבְּעוֹד יוֹם. רַבִּי אֱלִיעֶזֶר אוֹמֵר, כְּדֵי שֶׁיִּקְרֹם הַתַּחְתּוֹן שֶׁלָּהּ:

Rabban Shimon ben Gamliel said: The ancestral house of my father, the dynasty of Nesi’im from the house of Hillel, was accustomed to give its white clothes to a gentile launderer no fewer than three days before Shabbat. And, however, these, Beit Shammai, and those, Beit Hillel, agree that, ab initio, one may load the beam of the olive press on the olives on Shabbat eve while it is still day, so that the oil will continue to be squeezed out of the olives on Shabbat. So too, one may load the circular wine press to accelerate the process of producing wine from the grapes. This mishna enumerates actions that may only be performed on Shabbat eve if the prohibited labor will be totally or mostly completed while it is still day. One may only roast meat, an onion, or an egg if there remains sufficient time so that they could be roasted while it is still day. One may only place dough to bake into bread in the oven on Shabbat eve at nightfall, and may only place a cake on the coals, if there is time enough that the surface of this cake or bread will form a crust while it is still day. Rabbi Eliezer says: Enough time so that its bottom crust should harden, which takes less time.

Source 5 · Rishonim
Verified

Rambam, Mishneh Torah — Laws of Shabbat

Mishneh Torah, Sabbath 6:1-6:4

Rambam codifies the rules about setting processes in motion before Shabbat, ruling that one may not instruct a worker to begin labor that will continue into Shabbat, and discussing when such pre-Shabbat activation is permitted for automated or inanimate processes.

אָסוּר לוֹמַר לְנָכְרִי לַעֲשׂוֹת לָנוּ מְלָאכָה בְּשַׁבָּת אַף עַל פִּי שֶׁאֵינוֹ מְצֻוֶּה עַל הַשַּׁבָּת. וְאַף עַל פִּי שֶׁאָמַר לוֹ מִקֹּדֶם הַשַּׁבָּת. וְאַף עַל פִּי שֶׁאֵינוֹ צָרִיךְ לְאוֹתָהּ מְלָאכָה אֶלָּא לְאַחַר הַשַּׁבָּת. וְדָבָר זֶה אָסוּר מִדִּבְרֵי סוֹפְרִים כְּדֵי שֶׁלֹּא תִּהְיֶה שַׁבָּת קַלָּה בְּעֵינֵיהֶן וְיָבוֹאוּ לַעֲשׂוֹת בְּעַצְמָן: נָכְרִי שֶׁעָשָׂה מְלָאכָה מֵעַצְמוֹ בְּשַׁבָּת אִם בִּשְׁבִיל יִשְׂרָאֵל עָשָׂה אוֹתָהּ אָסוּר לֵהָנוֹת בְּאוֹתָהּ מְלָאכָה עַד מוֹצָאֵי שַׁבָּת וְיַמְתִּין בִּכְדֵי שֶׁתֵּעָשֶׂה. וְהוּא שֶׁלֹּא יְהֵא הַדָּבָר בְּפַרְהֶסְיָא עַד שֶׁיֵּדְעוּ בּוֹ רַבִּים שֶׁדָּבָר זֶה בִּשְׁבִיל פְּלוֹנִי הוּא נַעֲשָׂה בְּשַׁבָּת. וְאִם בִּשְׁבִיל עַצְמוֹ בִּלְבַד עָשָׂה מֻתָּר לֵהָנוֹת בָּהּ בְּשַׁבָּת:

It is forbidden for us to tell a gentile to perform work on the Sabbath on our behalf, although they are not commanded [to observe] the Sabbath. [This applies] even when the instructions were conveyed to them before the Sabbath and we do not require [the products of] their work until after the Sabbath. The above is forbidden as a Rabbinical prohibition to prevent the people from regarding the Sabbath lightly, lest they perform [forbidden] labor themselves. [The following rules apply] when a gentile performs a [forbidden] labor on the Sabbath on his own accord: If he performed it on behalf of a Jew, it is forbidden to benefit from that labor until one waits the amount of time necessary to perform the labor on Saturday night. [The latter leniency is granted] provided the matter is not public notice - i.e., everyone knows that a particular task is being performed for a person on the Sabbath. If [the gentile] performed [the labor] for his own sake alone, it is permitted to benefit from it on the Sabbath.

Source 6 · Rishonim
Verified

Tur — Orach Chayim, Hilchot Shabbat

Tur, Orach Chayim 252

The Tur surveys the early authorities on whether one may set a mill or water-wheel running before Shabbat so it operates autonomously on Shabbat, presenting the debate between the Rif and Rambam on the requirement for the tool itself to 'rest,' foundational for later analysis of automated systems.

מותר להתחיל במלאכה בע"ש סמוך לחשיכה אע"פ שאינו יכול לגומרה מבע"י והיא נגמרת מאיליה בשבת כגון לשרות דיו וסמנין במים והן נשרים כל השבת ולתת אונין של פשתן לתנור כדי שיתלבנו ולתת צמר לתוך היורה שאינה על גבי האש וטוחה בטיט אבל אם היתה על האש אסור שמא יחתה בגחלים או אפי' אינה על האש אם היא פתוחה אסור שמא יגיס בה בכף והמגיס בקדרה אפי' אינה על האש חייב משום מבשל ומותר לפרוס מצודות חיה ועוף ודגים והן ניצודים בשבת ומותר למכור לעכו"ם ולהטעינו סמוך לחשיכה רק שיצא מביתו מבעוד יום ומותר ליתן בגדיו לכובס עכו"ם ועורות לעבדן סמוך לחשיכה אם קצץ לו דמים אבל אם לא קצץ אסור אא"כ ביום ד' או ביום ה' ומותר לפתוח מים לגנה והם נמשכין והולכין בכל השבת ולהניח קילור עבה על העין אע"פ שאסור בשבת משום ממרח אבל קילור רך וצלול אפי' בשבת מותר להניחה ע"ג העין ומותר לתת מוגמר תחת הכלים והם מתגמרים מאליהן כל השבת ולתת שעורין בגיגית לשרותן ולתת גחלים בכלי והן דולקין והולכין כל השבת אע"פ שמשתמש בכלי דקי"ל שביתת כלים לאו דאורייתא ואפי' אם הכלי עושה מעשה בשבת וטוענין בקורות בית הבד ובית הגת מבע"י על זיתים וענבים שנתרסקו מבע"י וטוען עליהם להוציא מהן משקין והשמן והיין היוצא מהן מותר וכן בוסר ומלילות שנתרסקו מבע"י וטען עליהם מבע"י להוציא מהם משקין מותרין המשקין היוצאים מהם ודוקא שנידוכו היטב מע"ש ואינן מחוסרים אלא שחיקה אבל לא נידוכו היטב אלא שנתרסקו מעט אסורין המשקין היוצאין מהם אבל אסור לתת חיטין לתוך ריחיים אלא כדי שיטחנו מבעוד יום כיון דאוושא מילתא טפי איכא זילותא דשבתא:

Source 7 · Acharonim
Verified

Shulchan Arukh — Setting Machinery in Motion Before Shabbat

Shulchan Arukh, Orach Chayim 252:1-252:5

This section addresses setting a mill or other mechanical device in operation before Shabbat so that it continues working on Shabbat, distinguishing cases where this is permitted (no workers involved, no visible melacha) from cases where it is forbidden — directly analogous to leaving an AI process running.

מלאכות המותרים והאסורים להתחיל בע"ש כדי שיהיו נגמרים בשבת. ובו ז סעיפים: מותר להתחיל במלאכה בערב שבת סמוך לחשיכה אף על פי שאינו יכול לגומרה מבעוד יום והיא נגמרת מאליה בשבת כגון לשרות דיו וסממנין במים והם נשרים כל השבת ולתת אונין (פי' אגודות) של פשתן לתנור כדי שיתלבנו ולתת צמר לתוך היורה שאינה על האש והיא טוחה בטיט שאם היא על האש אסור שמא יחתה (פי' יגלה ויעיר הגחלים במחתה) ואפי' אינה על האש אם אינה טוחה בטיט אסור שמא יגיס בה בכף והמגיס בקדיר' אפי' אינה על האש חייב משום מבשל ומותר לפרוס מצודות חיה ועופות ודגים והם נצודים בשבת ומותר למכור לנכרי ולהטעינו סמוך לחשיכה ובלבד שיצא מפתח ביתו מבעוד יום: הגה ויש מתירין שיוציא עכו"ם בשבת אם ייחד לו העכו"ם מקום מבעוד יום בבית ישראל ויש להחמיר (מרדכי פ"ק דשבת) ועיין לקמן סי' שכ"ה: ומות' לפתוח מים לגנה והם נמשכים והולכים בכל השבת ולהניח קילור [סם של רפואה שנותנים על העין] עבה על העין אע"פ שאסור להניחו בשבת ולתת מוגמר תחת הכלים והם מתגמרים מאליהם כל השבת ואפי' מוגמר מונח בכלי דאין אדם מצווה על שביתת כלים ולתת שעורים בגיגית לשרותן וטוענין בקורות בית הבד והגת מבעוד יום על זיתים וענבים והשמן והיין היוצא מהן מותר [וע"ל סי' ש"כ סעיף ב'] וכן בוסר ומלילות שריסקן מבע"י מותרים המשקים היוצאים מהם ומותר לתת חטים לתוך רחיים של מים סמוך לחשיכ': הגה ולא חיישי' להשמעת קול שיאמרו רחיים של פלוני טוחנות בשבת ויש אוסרים ברחיים ובכל מקום שיש לחוש להשמעת קול (טור ותוס' והרא"ש פ"ג דשבת וסמ"ג וסה"ת והגהות מיי' פ"ז ותשובת מהרי"ו סימן ק"ל ואגור) והכי נהוג לכתחלה מיהו במקום פסידא יש להקל כמו שנתבאר לעיל ס"ס רמ"ד. ומותר להעמיד כלי משקולת שקורין זייגר מע"ש אע"פ שמשמיע קול להודיע השעות בשבת כי הכל יודעים שדרכן להעמידו מאתמול (טור אגור) ועיין לקמן סי' של"ח:

It is permitted to start an action on Friday near darkness even though the work cannot be completed on Friday and can only be finished on Shabbat. It is permitted to soak/ dissolve a ink or dye in water if it dissolves during Shabbat. It is permitted to put bundles of flax in the oven in order that they be whitened. It is permitted to put wool inside a large pot that is not on the fire, and it is covered with mud. But if the pot is on the fire it is forbidden, lest one stirs the coals. And even if it is not on the fire but it isn’t covered in mud, it is forbidden, lest he stir it with his hand. The one who stirs the pot even if it is not on the fire is liable because of cooking. It is permitted to spread out traps for animals, birds, and fish even though they will be trapped on Shabbat. It is permitted to sell to non-Jews and load it for him close to dark as long as he leaves the door of his house while it is still day. Rema: And there are those that permit it when the non-Jew leaves on Shabbat if the non-Jew designates a place on the next day in the house of a Jew. And there are those who are strict in this matter (Mordechai). See below Siman 325. It is permitted to open water to the garden and the water will continue and flow all of Shabbat. It is permitted to put קילור, thick collyrium (salve) on the eye even though it is forbidden to put it on on Shabbat. It is permitted to perfume one’s clothes when the process of perfuming is continued all of Shabbat, even if the perfume is placed in a vessel, since one is not commanded to rest his vessels. It is permitted to put barley in a tub to soak, and to load the beams of the olive press or wine press while it is still day upon the olives or the grapes, and the oil or wine that comes from them is permitted [And see Siman 320 Seif 2]. Similarly, if unripe grapes or ears are mashed while it is still day, it is permitted to drink that which comes forth from it. It is permitted to put wheat in a water mill near dark. Rema: And we do not worry to the sound of the voices of those who say 'the mill of this person is grinding on Shabbat'. There are those who forbid regarding mills and in any place that there is a worry about listening to the sound (Tur; Tosefos; Rosh; Sma"g; Hagahos Maimoni; Teshuvos Mahari"v; Agur) and this is our custom initially. However in a place of loss there are those who are lenient as as explained above at the end of Siman 244. One may place a keli of a weight called זייגר from Erev Shabbat even though he hears a voice announcing the hours of Shabbat, because everyone knows that it is their way to place it there from yesterday (Tur Agur) and see below Seif 338

Source 8 · Modern
Verified

Mishnah Berurah — Leaving Machines Running on Shabbat

Mishnah Berurah 252:1-252:20

The Mishnah Berurah analyzes the conditions under which mechanical processes started before Shabbat may continue on Shabbat, discussing the relevance of noise, public perception (marit ayin), and whether the machine is 'owned' by the Jew, all of which are relevant categories for AI systems.

(א) לשרות דיו וכו' - ובשבת אסור משום מגבל שמערב הדיו והמים יחד וי"א דאסור משום צובע אפ"ה כיון שמתחיל בזמן המותר בע"ש וממילא נגמר הפעולה בשבת שרי וכן בכל הני דקחשיב יש בהן איסור דאורייתא כשעושה אותם בשבת אפ"ה כיון שמתחיל בע"ש שרי: