To avoid becoming too general, I'll be specific to this problem. We know this is coming from Afghanistan. Now, in order to contain it ,you need:
1. Border management.
2. Surveillance of Afghans entering Pakistan.
3. Surveillance of money transactions.
4. Monitoring materials that can be used in making bombs. Tracing the materials back to source. Tracing the DNA of criminals back to source.
All of this is NOT ISI's job. ISI's job is to take the fight to the enemy, and monitor our international interests. If they failed to inform us that the source is in Afghanistan with Indian backing, then yes, they would have failed. They have done their jobs and now it is the government's responsibility to ensure peace and security in the country.