What are the challenges in balancing national security and civil liberties when investigating attacks like the grenade incident in Punjab?

The NIA has filed chargesheets in a grenade attack case. I am curious about how security agencies ensure justice while also protecting individual rights during such sensitive investigations.