וְאַתָּ֣ה יְ֭הוָה מָגֵ֣ן בַּעֲדִ֑י כְּ֝בוֹדִ֗י וּמֵרִ֥ים רֹאשִֽׁי׃
אָבער דו גאָט ביסט אַ שילד פֿאַר מיר, מײַן כּבֿוד און דער דערהײבער פֿון מײַן קאָפּ.
Ibn Ezra
But You, [Ad-nai], a shield (מָגֵן - magen): [This word magen] is a noun (shem) and not a participle (po'el). For [if it were an active participle meaning "shielding"] it would properly be in the pattern of [a form like] Hineni mesev ("Behold, I am surrounding/shielding").
Radak
But Thou, Lord, art a shield about me: – the opposite of their words who are saying that there is no hope for me in this world, nor in the world to come. Thus they are thinking and saying; but Thou wilt deal with me in the very opposite way and wilt be a shield about me to deliver me in this world and a shield about me in the world to come.
Ibn Ezra
And the meaning of shield is that he [David] did not [need to] enter into battle [because God protected him].