Joshua 2:1-21 tells the story of Rahab, who God used to help his people. The story of Rahab not only highlights her imperfections, but also her faith and heroism.
It is not our past failures / imperfections or successes that define us; it is God who defines us.
James 2:25-26 In the same way, was not even Rahab the prostitute considered righteous for what she did when she gave lodging to the spies and sent them off in a different direction? As the body without the spirit is dead, so faith without deeds is dead.