18:25

חָלִלָה לְּךָ מֵעֲשֹׂת כַּדָּבָר הַזֶּה לְהָמִית צַדִּיק עִם־רָשָׁע וְהָיָה כַצַּדִּיק כָּרָשָׁע חָלִלָה לָּךְ הֲשֹׁפֵט כָּל־הָאָרֶץ לֹא יַעֲשֶׂה מִשְׁפָּט׃

Far be it from You to do such a thing, to put the righteous to death with the wicked, so that the righteous should be like the wicked. Far be it from You! Shall the Judge of all the earth not do justice?"

Bereshit 18:25

חָלִלָה לְּךָ מֵעֲשֹׂת

Bereshit / Genesis 18:25 · Drash

Bereshit 18:25

חָלִלָה לְּךָ מֵעֲשֹׂת כַּדָּבָר הַזֶּה לְהָמִית צַדִּיק עִם־רָשָׁע וְהָיָה כַצַּדִּיק כָּרָשָׁע חָלִלָה לָּךְ הֲשֹׁפֵט כָּל־הָאָרֶץ לֹא יַעֲשֶׂה מִשְׁפָּט׃

Far be it from You to do such a thing, to put the righteous to death with the wicked, so that the righteous should be like the wicked. Far be it from You! Shall the Judge of all the earth not do justice?"

Drash דְּרָשׁ

The wise woman of Avel

Avraham bargains: fifty, forty-five, forty, thirty, twenty, ten. The midrash finds in Scripture one more person who saved a city by just such bargaining.

Tanchuma Buber: Avraham foresaw that one woman, Serach daughter of Asher, would save a whole city, Avel, from Yoav's army. She bargained with the townspeople from a hundred down to one, and they gave up one rebel. If Yoav spared a city for the head of one guilty man, will the Merciful One destroy them all? Tanchuma: Avraham went down from fifty to ten, for ten have the power to cancel the punishment.

How Midrash Tanchuma (Buber) and Midrash Tanchuma explain it

Midrash Tanchuma (Buber)

Another explanation: "far be it from You". Avraham said: Master of the world, I foresee by the holy spirit that one woman will one day save a whole city. And am I not worthy to save these five cities? Who is this woman? It is Serach daughter of Asher, at the time when Sheva son of Bichri rebelled against David and came to Avel, as it says: "and they came and besieged him in Avel" and so on, "and all the people who were with Yoav battered the wall to throw it down" (Shmuel II / II Samuel 20:15). When Serach sensed this, she began to cry out: call Yoav to me. When Yoav came, she said: "Are you Yoav?" And he said: "I am" (20:17). You are the sage whom Scripture praises: "who sat in the assembly, a wise man" (23:8). Have you not read in the Torah: "when you come near a city" and so on (Devarim / Deuteronomy 20:10)? You should not have done this. "They used to say in former times: let them ask in Avel" (Shmuel II / II Samuel 20:18), and "call to it for peace" (Devarim / Deuteronomy 20:10). "Why will you swallow up the inheritance of the Eternal?" (Shmuel II / II Samuel 20:19). Hearing this, he was afraid, and Yoav said: there is a need here, as it says: "and Yoav answered and said: far be it, far be it from me" and so on (20:20). And You, Merciful One, would it please You to destroy them? "Far be it from You to do such a thing." And what did Yoav say to her? "That is not the matter, but a man of Mount Ephraim, Sheva son of Bichri by name" (20:21), a cripple, an idol worshipper, called there "a worthless man, and his name was Sheva son of Bichri" (20:1). She said to him: "I am of the peaceful and faithful of Israel" (20:19), I am the one who completed the number of Israel, as it says: "and the name of the daughter of Asher was Serach" (Bamidbar / Numbers 26:46). Stay where you are, and I will make peace, as it says: "behold, his head shall be thrown to you over the wall" (Shmuel II / II Samuel 20:21). So sure she was that she would give Yoav his head. But see what she did: "and the woman went to all the people in her wisdom" (20:22). What is "in her wisdom"? She said to them: know that Yoav and all Israel stand outside to kill us, our sons and our daughters. They said to her: why? She said to them: he wants to take a hundred men and go. They said to her: let him take two hundred. She said to them: he wants only fifty men. They said to her: let him take a hundred. She said to them: he wants only five. They said to her: let him take ten. She said to them: he wants only one, Sheva son of Bichri by name. At once, hearing this, they went and cut off his head, as it says: "and they cut off the head of Sheva son of Bichri" (20:22). See the wisdom of this woman: just as Avraham came with wisdom before the Holy One, blessed is He, from fifty to forty, from forty to thirty, from thirty to twenty and from twenty to ten, so did she. "And the woman went to all the people in her wisdom." Shlomo praises her: "wisdom is better than weapons of war" (Kohelet / Ecclesiastes 9:18): Serach's wisdom was better than the weapons of war in Yoav's hands. As soon as Yoav received the head of Sheva son of Bichri, he went back at once and did not touch the city. Avraham said before the Holy One, blessed is He: Master of the world, if Yoav, receiving the head of one guilty man, left the whole city, will You, the Merciful One, destroy them all? "Far be it from You!"

Midrash Tanchuma

It does not say here "to do this thing", but "such a thing" (כַּדָּבָר): neither this nor anything like it. "Shall the Judge of all the earth not do justice? Perhaps there are fifty" and so on. "And the Eternal said: if I find in Sedom." He began at fifty and went down to ten, for ten have the power to cancel the punishment. When they were not found, "and the Eternal went His way when He had finished" and so on. What is written after this? "And the two angels came to Sedom."

Takeaway

Serach daughter of Asher is named both among those who went down to Egypt (46:17) and in the census in the wilderness (Bamidbar / Numbers 26:46). The midrash sees in her a woman who lived on until David's days.
The story of the wise woman of Avel is in Shmuel II / II Samuel 20:14–22. In Scripture itself her name is not given.
Rashi (18:32) explains why Avraham did not ask for fewer than ten: in the days of the Flood there were eight righteous, Noach and his family, and that was not enough.