Never abandon the possibility of attack. Attack even from a position of inferiority, to disrupt the enemy's plans. This often results in improving one's own position.
So the principles of warfare are: Do not depend on the enemy not coming, but depend on our readiness against him. Do not depend on the enemy not attacking, but depend on our position that cannot be attacked.