Likewise also was not Rahab the harlot
(See Gill on Hebrews 11:31) justified by works; this woman was an instance of the grace of God in calling the chief of sinners, and was a true believer; and what she did, she did in faith, ( Hebrews 11:31 ) and her faith was shown by her works to be true and genuine; and it was manifest that she was a justified person. This instance is produced with the other, to show, that wherever there is true faith, whether in Jew or Gentile, in man or woman, in greater or lesser believers, or in such who have been greater or lesser sinners, there will be good works; and therefore that person is a vain man that talks and boasts of his faith, and depends upon it, and slights and rejects good works as unnecessary to be done.
When she had received the messengers:
the spies that Joshua sent, into her house, with peace and safety: