Yesterday, in a game against Gunar, the AI stole two resource piles and opened a Dungeon while the guard was out of position.
I can't see clearly from the image, but it looks like the Dungeon and the out-of-position guard are not on adjacent cells (either directly or diagonally).
Also, I think it's unnecessary to say that the guard is only an obstacle if it's strong enough, which the AI, of course, calculates.