The structure of the psalm is relatively simple:
A prayer based on the psalmist’s integrity before the Lord (Psalm 17:1–5)
Prayer for divine vindication (Psalm 17:1–2)
Basis of prayer: the psalmist’s integrity (Psalm 17:3–5)
A prayer based on the enemy’s attack (Psalm 17:6–12)
Prayer for protection from evil (Psalm 17:6–8)
Basis of prayer: the enemy’s viciousness Psalm 17:9–12
A prayer for rescue and a confidence for a glorious future (Psalm 17:13–15)
1 Hear a just cause, O LORD; attend to my cry! Give ear to my prayer from lips free of deceit!