"For it is by grace you have been saved, through faith—and this is not from yourselves, it is the gift of God - not by works, so that no one can boast. 10 For we are God’s handiwork, created in Christ Jesus to do good works, which God prepared in advance for us to do." - Ephesians 2:8-9
Here is the relationship between faith, works, rewards, and salvation:
I Corinthians 3:11-15:
"For no one can lay any foundation other than the one already laid, which is Jesus Christ. If any man builds on this foundation using gold, silver, costly stones, wood, hay, or straw, his work will be shown for what it is, because the day will bring it to light. It will be revealed with fire, and the fire will test the quality of each man's work. If what he has built survives, he will receive his reward. If it is burned up, he will suffer loss; he himself will be saved, but only as one escaping through the flames."
The Full Life Study Bible provides these remarks on the above passage:
"HE WILL SUFFER LOSS: There is a future judgment for believers (I John 4:17) as to the degree of their faithfulness to God and the grace given to them during this life on earth (v.10; 4:2-5; 2 Cor.5:10). In that judgment there is the possibility that a believer, although receiving salvation, may experience great loss (Greek zemloo, meaning 'to suffer loss or damage'). The careless believer is in danger of suffering loss or damage in the following ways: (1) a feeling of shame at Christ's coming (2 Ti. 2:15; 1 John 2:28); (2) loss of his or her life's work for God (vv. 12-15); (3) loss of glory and honor before God (cf. Romans 2:7); (4) loss of opportunity for service and authority in heaven (Mt. 25:14-30); (5) a low position in heaven (Mt. 25:14-30); (6) loss of rewards (cf. v. 14-15); and (7) repayment for the wrong done to others (Col. 3:24-25).
AS ONE ESCAPING THROUGH THE FLAMES: 'Escaping through the flames' is probably an expression meaning 'barely saved.' God will evaluate the quality of life, influence, teaching, and work in the church of each person. If his work is judged unworthy, he will lose his (heavenly) reward, yet he himself will be saved." ( Full Life 1755-56)
Godly works do not result in justification / salvation, but are directed towards the edification of God, and the welfare and salvation of others, and eventually result in some type of heavenly rewards. For those who may have been saved just prior to death (the thief on the cross), there may not be any works to reward, yet their salvation is yet assured. It is my contention that once a person is regenerated, eventually, if they live long enough, there should be some sort of Godly works in their life (James chapter 2).
Cheers...