Hear a just cause, O LORD; attend to my cry! Give ear to my prayer from lips free of deceit!  From your presence let my vindication come! Let your eyes behold the right!  You have tried my heart, you have visited me by night, you have tested me, and you will find nothing; I have purposed that my mouth will not transgress.  With regard to the works of man, by the word of your lips I have avoided the ways of the violent.  My steps have held fast to your paths; my feet have not slipped.  I call upon you, for you will answer me, O God; incline your ear to me; hear my words.  Wondrously show your steadfast love, O Savior of those who seek refuge from their adversaries at your right hand.  Keep me as the apple of your eye; hide me in the shadow of your wings,  from the wicked who do me violence, my deadly enemies who surround me.  They close their hearts to pity; with their mouths they speak arrogantly.  They have now surrounded our steps; they set their eyes to cast us to the ground.  He is like a lion eager to tear, as a young lion lurking in ambush.  Arise, O LORD! Confront him, subdue him! Deliver my soul from the wicked by your sword,  from men by your hand, O LORD, from men of the world whose portion is in this life. You fill their womb with treasure; they are satisfied with children, and they leave their abundance to their infants.  As for me, I shall behold your face in righteousness; when I awake, I shall be satisfied with your likeness. (Psalm 17 ESV)
I Am Innocent!
David now transitions from asking God to vindicate him in his integrity to the grounding for such a request. David declares his innocence before the Lord with extremely precise language.
1. David first shows how God has immediate and entire access to his heart and mind. Look at the bolded words above: tried, visited, tested. He is unafraid for God to look deeply into his life. Why? Look at the end of verse 3: YOU WILL FIND NOTHING! Isn’t that amazing? Have you ever been able to stand before God wide open and unafraid that when he looks into your heart (an action that he doesn’t need your permission for), he will find nothing objectionable? What a statement.
2. Now David goes into detail about his commitment to follow God, to obey God, to keep his life free from evil. Look at the details of his life in the strength of his words:
I have purposed that my mouth will not transgress. His speech is the first gate he has tied up and locked. All of us stumble in what we say (James 3:2), especially in the areas where we feel we have been unjustly accused.
I have avoided the ways of the violent. He refuses to be influenced by the evil around him (Proverbs 13:20). He refuses to enter into gossip, slander or revenge-seeking. He did that by the words of the Lord (17:4), which are clear in their admonition to avoid the wicked as they tear the heart of the righteous from the Lord.
My steps have held fast; my feet have not slipped. He states twice that he is committed to the way of the Lord. Remember that the thing that Hebrew writers repeat is the important thing. He repeats this because in his heart, he is committed to God.
Hope in the Psalms
God knows your heart. He already knows you. You physically can’t hide from God. You can’t hide from the gaze of the almighty. God knows your heart, so go ahead and confess the sin that he already knows about. Go ahead and ask him to help you put sin to death. Go ahead and tell him how much you long to pray this kind of prayer and need the Holy Spirit to help you.