"Now Abimelech had not come near her" (Genesis 20:4). He said before Him: Master of the World, all are equal before You. Job said, "It is all one... He destroys the blameless and the wicked" (Job 9:22). "Will You slay even a righteous nation?" (Genesis 20:4). The Sodomites — before they sinned before You, You destroyed them; and I, who have not sinned before You, will You slay me? "Will You slay even the righteous?" Did he not himself say to me, "She is my sister" (Genesis 20:5)? And I did not believe it until I asked her, and she too said, "He is my brother" (Genesis 20:5); and I did not believe it until I asked her donkey-drivers and her camel-drivers, and they said, "She is his sister." "And God said to him in the dream: I also know that you did this in the innocence of your heart" (Genesis 20:6). The Holy One, blessed be He, said: In one matter you are meritorious, and in one matter you lied. The innocence of your heart is here, but the cleanness of your hands is not here. Know that it is so: "the cleanness of your hands" is not written here, but rather "in the innocence of your heart." The Holy One, blessed be He, said to him: You sought to sin against Me, but "I also withheld you from sinning against Me" (Genesis 20:6). They said concerning this Abimelech that he was proper, in that he did not touch her. Our Rabbis said: Happy is he, for thus it is written, "Now Abimelech had not come near her" (Genesis 20:4). Abimelech said: Master of the World, behold, You are appeased that I did not touch her; who will appease her husband that I did not touch her? The Holy One, blessed be He, said to him: What does the appeasing matter to you? He knows. Why? Because he is a prophet, as it is said, "And now restore the man's wife, for he is a prophet" (Genesis 20:7). If he prays for you, you shall live; and if you do not restore her, "know that you shall surely die" (Genesis 20:7). Happy are the righteous, for thus the Holy One, blessed be He, praises them.
Abimelech Pleads His Innocent Heart Before God Over Sarah
Midrash Tanchuma Buber, Vayera 25:3
ואבימלך לא קרב (שם שם ד), אמר לפניו רבונו של עולם הכל שוין לפניך, אמר איוב אחת היא וגו' תם ורשע הוא מכלה (איוב ט כב). הגוי גם צדיק תהרג (בראשית שם), סדומים עד שלא חטאו לפניך אבדת אותם, ואני שלא חטאתי לפניך תהרגני, גם צדיק תהרג, הלא הוא אמר לי אחותי היא (שם שם ה), ולא האמנתי עד שאלתי אותה, והיא גם היא אמרה אחי הוא (שם), ולא האמנתי עד ששאלתי לחמרים ולגמלים שלה ואמרו אחותי היא, ויאמר אליו האלהים בחלום גם אנכי ידעי כי בתם לבבך עשית זאת (שם), אמר הקב"ה באחת זכית ושקרת באחת, תום לבבך יש כאן, נקיון כפיך אין כאן, תדע שכן הוא, נקיון כפיך אין כתיב כאן, אלא בתך לבבך, אמר לו הקב"ה בקשת לחטוא לי, אלא ואחשוך גם אנכי אותך מחטוא לי (שם). אמרו עליו על אבימלך שהיה כשר שלא נגע בה, אמרו רבותינו אשריו שכך כתיב ואבימלך לא קרב אליה (שם), אמר אבימלך רבונו של עולם הרי אתה מתפייס שלא נגעתי בה, מי מפייס את בעלה שלא נגעתי בה, א"ל הקב"ה (אי) [מה] איכפת לך מפיוס, יודע הוא, למה שנביא הוא, שנאמר ועתה השב אשת האיש כי נביא הוא (שם שם ח), אם יתפלל עליך תחיה, ואם אינך משיב דע כי מות תמות (שם), אשריהם הצדיקים שכך הקב"ה משבחן.