She is going to remain guarded if you enter and leave her world without a warning, if you switch between answering her texts within minutes and within months, if you only stay for a temporary amount of time before fading away again.
If you are not a constant presence in her life, if she cannot tell what to expect from you, then she is going to keep you at a distance. She is going to censor what secrets she passes onto you. She is going to make sure you never learn anything too deep about her, anything that could end in her heartbreak.
She is going to remain guarded if you invalidate her feelings. She is going to clam up if you make fun of her when she tells you about her passions, her fears, or her baggage from childhood. She is not going to let you into her bubble if you make her feel uncomfortable or embarrassed. She is never going to trust you if you act superior to her, if you belittle her, if you come across like you know everything and she knows nothing.
She is going to remain guarded if you forget to show your love for her. She needs reassurance you care. She is an overthinker, a worrier. If you stop texting her first, if you cancel plans at the last moment, if you stop complimenting her and going out of your way for her, then she is going to assume you have grown bored of her. She is going to slowly inch herself away from you to avoid becoming attached because she would rather break her own heart than wait for you to break it for her.
She is going to remain guarded if you come across like a player, if you flirt with other girls in front of her, if you make it unclear whether you are planning on playing the field or settling down with her. She does not want to be the other woman or the backup plan. She does not want to risk her heart on the wrong person. If you are dividing your time and attention between her and a dozen other girls, then she is never going to make room for you inside of her world.
She is going to remain guarded if you place too much pressure on her. If you get angry with her for taking so long to open up to you, if you act like her vulnerability is a bother to you, then she is going to shut down. She is going to hold out for someone else who does not consider her broken, someone who is willing to wait until she is ready to take a risk.
Unless you place continuous effort into your relationship with her, unless you prove to her how much you care, unless you make a commitment to her and only her, she is always going to remain guarded. She is not willing to let anyone in. The person has to prove their worth first.