Rabbi Judah bar Simon said (regarding the same verse): "I have made a covenant with you and with Israel" (Exodus 34:27) — by means of writing and by means of mouth, as it is said, "for by the mouth of these words" (Exodus 34:27). If you uphold what is in writing in writing, and what is oral by mouth, then "I have made a covenant with you." But if you alter what is oral into writing, and what is written into oral form, then "I have not made a covenant with you." Rabbi Judah ha-Levi son of Rabbi Shalom said: Moses requested that the Mishnah too should be in writing. But the Holy One, blessed be He, foresaw that the nations of the world were destined to translate the Torah and read it in Greek, and they would say, "We too are Israel." The Holy One, blessed be He, said to him: "Were I to write for you the greater part of My Torah" (Hosea 8:12) — and if so, "they would be reckoned as a strange thing" (Hosea 8:12). And why all this? Rather, because the Mishnah is the mystery of the Holy One, blessed be He, and the Holy One, blessed be He, reveals His mystery only to the righteous, as it is said, "The secret of the Lord is for those who fear Him" (Psalms 25:14). And so you find that even at the time when the Holy One, blessed be He, was angry at Sodom on account of their evil deeds, and the Holy One, blessed be He, sought to overturn Sodom, the Holy One, blessed be He, did not seal their sentence until He took counsel with Abraham. From where? From what we have read in this matter: "And the Lord said: Shall I hide from Abraham what I am doing?" (Genesis 18:17).
Why the Mishnah Stayed Oral and God Consulted Abraham Over Sodom
Midrash Tanchuma Buber, Vayera 6:2
אמר ר' יהודה בר סימון כרתי אתך ברית ואת ישראל (שם), על ידי כתב ועל ידי פה, כי על פי הדברים האלה, אם קיימתה מה שבכתב בכתב, ומה שבעל פה על פה, כרתי אתך, ואת שניתה מה שבעל פה בכתב, ומה שבכתב בעל פה, לא כרתי אתך. אמר ר' יהודה הלוי ב"ר שלום בקש משה שתהא אף המשנה בכתב, וצפה הקב"ה על שעתידין אומות העולם לתרגם את התורה ולקרות אותה יונית, והן אומרין אף אנו ישראל, א"ל הקב"ה אכתוב לך רובי תורתי (הושע ח יב) ואם כן כמו זר נחשבו (שם), וכל כך למה, אלא שהמשנה מסטורן שלו של הקב"ה, ואין הקב"ה מגלה מסטורן שלו אלא לצדיקים, שנאמר סוד ה' ליראיו (תהלים כה יד). וכן אתה מוצא אפילו בשעה שהקב"ה כעס על סדום מפני מעשיהם הרעים, ובקש הקב"ה להפוך את סדום, לא חתם הקב"ה גזר דינם עד שנמלך באברהם, (שנאמר) [מנין ממה שקרינו בענין] וה' אמר המכסה אני מאברהם.