A LOT of people posting in this thread seem to not even understand what constitutes a 'foreign agent' and are simply associating 'foreign agent' with being a 'foreigner' by using the two as if they are synonyms of each other.
A 'foreign agent' can be a born and bred Pakistani who has simply agreed to help a foreign entity in exchange for money or some other benefit to him. VERY IMPORTANT to REMEMBER, its NOT always MONEY that motivates people to spy against their own country.
Just like India, United States, China, Israel, Iran, Saudi Arabia, U.K, etc have spies in Pakistan (spies who are Pakistanis by birth) - similarly Pakistan has spies in India, Iran, etc who are legal citizens of those countries by birth and have decided to help Pakistan in exchange for money or some other benefit.
It's a two-way street. What Pakistan MUST do on its own end is to eliminate factors that would motivate any citizen of Pakistan to help any foreign entity.
In this regard we are not succeeding. Pakistan has quite a large disenfranchised population and perfectly ripe for foreign entities to use as moles.
Just one example; imagine the case of Bengalis who, during the 1971 war sided with West Pakistanis and paid the ultimate price of having been expelled or forced to flee from newly independent Bangladesh. Today, those loyal Bengalis live in squalor and filth, at the lowest rung of Pakistani society in a place called 'machar colony' in Karachi. NO Pakistani government has ever tried to make life better for them. So if today or tomorrow, a few of them start helping a foreign entity in exchange for the most basic necessities of life such as money for food for their children, would you really blame them?
The above is the most primitive example of someone turning into a 'foreign agent'.
Ofcourse 'foreign agents' are cultivated from different segments of society, the more connected and high profile they are and privileged, the better! But for acts of violence, creating unrest on the streets, the aforementioned poor folks make ripe prey for recruitment.
And ofcourse 'foreign agent' can also be a 'foreigner', residing in the host country under a false identity and occupation.