See Joel Baden’s NIHB 2026 lecture on Genesis 18:23-33 that is the passage where Abraham seems to haggle with God to determine exactly how many righteous people would have to be in Sodom before God would refrain from destroying the city.
See the PDF in the Sodom and Gomorrah directory in dropbox of “Shall Not the Judge of the Earth Deal Justly?”: Accountability, Compassion, and Judicial Authority in the Biblical Story of Sodom and Gomorrah; Author: Timothy D. Lytton; Source: Journal of Law and Religion , 2002 – 2003, Vol. 18, No. 1 (2002 – 2003), pp. 31-55; Published by: Cambridge University Press, Stable URL: https://www.jstor.org/stable/1051493