You observe it is by what he does that a man is justified, not simply by what he believes.
We hold a man is justified by faith apart from deeds of the Law altogether.
and the scripture was fulfilled: Abraham believed God, and this was counted to him as righteousness — he was called God's friend.
So too with Rahab the harlot. Was she not justified by what she did, when she entertained the scouts and got them away by a different road?