Genesis 20:6

Amplified Bible (AMP)
Then God said to him in the dream, “Yes, I know you did this in the integrity of your heart, for it was I who kept you back and spared you from sinning against Me; therefore I did not give you an opportunity to touch her.

Read Genesis 20:6 in other translations