(17) Now the Lord had said: ‘Shall I hide from Abraham what I am about to do? (18) since Abraham will become a big and powerful nation, and all the nations of the earth will be blessed through him. (19) For I have known him for the purpose that he will command his children and his household after him, that they may keep the way of the Lord, to do righteousness and justice; and for the purpose of the Lord bringing upon Abraham what He spoke about him.’ (20) And the Lord said: ‘The cry of Sodom and Gomorrah, how great it is, And there sin, how heavy it is. (21) I will go down now, and see whether they have done altogether according to the cry that has come to me; and if not, I will know.’
Rashi on 18:17 "What I am about to do?" in Sodom. It would be improper for Me to do this thing without Abraham's knowledge. I gave him the land. I called him Abraham, the father of a multitude of nations. Now, can I destroy the sons without informing the father? (from Genesis Rabbah)
Etz Hayim on 18:19 This is a verse of supreme importance in the Book of Genesis. God promises to have a special relationship with Abraham and his children, so that they will be inspired to do what is right and just. The negotiations over the fate of Sodom is one result of that relationship and the commitment to what is right and just. "The descendants of Abraham are characterized by three traits: a capacity for kindness, a sense of honor, and a commitment to do what is right." (Talmud)
Rashi on 18:21 "I will go down now..." This teaches judges that they should not decide capital punishment cases unless they see it (for example, they must go to the site and investigate the matter.
(22) And the men turned from there, and went toward Sodom; but Abraham stood before the LORD. (23) And Abraham drew near, and said: ‘Will You annihilate the virtuous with the wicked? (24) Maybe there are fifty virtuous people within the city. Will You also annihilate, and not sustain the place for the fifty virtuous that are in it? (25) Far be it from You to do a thing like this, to kill the virtuous with the wicked, and it will be the same for the virtuous and the wicked - far be it from you; will the judge of all the earth not do justly?’English
Rashi on 18:25 "Far be it from You" Chalillah. This is unfitting for you. They will say "So is His craft. He inundates everyone, virtuous and wicked." So you did to the Generation of the flood....
Richard Elliot Freedman on 18:25 "Far be it from you to do a thing like this....." This is the first time in the Bible that a human questions (challenges) a divine decision. Moses will take this even further on at least three occasions.
Etz Hayim on 18:25 "will the judge of all the earth not do justly?" Abraham's challenge to God is rooted in the audacious claim that even God is subject to moral standards divinely decreed to humans. If God is to be obeyed when commanding moral behavior, God must exemplify that moral behavior. One commentary (Mishkekh Hokhma) takes this not as a challenge but as a demand "Do not exact strict justice on these people! You, Lord, know how weak human nature is. You know how hard it is to be a good person in Sodom. Treat them more leniently than strict justice would require."
Rashi on 18:32 "Maybe ten will be found there" For fewer than ten, Abraham did not ask. He said, "in the generation of the floor, there were eight, Noah and his sons and their wives, but they did not save the generation."
Etz Hayim on 18:32 "Maybe ten will be found there" Why does Abraham stop at ten? Perhaps it takes a critical mass to generate and alternative way of living. The number ten may be psychologically related to the stipulation of ten individuals for a minyan, the quorum for public worship, this is the point at which an assembly of individuals becomes a group, a congregation.
Truly, the LORD is waiting to show you grace, Truly, He will arise to pardon you. For the LORD is a God of justice; Happy are all who wait for Him. (Isiah 30:18)
Apropos that verse, Abaye said: The world has no fewer than thirty-six righteous people in each generation who greet the Divine Presence, as it is stated: “Happy are all they who wait for Him [lo]” (Isaiah 30:18). The numerical value of lo, spelled lamed vav, is thirty-six....


