In the long conversation of Act 3 Scene 4, Hamlet has his grand opportunity to tell his mother exactly what he thinks about her marriage to Claudius and how he thinks she should behave. He expressly tells his mother that Claudius is nowhere near the man that his father, King Hamlet, was and that Gertrude needs to free herself from this sinful marriage as soon as possible. He tells her
Confess yourself to heaven;
Repent what's past; avoid what is to come;
And do not spread the compost on the weeds
To make them ranker. . .
Assume a virtue, if you have it not. . .
And that shall lend a kind of easiness
To the next abstinence;
The Queen understands that Hamlet wants her to stay out of Claudius's bed, and she seems to want to do what is asked of her, but she doesn't know how she is going to do that! She even says, "What shall I do?" She is so used to being with a man and she doesn't know what she is going to say to avoid Claudius. Hamlet gives her more advice. Then he also tells her
That I essentially am not in madness,
But mad in craft.
Hamlet doesn't want her to reveal to Claudius any of what he has said to her this evening, about her relationship or about his madness. She promises to keep his secrets saying
By thou assured, if words be made of breath,
And breath of life, I have no life to breathe
What thou hast said to me.
We have proof right away in Act 4 scene 1 that she is keeping her promises to Hamlet. When Claudius asks how her conversation went with Hamlet she says nothing about Hamlet's wanting her to stay away from him, and she claims that in a fit of madness, his "brainish apprehension," Hamlet has killed Polonius. She knows he is not crazy, but keeps up the ruse to Claudius. She furthers that story when she reports that "he weeps for what is done." That is absolutely not true, but it makes Hamlet look less guilty and less dangerous than if she reported his lack of remorse over what had happened. It would seems that Gertrude is, in fact, keeping her promises to Hamlet and reforming her ways.