You're only under grace if you're continually walking in the Spirit. If you stop walking in the Spirit you're under the law and, therefore, not under grace. So you have to actually do something. Grace isn't unmerited or undeserved favor. It's quid pro quo and depends on your choices from day to day and sometimes from second to second.
Galatians 5
16So I say, walk by the Spirit, and you will not gratify the desires of the flesh.
17For the flesh desires what is contrary to the Spirit, and the Spirit what is contrary to the flesh. They are in conflict with each other, so that you are not to do whatever you want.
18But if you are led by the Spirit, you are not under the law.
So, like I said, there are things you have to do to stay in that grace. Obedience and a striving to be righteous are required. Here's another example of falling from grace due to not being led by the Spirit.
Hebrews 12
14Make every effort to live in peace with everyone and to be holy; without holiness no one will see the Lord. 15See to it that no one falls short of the grace of God and that no bitter root grows up to cause trouble and defile many. 16See that
no one is sexually immoral, or is godless like Esau, who for a single meal sold his inheritance rights as the oldest son.
17Afterward, as you know, when he wanted to inherit this blessing, he was rejected. Even though he sought the blessing with tears, he could not change what he had done.