In almost every case armor has higher value than life points with a warrior, so always armor up before attacking would be the wrong thing.
You see a lot of top players attacking and armor up after that. This is because of cards like shield slam, alextrasa and heal stuff.
I don't think the AI has some kind of suicide mechanism and the attack first was a missplay in this case, which should be fixed with an aditional check to only perform attacks if this doesn't kill you.
The interesting information is what AI did you use and did you run out of time when these actions were performed?
There is some kind of security mechanism when calculation takes longer than available turn time, which would perform any action (even if it's not the best) rather than doing nothing.
If your missplay happened when running out of time you need to reduce your AI parameters, if not we need the additional check.
Please report back.