And the scripture came true that said, “Abraham believed God, and because of his faith God accepted him as righteous.” And so Abraham was called God's friend.
It was the same with the prostitute Rahab. She was put right with God through her actions, by welcoming the Israelite spies and helping them to escape by a different road.