Genesis 18:17

And the LORD said, Shall I hide from Abraham that thing which I do;

The question was asked after the heavenly visitors, who had appeared only as human travelers, had eaten the refreshments Abraham provided and then risen and looked toward Sodom, while Abraham went with them to show them the best route for their journey. In that setting the Lord decided not to hide from Abraham what He was about to do, but to reveal His purpose to destroy and judge Sodom for its great wickedness. That city was a great city corrupted by licentiousness, and the disclosure was of its coming destruction and judgment.

The revelation was given in view of Abraham's promised role as the father of a great nation through whom all nations would be blessed. It was given because Abraham had trained his children properly and would command his children and his household after him to keep the way of the Lord to do justice and judgment, so that the Lord might bring upon Abraham what He had spoken concerning him. God knew Abraham as one whose mind He had molded as a model of politeness and courtesy and benevolence.

By taking Abraham into His counsel God honored Abraham because Abraham honored God. The disclosure made clear that God would examine the city's conduct before judgment, and if its people had not passed beyond the limits of divine mercy they would still be given time to repent. The language of God going down to see and know expresses this examination in human terms so that the justice of His dealings would be understood, though God already knew Sodom's guilt. Destructive judgment of this kind is no pleasure to Him, but a strange work for the God of infinite love.

In response Abraham pleaded for the city to be spared for the sake of its honest inhabitants, but only ten such could be found, and Sodom was destroyed. Through revealing His intended action to Abraham, God was also made known to the inhabitants of Sodom.