God convicts a sinner before they believe, they respond with belief in Christ, that He is God and can deliver them eternally from hell, confessing their sin to Him.
You are right that salvation isn't dependent on the words said in the sinners prayer, and that it is all by grace.
But I still...