It is obvious that the on-duty security guards miserably failed in detecting the terrorists' entry and taking appropriate counter measures. But the need for that action means that all other security measures, which were supposed to detect the intruding terrorists and alarm the concerned staff, had failed (or were rendered nonfunctional) in detecting/stopping the intruders.
I cannot believe that PAF is not using the latest technology (such as motion detectors, including the optical ones, and other sensors) to detect and counter any intrusions (and monitoring the movements just outside the boundary wall). But the way the terrorists used a ladder, cut the barbed wire, and then jump in to create a havoc at the base indicates that the terrorists and their handlers were able to defeat all those sensors. That leaves only two possibilities; the inside job, and/or computer hacking. The investigations would find out if any inside staff was assisting the terrorists or their handlers by providing the sensitive information about the base. On the other hand, it is quite possible that PAF network/system has been compromised and the terrorists and their handlers exploited the inner information in planning and executing a successful terrorist attack.
That is only one part of the whole problem that we are facing. The other equally important aspect is the availability of terrorists that are willing to die or explode themselves to attack fellow Muslims. It is quite possible that all or some of these terrorists were Afghanis but we will find out that only after the investigations are completed. Nevertheless, Pakistan needs to resolve this issue. We have already found Afghanis involved in numerous terrorist attacks in Pakistan in recent past. We need to deport illegal Afghanis from Pakistan. Not one country in world allows undocumented illegal immigrants. Pakistan must not be an exception in that respect. Such illegal people can easily be exploited to do any dirty job, including terrorism, by the enemy powers. GoP should make it compulsory for Pakistani citizens to report any Afghani they see in their cities, localities, and streets. Failure in doing that should be legally punishable. Any undocumented Afghani women and children such found should be deported and men should be placed in a camp for further investigations to check if they were involved in illegal activities in Pakistan. I think we have to do it if we want to have a peaceful life in Pakistan.